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

Commit 81d3081b authored by Vinit Nayak's avatar Vinit Nayak Committed by Cherrypicker Worker
Browse files

Revert "Make Navbar Secondary Handle Appear Correctly"

This reverts commit 102e65c1.

Fixes: 314725558
Bug: 299188745
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:28624873fa58dce830d0d2677c9ef93176a6dbac)
Merged-In: I6da596b88bbc2cb7b6e24a18857555abfeb37e3e
Change-Id: I6da596b88bbc2cb7b6e24a18857555abfeb37e3e
24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
parent b75186ff
Loading
Loading
Loading
Loading
+42 −40
Original line number Diff line number Diff line
@@ -930,12 +930,12 @@ public class NavigationBar extends ViewController<NavigationBarView> implements

    private void orientSecondaryHomeHandle() {
        if (!canShowSecondaryHandle()) {
            if (mStartingQuickSwitchRotation == -1) {
                resetSecondaryHandle();
            }
            return;
        }

        if (mStartingQuickSwitchRotation == -1) {
            resetSecondaryHandle();
        } else {
            int deltaRotation = deltaRotation(mCurrentRotation, mStartingQuickSwitchRotation);
            if (mStartingQuickSwitchRotation == -1 || deltaRotation == -1) {
                // Curious if starting quickswitch can change between the if check and our delta
@@ -948,11 +948,13 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            Rect dispSize = mWindowManager.getCurrentWindowMetrics().getBounds();
            mOrientationHandle.setDeltaRotation(deltaRotation);
            switch (deltaRotation) {
            case Surface.ROTATION_90, Surface.ROTATION_270:
                case Surface.ROTATION_90:
                case Surface.ROTATION_270:
                    height = dispSize.height();
                    width = mView.getHeight();
                    break;
            case Surface.ROTATION_180, Surface.ROTATION_0:
                case Surface.ROTATION_180:
                case Surface.ROTATION_0:
                    // TODO(b/152683657): Need to determine best UX for this
                    if (!mShowOrientedHandleForImmersiveMode) {
                        resetSecondaryHandle();
@@ -973,6 +975,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            mOrientationHandle.setVisibility(View.VISIBLE);
            logNavbarOrientation("orientSecondaryHomeHandle");
        }
    }

    private void resetSecondaryHandle() {
        if (mOrientationHandle != null) {
@@ -1785,8 +1788,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    }

    private boolean canShowSecondaryHandle() {
        return mNavBarMode == NAV_BAR_MODE_GESTURAL && mOrientationHandle != null
                && mStartingQuickSwitchRotation != -1;
        return mNavBarMode == NAV_BAR_MODE_GESTURAL && mOrientationHandle != null;
    }

    private final UserTracker.Callback mUserChangedCallback =