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

Commit f8fbee4f authored by Abhishek Aggarwal's avatar Abhishek Aggarwal Committed by Nishith Khanna
Browse files

fix(workspace): Get defaults right for non -1 pages

parent 719f73aa
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1454,13 +1454,13 @@ public class Workspace extends PagedView<WorkspacePageIndicatorDots>
    public void setCurrentPage(int currentPage, int overridePrevPage) {
        if (MultiModeController.isSingleLayerMode()) {
            Hotseat hotseat = getHotseat();
            PageIndicatorDots pageIndicatorDots = getPageIndicator();
            if (currentPage == FIRST_SCREEN_ID) {
                int height = hotseat.getHeight() + getPageIndicator().getHeight();
                if (hotseat.getTranslationY() >= 0) {
                    hotseat.setForcedTranslationY(height);
                }

                PageIndicatorDots pageIndicatorDots = (PageIndicatorDots) getPageIndicator();
                if (pageIndicatorDots.getTranslationY() >= 0) {
                    pageIndicatorDots.setForcedTranslationY(height);
                }
@@ -1468,9 +1468,16 @@ public class Workspace extends PagedView<WorkspacePageIndicatorDots>
                mLauncher.mBlurLayer.setAlpha(1);
                getWindowInsetsController().hide(WindowInsetsCompat.Type.statusBars());
            } else {
                mLauncher.mBlurLayer.setAlpha(0);
                getWindowInsetsController().show(WindowInsetsCompat.Type.statusBars());

                if (hotseat.getTranslationY() != 0) {
                    hotseat.setForcedTranslationY(0);
                }

                if (pageIndicatorDots.getTranslationY() != 0) {
                    pageIndicatorDots.setForcedTranslationY(0);
                }
            }
        }
        super.setCurrentPage(currentPage, overridePrevPage);