diff options
| author | Adam Powell <adamp@google.com> | 2014-05-01 10:23:33 -0700 |
|---|---|---|
| committer | Adam Powell <adamp@google.com> | 2014-05-01 12:45:52 -0700 |
| commit | b36e4f944fe28ce68182f9ec91e5341866b49084 (patch) | |
| tree | 86bc9f18445924099235cba6d5f25b6f62f9d755 /core/java/android/view/ViewParent.java | |
| parent | b6ea9db449cef8455c239c81f9f89190b28f0f85 (diff) | |
Add support for hiding action bars on scroll.
Also tweak the nested scrolling API around nested flings and fix a bug
where recursive nested scrolling would stop prematurely.
Change-Id: I561226db878b2493970440a6af3e2332c56a1913
Diffstat (limited to 'core/java/android/view/ViewParent.java')
| -rw-r--r-- | core/java/android/view/ViewParent.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java index 3cd6449e4abc..588b9cd7ce8f 100644 --- a/core/java/android/view/ViewParent.java +++ b/core/java/android/view/ViewParent.java @@ -512,14 +512,21 @@ public interface ViewParent { /** * Request a fling from a nested scroll. * + * <p>This method signifies that a nested scrolling child has detected suitable conditions + * for a fling. Generally this means that a touch scroll has ended with a + * {@link VelocityTracker velocity} in the direction of scrolling that meets or exceeds + * the {@link ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity} + * along a scrollable axis.</p> + * * <p>If a nested scrolling child view would normally fling but it is at the edge of - * its own content, it can delegate the fling to its nested scrolling parent instead. - * This method allows the parent to optionally consume the fling.</p> + * its own content, it can use this method to delegate the fling to its nested scrolling + * parent instead. The parent may optionally consume the fling or observe a child fling.</p> * * @param target View that initiated the nested scroll * @param velocityX Horizontal velocity in pixels per second. * @param velocityY Vertical velocity in pixels per second - * @return true if this parent consumed the fling + * @param consumed true if the child consumed the fling, false otherwise + * @return true if this parent consumed or otherwise reacted to the fling */ - public boolean onNestedFling(View target, float velocityX, float velocityY); + public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed); } |
