diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2019-01-10 23:49:02 +0100 |
|---|---|---|
| committer | Jorim Jaggi <jjaggi@google.com> | 2019-01-11 18:19:16 +0100 |
| commit | 98c756513db6d1aa5c36eff4768a31e974f3d8dd (patch) | |
| tree | c1d32751fe471228698d62f7ca65af9eab05c311 /core/java/android/view/WindowInsetsAnimationController.java | |
| parent | 02a741f7a9de104979a81f0e84bfc9bd80f1dafa (diff) | |
Expand docs for animation listener
Test: builds
Bug: 118118435
Change-Id: I88f7f7e5943e1165868052db03423121fa548152
Diffstat (limited to 'core/java/android/view/WindowInsetsAnimationController.java')
| -rw-r--r-- | core/java/android/view/WindowInsetsAnimationController.java | 21 |
1 files changed, 19 insertions, 2 deletions
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. + * <p> + * 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 { * <p> * 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. + * <p> + * 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 { * <p> * Note that this will <b>not</b> 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. * <p> * {@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); |
