am 556477d9: am b4656ada: am 2a0fc5c1: am 5930ab4a: am ab809dd7: Fix AppBarLayout scrolling when scrolling view is small

* commit '556477d9b5e0fe97a5e7e1827ce87cc4f7ab33d5':
  Fix AppBarLayout scrolling when scrolling view is small

GitOrigin-RevId=defee6f0a4b07431766233d9d43ec50a7936164c

PiperOrigin-RevId: 140549436
This commit is contained in:
Chris Banes 2016-11-30 01:25:40 +00:00 committed by Travis Collins
parent af5765e0b3
commit 4400a2a908

View File

@ -656,13 +656,13 @@ public class AppBarLayout extends LinearLayout {
}
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child,
public boolean onStartNestedScroll(CoordinatorLayout parent, AppBarLayout child,
View directTargetChild, View target, int nestedScrollAxes) {
// Return true if we're nested scrolling vertically, and we have scrollable children
// and the scrolling view is big enough to scroll
final boolean started = (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0
&& child.hasScrollableChildren()
&& coordinatorLayout.getHeight() - target.getHeight() <= child.getHeight();
&& parent.getHeight() - directTargetChild.getHeight() <= child.getHeight();
if (started && mAnimator != null) {
// Cancel any offset animation