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

Commit 6d96f919 authored by Shan Huang's avatar Shan Huang
Browse files

Fix swipe thresholds not being propagated.

The race is the same one that caused b/220709601

Bug: 227483349
Test: atest BackAnimationControllerTest
Test: Enable back animation flag and test swipe to home animation on P22
device.

Change-Id: I251787cb1ccd1593da4f973894e9845ee58c6244
parent 477735ae
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -360,9 +360,7 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl
                .getDimension(R.dimen.navigation_edge_action_drag_threshold);
        mSwipeProgressThreshold = context.getResources()
                .getDimension(R.dimen.navigation_edge_action_progress_threshold);
        if (mBackAnimation != null) {
            mBackAnimation.setSwipeThresholds(mSwipeTriggerThreshold, mSwipeProgressThreshold);
        }
        initializeBackAnimation();

        setVisibility(GONE);
        Executor backgroundExecutor = Dependency.get(Dependency.BACKGROUND_EXECUTOR);
@@ -391,6 +389,13 @@ public class NavigationBarEdgePanel extends View implements NavigationEdgeBackPl

    public void setBackAnimation(BackAnimation backAnimation) {
        mBackAnimation = backAnimation;
        initializeBackAnimation();
    }

    private void initializeBackAnimation() {
        if (mBackAnimation != null) {
            mBackAnimation.setSwipeThresholds(mSwipeTriggerThreshold, mSwipeProgressThreshold);
        }
    }

    @Override