From 98c756513db6d1aa5c36eff4768a31e974f3d8dd Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 10 Jan 2019 23:49:02 +0100 Subject: Expand docs for animation listener Test: builds Bug: 118118435 Change-Id: I88f7f7e5943e1165868052db03423121fa548152 --- .../view/WindowInsetsAnimationController.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'core/java/android/view/WindowInsetsAnimationController.java') diff --git a/core/java/android/view/WindowInsetsAnimationController.java b/core/java/android/view/WindowInsetsAnimationController.java index 9de517dac5de..cf4415d2b2ba 100644 --- a/core/java/android/view/WindowInsetsAnimationController.java +++ b/core/java/android/view/WindowInsetsAnimationController.java @@ -19,6 +19,7 @@ package android.view; import android.annotation.NonNull; import android.graphics.Insets; import android.view.WindowInsets.Type.InsetType; +import android.view.WindowInsetsAnimationListener.InsetsAnimation; /** * Interface to control a window inset animation frame-by-frame. @@ -28,8 +29,13 @@ public interface WindowInsetsAnimationController { /** * Retrieves the {@link Insets} when the windows this animation is controlling are fully hidden. + *

+ * If there are any animation listeners registered, this value is the same as + * {@link InsetsAnimation#getLowerBound()} that will be passed into the callbacks. * * @return Insets when the windows this animation is controlling are fully hidden. + * + * @see InsetsAnimation#getLowerBound() */ @NonNull Insets getHiddenStateInsets(); @@ -38,8 +44,13 @@ public interface WindowInsetsAnimationController { *

* In case the size of a window causing insets is changing in the middle of the animation, we * execute that height change after this animation has finished. + *

+ * If there are any animation listeners registered, this value is the same as + * {@link InsetsAnimation#getUpperBound()} that will be passed into the callbacks. * * @return Insets when the windows this animation is controlling are fully shown. + * + * @see InsetsAnimation#getUpperBound() */ @NonNull Insets getShownStateInsets(); @@ -59,8 +70,11 @@ public interface WindowInsetsAnimationController { *

* Note that this will not inform the view system of a full inset change via * {@link View#dispatchApplyWindowInsets} in order to avoid a full layout pass during the - * animation. If you'd like to animate views during a window inset animation, use - * TODO add link to animation listeners. + * animation. If you'd like to animate views during a window inset animation, register a + * {@link WindowInsetsAnimationListener} by calling + * {@link View#setWindowInsetsAnimationListener(WindowInsetsAnimationListener)} that will be + * notified about any insets change via {@link WindowInsetsAnimationListener#onProgress} during + * the animation. *

* {@link View#dispatchApplyWindowInsets} will instead be called once the animation has * finished, i.e. once {@link #finish} has been called. @@ -70,6 +84,9 @@ public interface WindowInsetsAnimationController { * the resulting insets of that configuration will match the passed in parameter. * Note that these insets are being clamped to the range from * {@link #getHiddenStateInsets} to {@link #getShownStateInsets} + * + * @see WindowInsetsAnimationListener + * @see View#setWindowInsetsAnimationListener(WindowInsetsAnimationListener) */ void changeInsets(@NonNull Insets insets); -- cgit v1.2.3