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

Commit d48354a5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "fix: small quality of life fixes for A11yMenu" into main

parents 963c7593 a726fd2e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.accessibility.accessibilitymenu.view;

import static android.accessibilityservice.AccessibilityService.GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE;
import static android.os.UserManager.DISALLOW_ADJUST_VOLUME;
import static android.os.UserManager.DISALLOW_CONFIG_BRIGHTNESS;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -363,6 +364,7 @@ public class A11yMenuOverlayLayout {
                    mLayout, createShortcutList(), getPageIndex());
            updateViewLayout();

            mService.performGlobalAction(GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE);
            mLayout.setVisibility(View.VISIBLE);
        }
    }
+5 −5
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class A11yMenuViewPager {
                a11yMenuLayout.getResources().getConfiguration());
        updateFooterState();
        registerOnGlobalLayoutListener();
        goToPage(pageIndex);
        goToPage(pageIndex, /*shouldAnimate=*/ false);
    }

    /** Initializes viewPager and its adapter. */
@@ -213,12 +213,12 @@ public class A11yMenuViewPager {
        mA11yMenuFooter.getNextPageBtn().setEnabled(currentPage < lastPage);
    }

    private void goToPage(int pageIndex) {
    private void goToPage(int pageIndex, boolean shouldAnimate) {
        if (mViewPager == null) {
            return;
        }
        if ((pageIndex >= 0) && (pageIndex < mViewPager.getAdapter().getItemCount())) {
            mViewPager.setCurrentItem(pageIndex);
            mViewPager.setCurrentItem(pageIndex, shouldAnimate);
        }
    }

@@ -329,7 +329,7 @@ public class A11yMenuViewPager {
                public void onPreviousButtonClicked() {
                    // Moves to previous page.
                    int targetPage = mViewPager.getCurrentItem() - 1;
                    goToPage(targetPage);
                    goToPage(targetPage, /*shouldAnimate=*/ true);
                    updateFooterState();
                }

@@ -337,7 +337,7 @@ public class A11yMenuViewPager {
                public void onNextButtonClicked() {
                    // Moves to next page.
                    int targetPage = mViewPager.getCurrentItem() + 1;
                    goToPage(targetPage);
                    goToPage(targetPage, /*shouldAnimate=*/ true);
                    updateFooterState();
                }
            };