Loading core/java/android/view/InsetsController.java +27 −8 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ import java.util.function.BiFunction; */ public class InsetsController implements WindowInsetsController, InsetsAnimationControlCallbacks { private int mTypesBeingCancelled; public interface Host { Handler getHandler(); Loading Loading @@ -809,6 +811,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @AnimationType int animationType, @LayoutInsetsDuringAnimation int layoutInsetsDuringAnimation, boolean useInsetsAnimationThread) { if ((types & mTypesBeingCancelled) != 0) { throw new IllegalStateException("Cannot start a new insets animation of " + Type.toString(types) + " while an existing " + Type.toString(mTypesBeingCancelled) + " is being cancelled."); } if (types == 0) { // nothing to animate. listener.onCancelled(null); Loading Loading @@ -868,7 +876,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (DEBUG) Log.d(TAG, "Animation added to runner. useInsetsAnimationThread: " + useInsetsAnimationThread); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(runner::cancel); cancellationSignal.setOnCancelListener(() -> { cancelAnimation(runner, true /* invokeCallback */); }); } if (layoutInsetsDuringAnimation == LAYOUT_INSETS_DURING_ANIMATION_SHOWN) { showDirectly(types); Loading Loading @@ -963,6 +973,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } private void cancelExistingControllers(@InsetsType int types) { final int originalmTypesBeingCancelled = mTypesBeingCancelled; mTypesBeingCancelled |= types; try { for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner; if ((control.getTypes() & types) != 0) { Loading @@ -972,6 +985,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if ((types & ime()) != 0) { abortPendingImeControlRequest(); } } finally { mTypesBeingCancelled = originalmTypesBeingCancelled; } } private void abortPendingImeControlRequest() { Loading Loading @@ -1029,6 +1045,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mHost.notifyInsetsChanged(); } } if (invokeCallback && runningAnimation.startDispatched) { dispatchAnimationEnd(runningAnimation.runner.getAnimation()); } break; } } Loading Loading
core/java/android/view/InsetsController.java +27 −8 Original line number Diff line number Diff line Loading @@ -70,6 +70,8 @@ import java.util.function.BiFunction; */ public class InsetsController implements WindowInsetsController, InsetsAnimationControlCallbacks { private int mTypesBeingCancelled; public interface Host { Handler getHandler(); Loading Loading @@ -809,6 +811,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @AnimationType int animationType, @LayoutInsetsDuringAnimation int layoutInsetsDuringAnimation, boolean useInsetsAnimationThread) { if ((types & mTypesBeingCancelled) != 0) { throw new IllegalStateException("Cannot start a new insets animation of " + Type.toString(types) + " while an existing " + Type.toString(mTypesBeingCancelled) + " is being cancelled."); } if (types == 0) { // nothing to animate. listener.onCancelled(null); Loading Loading @@ -868,7 +876,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if (DEBUG) Log.d(TAG, "Animation added to runner. useInsetsAnimationThread: " + useInsetsAnimationThread); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(runner::cancel); cancellationSignal.setOnCancelListener(() -> { cancelAnimation(runner, true /* invokeCallback */); }); } if (layoutInsetsDuringAnimation == LAYOUT_INSETS_DURING_ANIMATION_SHOWN) { showDirectly(types); Loading Loading @@ -963,6 +973,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } private void cancelExistingControllers(@InsetsType int types) { final int originalmTypesBeingCancelled = mTypesBeingCancelled; mTypesBeingCancelled |= types; try { for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner; if ((control.getTypes() & types) != 0) { Loading @@ -972,6 +985,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation if ((types & ime()) != 0) { abortPendingImeControlRequest(); } } finally { mTypesBeingCancelled = originalmTypesBeingCancelled; } } private void abortPendingImeControlRequest() { Loading Loading @@ -1029,6 +1045,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mHost.notifyInsetsChanged(); } } if (invokeCallback && runningAnimation.startDispatched) { dispatchAnimationEnd(runningAnimation.runner.getAnimation()); } break; } } Loading