File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,11 +124,21 @@ protected void onCreate(final Bundle savedInstanceState) {
124124 // Pass-through touch events to background activities
125125 // so that our transparent window won't lock UI in the mean time
126126 // network request is underway before showing PlaylistDialog or DownloadDialog
127- // (courtesy of https://stackoverflow.com/a/10606141)
127+ // (ref: https://stackoverflow.com/a/10606141)
128128 getWindow ().addFlags (WindowManager .LayoutParams .FLAG_NOT_FOCUSABLE
129129 | WindowManager .LayoutParams .FLAG_NOT_TOUCH_MODAL
130130 | WindowManager .LayoutParams .FLAG_NOT_TOUCHABLE );
131131
132+ // Android never fails to impress us with a list of new restrictions per API.
133+ // Starting with S (Android 12) one of the prerequisite conditions has to be met
134+ // before the FLAG_NOT_TOUCHABLE flag is allowed to kick in:
135+ // @see WindowManager.LayoutParams#FLAG_NOT_TOUCHABLE
136+ // For our present purpose it seems we can just set LayoutParams.alpha to 0
137+ // on the strength of "4. Fully transparent windows" without affecting the scrim of dialogs
138+ final WindowManager .LayoutParams params = getWindow ().getAttributes ();
139+ params .alpha = 0f ;
140+ getWindow ().setAttributes (params );
141+
132142 super .onCreate (savedInstanceState );
133143 Icepick .restoreInstanceState (this , savedInstanceState );
134144
You can’t perform that action at this time.
0 commit comments