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

Commit b8ddc944 authored by Sukesh Ram's avatar Sukesh Ram
Browse files

Fix 3-Button Color w/ Widget Sheet post-Rotation

Fixed issue where upon opening the widgets menu in the home screen in landscape, then rotating screen to portrait, then back to landscape (whilst keeping widget sheet open), the buttons are dim colored rather than white.

Flag: NONE
Test: Manually tested in pixel 7 in light mode and dark mode (with home screen rotation enabled).
Bug: 284801356
Change-Id: I0ed59373eb3af5f1b5ab695b43b850777042d2eb
parent b265cf8f
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -109,6 +109,7 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
            mNavBarScrimPaint.setColor(navBarScrimColor);
            mNavBarScrimPaint.setColor(navBarScrimColor);
            invalidate();
            invalidate();
        }
        }
        setupNavBarColor();
    }
    }


    @Override
    @Override
@@ -228,10 +229,18 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
    }
    }


    protected void setupNavBarColor() {
    protected void setupNavBarColor() {
        boolean isSheetDark = Themes.getAttrBoolean(getContext(), R.attr.isMainColorDark);
        boolean isNavBarDark = Themes.getAttrBoolean(getContext(), R.attr.isMainColorDark);
        getSystemUiController().updateUiState(

                SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET,
        // In light mode, landscape reverses navbar background color.
                isSheetDark ? SystemUiController.FLAG_DARK_NAV : SystemUiController.FLAG_LIGHT_NAV);
        boolean isPhoneLandscape =
                !mActivityContext.getDeviceProfile().isTablet && mInsets.bottom == 0;
        if (!isNavBarDark && isPhoneLandscape) {
            isNavBarDark = true;
        }

        getSystemUiController().updateUiState(SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET,
                isNavBarDark ? SystemUiController.FLAG_DARK_NAV
                        : SystemUiController.FLAG_LIGHT_NAV);
    }
    }


    protected SystemUiController getSystemUiController() {
    protected SystemUiController getSystemUiController() {