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

Commit c600f920 authored by Michael Bestas's avatar Michael Bestas Committed by LuK1337
Browse files

fixup! Implement edge long swipe gesture

Change-Id: I8fc89cb70a10a153f79753d59c77617cc96b5019
parent 679a239d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public interface NavigationEdgeBackPlugin extends Plugin {
    void setBackCallback(BackCallback callback);

    /** Specifies if the long swipe should be enabled or not. */
    void setLongSwipeEnabled(boolean enabled);
    default void setLongSwipeEnabled(boolean enabled) {}

    /** Sets the base LayoutParams for the UI. */
    void setLayoutParams(WindowManager.LayoutParams layoutParams);
@@ -72,5 +72,13 @@ public interface NavigationEdgeBackPlugin extends Plugin {
         */
        // TODO(b/247883311): Remove default impl once SwipeBackGestureHandler overrides this.
        default void setTriggerBack(boolean triggerBack) {}

        /**
         * Indicates if long swipe will be triggered if committed in current state.
         *
         * @param triggerLongSwipe if long swipe will be triggered in current state.
         */
        // TODO(b/247883311): Remove default impl once SwipeBackGestureHandler overrides this.
        default void setTriggerLongSwipe(boolean triggerLongSwipe) {}
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -519,7 +519,7 @@ class BackPanelController private constructor(
        }
        // Dispatch the actual back trigger
        if (DEBUG) Log.d(TAG, "playCommitBackAnimation() invoked triggerBack() on backCallback")
        backCallback.triggerBack()
        backCallback.triggerBack(false)

        playAnimation(setGoneEndListener)
    }
+7 −0
Original line number Diff line number Diff line
@@ -324,6 +324,13 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
                        mBackAnimation.setTriggerBack(triggerBack);
                    }
                }

                @Override
                public void setTriggerLongSwipe(boolean triggerLongSwipe) {
                    if (mBackAnimation != null) {
                        mBackAnimation.setTriggerLongSwipe(triggerLongSwipe);
                    }
                }
            };

    private final SysUiState.SysUiStateCallback mSysUiStateCallback =
+1 −3
Original line number Diff line number Diff line
@@ -920,9 +920,7 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
            // Whenever the trigger back state changes the existing translation animation should be
            // cancelled
            mTranslationAnimation.cancel();
            if (mBackAnimation != null) {
                mBackAnimation.setTriggerLongSwipe(triggerLongSwipe);
            }
            mBackCallback.setTriggerLongSwipe(mTriggerLongSwipe);
        }
    }