Skip to content

Commit 3d8b737

Browse files
feat: make UI runnable while waiting for content to be loaded
1 parent 16c41da commit 3d8b737

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sdk/src/main/java/ly/count/android/sdk/TransparentActivity.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ protected void onCreate(Bundle savedInstanceState) {
103103

104104
params.height = config.height;
105105
params.width = config.width;
106-
params.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
107-
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
106+
params.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
107+
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
108108
getWindow().setAttributes(params);
109-
109+
110110
WindowManager.LayoutParams verifyParams = getWindow().getAttributes();
111111
Log.d(Countly.TAG, "[TransparentActivity] onCreate, AFTER setAttributes - params.x: [" + verifyParams.x + "], params.y: [" + verifyParams.y + "], params.gravity: [" + verifyParams.gravity + "], width: [" + verifyParams.width + "], height: [" + verifyParams.height + "]");
112-
112+
113113
getWindow().setBackgroundDrawableResource(android.R.color.transparent);
114114

115115
// Create and configure the layout
@@ -562,6 +562,11 @@ private WebView createWebView(TransparentActivityConfig config) {
562562
Countly.sharedInstance().moduleContent.notifyAfterContentIsClosed();
563563
}
564564
} else {
565+
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
566+
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
567+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
568+
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
569+
565570
TransparentActivityConfig currentConfig = currentOrientation == Configuration.ORIENTATION_LANDSCAPE ? configLandscape : configPortrait;
566571
if (currentConfig != null && !currentConfig.useSafeArea) {
567572
hideSystemUI();

0 commit comments

Comments
 (0)