Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 136ffeae authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Gerrit Code Review
Browse files

Merge "systemui: improve DessertCaseDream immersive mode exit" into cm-11.0

parents 0cd79621 64a04d87
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@ public class DessertCaseDream extends DreamService {
    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        setInteractive(false);
        setInteractive(true);
        setFullscreen(true);

        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
        final boolean isCM = prefs.getBoolean("dessert_case_cm", false);
@@ -41,7 +42,7 @@ public class DessertCaseDream extends DreamService {
            mView = new DessertCaseView(this);
        }

        mContainer = new DessertCaseView.RescalingContainer(this);
        mContainer = new DessertCaseView.RescalingContainer(this, true);

        mContainer.setView(mView);

+21 −8
Original line number Diff line number Diff line
@@ -522,8 +522,20 @@ public class DessertCaseView extends FrameLayout {
        private float mDarkness;

        public RescalingContainer(Context context) {
            this(context, false);
        }

        RescalingContainer(Context context, boolean dayDream) {
            super(context);

            if (dayDream) {
                // For daydream is better to use setFullscreen + this window flags
                // It creates a better ux exiting from immersive mode
                setSystemUiVisibility(0
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
            } else {
                setSystemUiVisibility(0
                        | View.SYSTEM_UI_FLAG_FULLSCREEN
                        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
@@ -533,6 +545,7 @@ public class DessertCaseView extends FrameLayout {
                        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                        );
            }
        }

        public void setView(DessertCaseView v) {
            addView(v);