diff options
| author | Tiger Huang <tigerhuang@google.com> | 2021-05-19 18:03:29 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2021-05-25 13:39:49 +0000 |
| commit | 1ce223481a24c2bc4ee7b49d0435f2f775e1a14b (patch) | |
| tree | 352b215c421849a88f4c2d2e365157d5cc18f155 /core/java/android/view/InsetsAnimationThreadControlRunner.java | |
| parent | f414073a7398b29617177f063e8d218b3d3b2a3e (diff) | |
Flush the animation if it is canceled
The issue was that: if navigation bar is requested to show while a
controller is playing an animation of hiding both status bar and
navigation bar, the animation will be canceled and will stay in an
intermediate state, and then, another controller will play an animation
of showing navigation bar. At the end, status bar will stay visible but
it should be invisible.
This CL fast-forwards the insets animation to the end state if it is
canceled.
Fix: 185459811
Test: Steps in the bug.
Change-Id: Id6ae321b6c153ed1d7155afd6111b193ac9c045c
Diffstat (limited to 'core/java/android/view/InsetsAnimationThreadControlRunner.java')
| -rw-r--r-- | core/java/android/view/InsetsAnimationThreadControlRunner.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java index 436a17c0de0b..c6ebc9e52e84 100644 --- a/core/java/android/view/InsetsAnimationThreadControlRunner.java +++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java @@ -29,6 +29,7 @@ import android.util.Log; import android.util.SparseArray; import android.util.proto.ProtoOutputStream; import android.view.InsetsController.AnimationType; +import android.view.InsetsController.LayoutInsetsDuringAnimation; import android.view.SyncRtSurfaceTransactionApplier.SurfaceParams; import android.view.WindowInsets.Type.InsetsType; import android.view.WindowInsetsAnimation.Bounds; @@ -103,14 +104,15 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro @UiThread public InsetsAnimationThreadControlRunner(SparseArray<InsetsSourceControl> controls, @Nullable Rect frame, InsetsState state, WindowInsetsAnimationControlListener listener, - @InsetsType int types, - InsetsAnimationControlCallbacks controller, long durationMs, Interpolator interpolator, - @AnimationType int animationType, CompatibilityInfo.Translator translator, - Handler mainThreadHandler) { + @InsetsType int types, InsetsAnimationControlCallbacks controller, long durationMs, + Interpolator interpolator, @AnimationType int animationType, + @LayoutInsetsDuringAnimation int layoutInsetsDuringAnimation, + CompatibilityInfo.Translator translator, Handler mainThreadHandler) { mMainThreadHandler = mainThreadHandler; mOuterCallbacks = controller; - mControl = new InsetsAnimationControlImpl(controls, frame, state, listener, - types, mCallbacks, durationMs, interpolator, animationType, translator); + mControl = new InsetsAnimationControlImpl(controls, frame, state, listener, types, + mCallbacks, durationMs, interpolator, animationType, layoutInsetsDuringAnimation, + translator); InsetsAnimationThread.getHandler().post(() -> { if (mControl.isCancelled()) { return; |
