mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
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:
parent
af5765e0b3
commit
4400a2a908
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user