diff options
author | Brian Attwell <brianattwell@google.com> | 2014-09-26 17:16:20 -0700 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-09-26 17:36:19 -0700 |
commit | 7355a4e1a7d03715451501f43ae06b1597ea597d (patch) | |
tree | 36864a731078d93589818187d1100c4f4f765ec1 /src | |
parent | 0230ec94a8e1ee7a3a75e9e00883aa6c0ceeae29 (diff) |
Don't forget header momentum upon scroll events
Fixes another easy problem with Dialer's nested scrolling.
Sometimes onStopNestedScroll causes the momentum in a header
fling not to transfer to the ListView.
Bug: 16462679
Change-Id: I9ac8af11dc4799c5a5acd68de89e988fdc479113
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/widget/OverlappingPaneLayout.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/dialer/widget/OverlappingPaneLayout.java b/src/com/android/dialer/widget/OverlappingPaneLayout.java index b81722942..ad18b1486 100644 --- a/src/com/android/dialer/widget/OverlappingPaneLayout.java +++ b/src/com/android/dialer/widget/OverlappingPaneLayout.java @@ -988,7 +988,7 @@ public class OverlappingPaneLayout extends ViewGroup { if (DEBUG) { Log.d(TAG, "onStopNestedScroll"); } - if (mIsInNestedScroll) { + if (mIsInNestedScroll && !mIsInNestedFling) { mDragHelper.stopNestedScroll(mSlideableView); mInNestedPreScrollDownwards = false; mInNestedPreScrollUpwards = false; @@ -1024,7 +1024,8 @@ public class OverlappingPaneLayout extends ViewGroup { } } - if (mDragHelper.getVelocityMagnitude() > 0 + if (state == ViewDragHelper.STATE_IDLE + && mDragHelper.getVelocityMagnitude() > 0 && (mDragHelper.getCurrentScrollY() == 0 || mDragHelper.getCurrentScrollY() == mIntermediateOffset) && mIsInNestedFling) { @@ -1099,6 +1100,7 @@ public class OverlappingPaneLayout extends ViewGroup { public void onViewReleased(View releasedChild, float xvel, float yvel) { if (DEBUG) { Log.d(TAG, "onViewReleased: " + + " mIsInNestedFling=" + mIsInNestedFling + " unscrolled=" + mPanelSlideCallbacks.isScrollableChildUnscrolled() + ", mInNestedPreScrollDownwards = " + mInNestedPreScrollDownwards + ", mInNestedPreScrollUpwards = " + mInNestedPreScrollUpwards |