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

Commit 85a9bea6 authored by Mike Digman's avatar Mike Digman
Browse files

Fix hard to touch and stuck navbar rotate icon

Hide rotate button on Quickstep navbar grab. Prior signals
didn't always capture this. Launcher now also changes its
requested orientation on touch, ignore that. Pause callback
made hide animator unexpectedly isRunning=true causing the
icon to never fade out, should be fixed now.

Test: manual
Change-Id: I4bb39d57d9cef5748aadf2f18c640feba3f53775
parent 3d529f76
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -167,6 +167,9 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
        @Override
        public void onRecentsAnimationStarted() {
            mNavigationBarView.setRecentsAnimationStarted(true);

            // Use navbar dragging as a signal to hide the rotate button
            setRotateSuggestionButtonState(false);
        }

        @Override
@@ -446,10 +449,11 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
        }

        if (visible) { // Appear and change (cannot force)
            // Stop any currently running hide animations
            // Stop and clear any currently running hide animations
            if (mRotateHideAnimator != null && mRotateHideAnimator.isRunning()) {
                mRotateHideAnimator.pause();
                mRotateHideAnimator.cancel();
            }
            mRotateHideAnimator = null;

            // Reset the alpha if any has changed due to hide animation
            view.setAlpha(1f);
@@ -978,7 +982,10 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

        @Override
        public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation) {
            setRotateSuggestionButtonState(false);
            // Only hide the icon if the top task changes its requestedOrientation
            // Launcher can alter its requestedOrientation while it's not on top, don't hide on this
            final boolean top = ActivityManagerWrapper.getInstance().getRunningTask().id == taskId;
            if (top) setRotateSuggestionButtonState(false);
        }
    }