diff options
| author | 2022-03-30 18:09:51 +0000 | |
|---|---|---|
| committer | 2022-03-30 18:19:42 +0000 | |
| commit | 6d96f919c47d9e5b66b8f12e0ec2ddab24364139 (patch) | |
| tree | 12d934e3e66fd732bcc81f2eb7a1a1ec47475d34 | |
| parent | 477735ae40c2afb658c57e0d5461c4c9716d80e3 (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/navigationbar/gestural/NavigationBarEdgePanel.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/NavigationBarEdgePanel.java b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/NavigationBarEdgePanel.java index a1258df7a12c..5e65a5a78333 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/NavigationBarEdgePanel.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/NavigationBarEdgePanel.java @@ -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 |