diff options
author | Yorke Lee <yorkelee@google.com> | 2014-06-10 17:12:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-10 17:12:08 +0000 |
commit | 10fe6cbaf1ec65dd8c94d55e6a2f68d0d7679e07 (patch) | |
tree | 6f683e51f1c598e6c94904b4e608f1b08335cc2c | |
parent | 88c9e1765f6d8ae6199acf73f8315f21c701bf5b (diff) | |
parent | 40ed60dab29e90e28f95a0d8a9c612fed7a253ce (diff) |
Merge "Fix for scrolling flicker in OverlappingPaneLayout" into lmp-preview-dev
-rw-r--r-- | src/com/android/dialer/widget/OverlappingPaneLayout.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/com/android/dialer/widget/OverlappingPaneLayout.java b/src/com/android/dialer/widget/OverlappingPaneLayout.java index e28bcc578..b513cd207 100644 --- a/src/com/android/dialer/widget/OverlappingPaneLayout.java +++ b/src/com/android/dialer/widget/OverlappingPaneLayout.java @@ -116,10 +116,18 @@ public class OverlappingPaneLayout extends ViewGroup { /** * Indicates that the layout is currently in the process of a nested pre-scroll operation where - * the child is being dragged downwards. If so, we should open the pane up to the maximum - * offset defined in {@link #mIntermediateOffset}, and no further. + * the child scrolling view is being dragged downwards, and still has the ability to consume + * scroll events itself. If so, we should open the pane up to the maximum offset defined in + * {@link #mIntermediateOffset}, and no further, so that the child view can continue performing + * its own scroll. */ - boolean mInNestedPreScrollDownwards = false; + private boolean mInNestedPreScrollDownwards = false; + + /** + * Indicates whether or not a nested scrolling child is able to scroll internally at this point + * in time. + */ + private boolean mChildCannotConsumeScroll; /** * Stores an offset used to represent a point somewhere in between the panel's fully closed @@ -889,6 +897,7 @@ public class OverlappingPaneLayout extends ViewGroup { final boolean startNestedScroll = (nestedScrollAxes & SCROLL_AXIS_VERTICAL) != 0; if (startNestedScroll) { mIsInNestedScroll = true; + mChildCannotConsumeScroll = true; mDragHelper.startNestedScroll(mSlideableView); } if (DEBUG) { @@ -906,7 +915,8 @@ public class OverlappingPaneLayout extends ViewGroup { if (DEBUG) { Log.d(TAG, "onNestedPreScroll: " + dy); } - mInNestedPreScrollDownwards = (dy > 0 && mSlideOffsetPx <= mIntermediateOffset); + mInNestedPreScrollDownwards = + mChildCannotConsumeScroll && dy > 0 && mSlideOffsetPx <= mIntermediateOffset; mDragHelper.processNestedScroll(mSlideableView, 0, dy, consumed); } @@ -916,6 +926,7 @@ public class OverlappingPaneLayout extends ViewGroup { if (DEBUG) { Log.d(TAG, "onNestedScroll: " + dyUnconsumed); } + mChildCannotConsumeScroll = false; mInNestedPreScrollDownwards = false; // We need to flip dyUnconsumed here, because its magnitude is reversed. b/14585990 mDragHelper.processNestedScroll(mSlideableView, 0, -dyUnconsumed, null); |