Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -55580,7 +55580,7 @@ package android.view { public interface WindowInsetsController { method public void addOnControllableInsetsChangedListener(@NonNull android.view.WindowInsetsController.OnControllableInsetsChangedListener); method @NonNull public android.os.CancellationSignal controlWindowInsetsAnimation(int, long, @Nullable android.view.animation.Interpolator, @NonNull android.view.WindowInsetsAnimationControlListener); method public void controlWindowInsetsAnimation(int, long, @Nullable android.view.animation.Interpolator, @Nullable android.os.CancellationSignal, @NonNull android.view.WindowInsetsAnimationControlListener); method public int getSystemBarsAppearance(); method public int getSystemBarsBehavior(); method public void hide(int); core/java/android/view/InsetsController.java +32 −30 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -494,13 +493,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation PendingControlRequest pendingRequest = mPendingImeControlRequest; mPendingImeControlRequest = null; mHandler.removeCallbacks(mPendingControlTimeout); CancellationSignal cancellationSignal = controlAnimationUnchecked( pendingRequest.types, controlAnimationUnchecked( pendingRequest.types, pendingRequest.cancellationSignal, pendingRequest.listener, mFrame, true /* fromIme */, pendingRequest.durationMs, pendingRequest.interpolator, false /* fade */, pendingRequest.animationType, pendingRequest.layoutInsetsDuringAnimation); pendingRequest.cancellationSignal.setOnCancelListener(cancellationSignal::cancel); return; } Loading Loading @@ -546,24 +544,26 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } @Override public CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, long durationMs, public void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, @Nullable CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener) { return controlWindowInsetsAnimation(types, listener, false /* fromIme */, durationMs, interpolator, ANIMATION_TYPE_USER); controlWindowInsetsAnimation(types, cancellationSignal, listener, false /* fromIme */, durationMillis, interpolator, ANIMATION_TYPE_USER); } private CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, WindowInsetsAnimationControlListener listener, boolean fromIme, long durationMs, @Nullable Interpolator interpolator, @AnimationType int animationType) { private void controlWindowInsetsAnimation(@InsetsType int types, @Nullable CancellationSignal cancellationSignal, WindowInsetsAnimationControlListener listener, boolean fromIme, long durationMs, @Nullable Interpolator interpolator, @AnimationType int animationType) { if (!checkDisplayFramesForControlling()) { listener.onCancelled(); CancellationSignal cancellationSignal = new CancellationSignal(); cancellationSignal.cancel(); return cancellationSignal; return; } return controlAnimationUnchecked(types, listener, mFrame, fromIme, durationMs, interpolator, false /* fade */, animationType, getLayoutInsetsDuringAnimationMode(types)); controlAnimationUnchecked(types, cancellationSignal, listener, mFrame, fromIme, durationMs, interpolator, false /* fade */, animationType, getLayoutInsetsDuringAnimationMode(types)); } private boolean checkDisplayFramesForControlling() { Loading @@ -573,17 +573,16 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation return mState.getDisplayFrame().equals(mFrame); } private CancellationSignal controlAnimationUnchecked(@InsetsType int types, private void controlAnimationUnchecked(@InsetsType int types, @Nullable CancellationSignal cancellationSignal, WindowInsetsAnimationControlListener listener, Rect frame, boolean fromIme, long durationMs, Interpolator interpolator, boolean fade, @AnimationType int animationType, @LayoutInsetsDuringAnimation int layoutInsetsDuringAnimation) { CancellationSignal cancellationSignal = new CancellationSignal(); if (types == 0) { // nothing to animate. listener.onCancelled(); cancellationSignal.cancel(); return cancellationSignal; return; } cancelExistingControllers(types); mLastStartedAnimTypes |= types; Loading @@ -603,26 +602,28 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation interpolator, animationType, layoutInsetsDuringAnimation, cancellationSignal); mPendingImeControlRequest = request; mHandler.postDelayed(mPendingControlTimeout, PENDING_CONTROL_TIMEOUT_MS); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(() -> { if (mPendingImeControlRequest == request) { abortPendingImeControlRequest(); } }); return cancellationSignal; } return; } if (typesReady == 0) { listener.onCancelled(); cancellationSignal.cancel(); return cancellationSignal; return; } final InsetsAnimationControlImpl controller = new InsetsAnimationControlImpl(controls, frame, mState, listener, typesReady, this, durationMs, interpolator, fade, layoutInsetsDuringAnimation, animationType); mRunningAnimations.add(new RunningAnimation(controller, animationType)); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(controller::onCancelled); return cancellationSignal; } } /** Loading Loading @@ -883,7 +884,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation // Show/hide animations always need to be relative to the display frame, in order that shown // and hidden state insets are correct. controlAnimationUnchecked( types, listener, mState.getDisplayFrame(), fromIme, listener.getDurationMs(), types, new CancellationSignal(), listener, mState.getDisplayFrame(), fromIme, listener.getDurationMs(), INTERPOLATOR, true /* fade */, show ? ANIMATION_TYPE_SHOW : ANIMATION_TYPE_HIDE, show ? LAYOUT_INSETS_DURING_ANIMATION_SHOWN : LAYOUT_INSETS_DURING_ANIMATION_HIDDEN); Loading core/java/android/view/PendingInsetsController.java +15 −15 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.CancellationSignal; import android.view.WindowInsets.Type.InsetsType; import android.view.animation.Interpolator; Loading Loading @@ -59,21 +61,6 @@ public class PendingInsetsController implements WindowInsetsController { } } @Override public CancellationSignal controlWindowInsetsAnimation(int types, long durationMillis, Interpolator interpolator, WindowInsetsAnimationControlListener listener) { if (mReplayedInsetsController != null) { return mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis, interpolator, listener); } else { listener.onCancelled(); CancellationSignal cancellationSignal = new CancellationSignal(); cancellationSignal.cancel(); return cancellationSignal; } } @Override public void setSystemBarsAppearance(int appearance, int mask) { if (mReplayedInsetsController != null) { Loading Loading @@ -176,6 +163,19 @@ public class PendingInsetsController implements WindowInsetsController { mReplayedInsetsController = null; } @Override public void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener) { if (mReplayedInsetsController != null) { mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis, interpolator, cancellationSignal, listener); } else { listener.onCancelled(); } } private interface PendingRequest { void replay(InsetsController controller); } Loading core/java/android/view/WindowInsetsAnimationControlListener.java +0 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.view; import android.annotation.Hide; import android.annotation.NonNull; import android.view.WindowInsets.Type.InsetsType; import android.view.inputmethod.EditorInfo; Loading core/java/android/view/WindowInsetsController.java +5 −4 Original line number Diff line number Diff line Loading @@ -156,16 +156,17 @@ public interface WindowInsetsController { * calculate {@link WindowInsetsAnimation#getInterpolatedFraction()}. * @param listener The {@link WindowInsetsAnimationControlListener} that gets called when the * windows are ready to be controlled, among other callbacks. * @return A cancellation signal that the caller can use to cancel the request to obtain * control, or once they have control, to cancel the control. * @param cancellationSignal A cancellation signal that the caller can use to cancel the * request to obtain control, or once they have control, to cancel the * control. * @see WindowInsetsAnimation#getFraction() * @see WindowInsetsAnimation#getInterpolatedFraction() * @see WindowInsetsAnimation#getInterpolator() * @see WindowInsetsAnimation#getDurationMillis() */ @NonNull CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, @Nullable CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener); /** Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -55580,7 +55580,7 @@ package android.view { public interface WindowInsetsController { method public void addOnControllableInsetsChangedListener(@NonNull android.view.WindowInsetsController.OnControllableInsetsChangedListener); method @NonNull public android.os.CancellationSignal controlWindowInsetsAnimation(int, long, @Nullable android.view.animation.Interpolator, @NonNull android.view.WindowInsetsAnimationControlListener); method public void controlWindowInsetsAnimation(int, long, @Nullable android.view.animation.Interpolator, @Nullable android.os.CancellationSignal, @NonNull android.view.WindowInsetsAnimationControlListener); method public int getSystemBarsAppearance(); method public int getSystemBarsBehavior(); method public void hide(int);
core/java/android/view/InsetsController.java +32 −30 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -494,13 +493,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation PendingControlRequest pendingRequest = mPendingImeControlRequest; mPendingImeControlRequest = null; mHandler.removeCallbacks(mPendingControlTimeout); CancellationSignal cancellationSignal = controlAnimationUnchecked( pendingRequest.types, controlAnimationUnchecked( pendingRequest.types, pendingRequest.cancellationSignal, pendingRequest.listener, mFrame, true /* fromIme */, pendingRequest.durationMs, pendingRequest.interpolator, false /* fade */, pendingRequest.animationType, pendingRequest.layoutInsetsDuringAnimation); pendingRequest.cancellationSignal.setOnCancelListener(cancellationSignal::cancel); return; } Loading Loading @@ -546,24 +544,26 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } @Override public CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, long durationMs, public void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, @Nullable CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener) { return controlWindowInsetsAnimation(types, listener, false /* fromIme */, durationMs, interpolator, ANIMATION_TYPE_USER); controlWindowInsetsAnimation(types, cancellationSignal, listener, false /* fromIme */, durationMillis, interpolator, ANIMATION_TYPE_USER); } private CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, WindowInsetsAnimationControlListener listener, boolean fromIme, long durationMs, @Nullable Interpolator interpolator, @AnimationType int animationType) { private void controlWindowInsetsAnimation(@InsetsType int types, @Nullable CancellationSignal cancellationSignal, WindowInsetsAnimationControlListener listener, boolean fromIme, long durationMs, @Nullable Interpolator interpolator, @AnimationType int animationType) { if (!checkDisplayFramesForControlling()) { listener.onCancelled(); CancellationSignal cancellationSignal = new CancellationSignal(); cancellationSignal.cancel(); return cancellationSignal; return; } return controlAnimationUnchecked(types, listener, mFrame, fromIme, durationMs, interpolator, false /* fade */, animationType, getLayoutInsetsDuringAnimationMode(types)); controlAnimationUnchecked(types, cancellationSignal, listener, mFrame, fromIme, durationMs, interpolator, false /* fade */, animationType, getLayoutInsetsDuringAnimationMode(types)); } private boolean checkDisplayFramesForControlling() { Loading @@ -573,17 +573,16 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation return mState.getDisplayFrame().equals(mFrame); } private CancellationSignal controlAnimationUnchecked(@InsetsType int types, private void controlAnimationUnchecked(@InsetsType int types, @Nullable CancellationSignal cancellationSignal, WindowInsetsAnimationControlListener listener, Rect frame, boolean fromIme, long durationMs, Interpolator interpolator, boolean fade, @AnimationType int animationType, @LayoutInsetsDuringAnimation int layoutInsetsDuringAnimation) { CancellationSignal cancellationSignal = new CancellationSignal(); if (types == 0) { // nothing to animate. listener.onCancelled(); cancellationSignal.cancel(); return cancellationSignal; return; } cancelExistingControllers(types); mLastStartedAnimTypes |= types; Loading @@ -603,26 +602,28 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation interpolator, animationType, layoutInsetsDuringAnimation, cancellationSignal); mPendingImeControlRequest = request; mHandler.postDelayed(mPendingControlTimeout, PENDING_CONTROL_TIMEOUT_MS); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(() -> { if (mPendingImeControlRequest == request) { abortPendingImeControlRequest(); } }); return cancellationSignal; } return; } if (typesReady == 0) { listener.onCancelled(); cancellationSignal.cancel(); return cancellationSignal; return; } final InsetsAnimationControlImpl controller = new InsetsAnimationControlImpl(controls, frame, mState, listener, typesReady, this, durationMs, interpolator, fade, layoutInsetsDuringAnimation, animationType); mRunningAnimations.add(new RunningAnimation(controller, animationType)); if (cancellationSignal != null) { cancellationSignal.setOnCancelListener(controller::onCancelled); return cancellationSignal; } } /** Loading Loading @@ -883,7 +884,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation // Show/hide animations always need to be relative to the display frame, in order that shown // and hidden state insets are correct. controlAnimationUnchecked( types, listener, mState.getDisplayFrame(), fromIme, listener.getDurationMs(), types, new CancellationSignal(), listener, mState.getDisplayFrame(), fromIme, listener.getDurationMs(), INTERPOLATOR, true /* fade */, show ? ANIMATION_TYPE_SHOW : ANIMATION_TYPE_HIDE, show ? LAYOUT_INSETS_DURING_ANIMATION_SHOWN : LAYOUT_INSETS_DURING_ANIMATION_HIDDEN); Loading
core/java/android/view/PendingInsetsController.java +15 −15 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.CancellationSignal; import android.view.WindowInsets.Type.InsetsType; import android.view.animation.Interpolator; Loading Loading @@ -59,21 +61,6 @@ public class PendingInsetsController implements WindowInsetsController { } } @Override public CancellationSignal controlWindowInsetsAnimation(int types, long durationMillis, Interpolator interpolator, WindowInsetsAnimationControlListener listener) { if (mReplayedInsetsController != null) { return mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis, interpolator, listener); } else { listener.onCancelled(); CancellationSignal cancellationSignal = new CancellationSignal(); cancellationSignal.cancel(); return cancellationSignal; } } @Override public void setSystemBarsAppearance(int appearance, int mask) { if (mReplayedInsetsController != null) { Loading Loading @@ -176,6 +163,19 @@ public class PendingInsetsController implements WindowInsetsController { mReplayedInsetsController = null; } @Override public void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener) { if (mReplayedInsetsController != null) { mReplayedInsetsController.controlWindowInsetsAnimation(types, durationMillis, interpolator, cancellationSignal, listener); } else { listener.onCancelled(); } } private interface PendingRequest { void replay(InsetsController controller); } Loading
core/java/android/view/WindowInsetsAnimationControlListener.java +0 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.view; import android.annotation.Hide; import android.annotation.NonNull; import android.view.WindowInsets.Type.InsetsType; import android.view.inputmethod.EditorInfo; Loading
core/java/android/view/WindowInsetsController.java +5 −4 Original line number Diff line number Diff line Loading @@ -156,16 +156,17 @@ public interface WindowInsetsController { * calculate {@link WindowInsetsAnimation#getInterpolatedFraction()}. * @param listener The {@link WindowInsetsAnimationControlListener} that gets called when the * windows are ready to be controlled, among other callbacks. * @return A cancellation signal that the caller can use to cancel the request to obtain * control, or once they have control, to cancel the control. * @param cancellationSignal A cancellation signal that the caller can use to cancel the * request to obtain control, or once they have control, to cancel the * control. * @see WindowInsetsAnimation#getFraction() * @see WindowInsetsAnimation#getInterpolatedFraction() * @see WindowInsetsAnimation#getInterpolator() * @see WindowInsetsAnimation#getDurationMillis() */ @NonNull CancellationSignal controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, void controlWindowInsetsAnimation(@InsetsType int types, long durationMillis, @Nullable Interpolator interpolator, @Nullable CancellationSignal cancellationSignal, @NonNull WindowInsetsAnimationControlListener listener); /** Loading