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

Commit 9c0ad5f7 authored by Jon Miranda's avatar Jon Miranda Committed by Automerger Merge Worker
Browse files

Merge "Add spring animation when stashing transient taskbar." into tm-qpr-dev am: ba851545

parents ce97be3d ba851545
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -300,6 +300,8 @@
    <dimen name="transient_taskbar_key_shadow_distance">10dp</dimen>
    <dimen name="transient_taskbar_stashed_size">32dp</dimen>
    <dimen name="transient_taskbar_all_apps_button_translation_x_offset">4dp</dimen>
    <dimen name="transient_taskbar_stash_spring_velocity_dp_per_s">400dp</dimen>

    <!-- An additional touch slop to prevent x-axis movement during the swipe up to show taskbar -->
    <dimen name="transient_taskbar_clamped_offset_bound">16dp</dimen>
    <!-- Taskbar swipe up thresholds -->
+17 −1
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
    private boolean mIsStashed;
    private boolean mTaskbarHidden;

    private float mTranslationYForSwipe;
    private float mTranslationYForStash;

    public StashedHandleViewController(TaskbarActivityContext activity,
            StashedHandleView stashedHandleView) {
        mActivity = activity;
@@ -254,7 +257,20 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
     * Sets the translation of the stashed handle during the swipe up gesture.
     */
    protected void setTranslationYForSwipe(float transY) {
        mStashedHandleView.setTranslationY(transY);
        mTranslationYForSwipe = transY;
        updateTranslationY();
    }

    /**
     * Sets the translation of the stashed handle during the spring on stash animation.
     */
    protected void setTranslationYForStash(float transY) {
        mTranslationYForStash = transY;
        updateTranslationY();
    }

    private void updateTranslationY() {
        mStashedHandleView.setTranslationY(mTranslationYForSwipe + mTranslationYForStash);
    }

    /**
+1 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                new TaskbarInsetsController(this),
                new VoiceInteractionWindowController(this),
                new TaskbarTranslationController(this),
                new TaskbarSpringOnStashController(this),
                isDesktopMode
                        ? new DesktopTaskbarRecentAppsController(this)
                        : TaskbarRecentAppsController.DEFAULT,
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) {
    val lastDrawnTransientRect = RectF()
    var backgroundHeight = context.deviceProfile.taskbarSize.toFloat()
    var translationYForSwipe = 0f
    var translationYForStash = 0f

    private var maxBackgroundHeight = context.deviceProfile.taskbarSize.toFloat()
    private val transientBackgroundBounds = context.transientTaskbarBounds
@@ -136,7 +137,9 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) {
            val bottom =
                canvas.height - bottomMargin +
                    bottomMarginProgress +
                    (-mapRange(1f - progress, 0f, stashedHandleHeight / 2f) + translationYForSwipe)
                    translationYForSwipe +
                    translationYForStash +
                    -mapRange(1f - progress, 0f, stashedHandleHeight / 2f)

            // Draw shadow.
            val shadowAlpha =
+4 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ public class TaskbarControllers {
    public final VoiceInteractionWindowController voiceInteractionWindowController;
    public final TaskbarRecentAppsController taskbarRecentAppsController;
    public final TaskbarTranslationController taskbarTranslationController;
    public final TaskbarSpringOnStashController taskbarSpringOnStashController;
    public final TaskbarOverlayController taskbarOverlayController;
    public final TaskbarEduTooltipController taskbarEduTooltipController;
    public final KeyboardQuickSwitchController keyboardQuickSwitchController;
@@ -103,6 +104,7 @@ public class TaskbarControllers {
            TaskbarInsetsController taskbarInsetsController,
            VoiceInteractionWindowController voiceInteractionWindowController,
            TaskbarTranslationController taskbarTranslationController,
            TaskbarSpringOnStashController taskbarSpringOnStashController,
            TaskbarRecentAppsController taskbarRecentAppsController,
            TaskbarEduTooltipController taskbarEduTooltipController,
            KeyboardQuickSwitchController keyboardQuickSwitchController) {
@@ -127,6 +129,7 @@ public class TaskbarControllers {
        this.taskbarInsetsController = taskbarInsetsController;
        this.voiceInteractionWindowController = voiceInteractionWindowController;
        this.taskbarTranslationController = taskbarTranslationController;
        this.taskbarSpringOnStashController = taskbarSpringOnStashController;
        this.taskbarRecentAppsController = taskbarRecentAppsController;
        this.taskbarEduTooltipController = taskbarEduTooltipController;
        this.keyboardQuickSwitchController = keyboardQuickSwitchController;
@@ -149,6 +152,7 @@ public class TaskbarControllers {
        taskbarScrimViewController.init(this);
        taskbarUnfoldAnimationController.init(this);
        taskbarKeyguardController.init(navbarButtonsViewController);
        taskbarSpringOnStashController.init(this);
        stashedHandleViewController.init(this);
        taskbarStashController.init(this, sharedState.setupUIVisible);
        taskbarEduController.init(this);
Loading