Skip to content

Commit 9166053

Browse files
committed
Make IAM popupWindow focusable
This allows the keyboard to be displayed for text input in HTML IAMs
1 parent 54ab98e commit 9166053

File tree

1 file changed

+6
-5
lines changed
  • OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/display/impl

1 file changed

+6
-5
lines changed

OneSignalSDK/onesignal/in-app-messages/src/main/java/com/onesignal/inAppMessages/internal/display/impl/InAppMessageView.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ internal class InAppMessageView(
104104

105105
fun setWebView(webView: WebView) {
106106
this.webView = webView
107-
this.webView!!.setBackgroundColor(Color.TRANSPARENT)
107+
this.webView?.setBackgroundColor(Color.TRANSPARENT)
108108
}
109109

110110
fun setMessageController(messageController: InAppMessageViewListener?) {
@@ -277,10 +277,11 @@ internal class InAppMessageView(
277277
if (hasBackground) WindowManager.LayoutParams.MATCH_PARENT else WindowManager.LayoutParams.WRAP_CONTENT,
278278
false,
279279
)
280-
popupWindow!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
281-
popupWindow!!.isTouchable = true
280+
popupWindow?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
281+
popupWindow?.isTouchable = true
282+
popupWindow?.isFocusable = true
282283
// NOTE: This is required for getting fullscreen under notches working in portrait mode
283-
popupWindow!!.isClippingEnabled = false
284+
popupWindow?.isClippingEnabled = false
284285
var gravity = 0
285286
if (!hasBackground) {
286287
gravity =
@@ -299,7 +300,7 @@ internal class InAppMessageView(
299300
popupWindow!!,
300301
displayType,
301302
)
302-
popupWindow!!.showAtLocation(
303+
popupWindow?.showAtLocation(
303304
currentActivity!!.window.decorView.rootView,
304305
gravity,
305306
0,

0 commit comments

Comments
 (0)