mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Ensure our transparent activity doesn't block touch events to underlying windows
so we won't hold up UI while fetching media info for Add to Playlist or Download actions lest user might think it freezes when in fact a network request is underway
This commit is contained in:
parent
c1f37d8591
commit
391830558e
@ -16,6 +16,7 @@ import android.view.ContextThemeWrapper;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
@ -120,6 +121,14 @@ public class RouterActivity extends AppCompatActivity {
|
|||||||
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
|
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
|
||||||
Localization.assureCorrectAppLanguage(this);
|
Localization.assureCorrectAppLanguage(this);
|
||||||
|
|
||||||
|
// Pass-through touch events to background activities
|
||||||
|
// so that our transparent window won't lock UI in the mean time
|
||||||
|
// network request is underway before showing PlaylistDialog or DownloadDialog
|
||||||
|
// (courtesy of https://stackoverflow.com/a/10606141)
|
||||||
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||||
|
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||||
|
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Icepick.restoreInstanceState(this, savedInstanceState);
|
Icepick.restoreInstanceState(this, savedInstanceState);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user