kopia lustrzana https://github.com/TeamNewPipe/NewPipe
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 underwaypull/9135/head
rodzic
c1f37d8591
commit
391830558e
|
@ -16,6 +16,7 @@ import android.view.ContextThemeWrapper;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
@ -120,6 +121,14 @@ public class RouterActivity extends AppCompatActivity {
|
|||
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
|
||||
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);
|
||||
Icepick.restoreInstanceState(this, savedInstanceState);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue