Created
November 23, 2018 13:11
-
-
Save ValCanBuild/076b958da95d4e8943836ff9772f4ca3 to your computer and use it in GitHub Desktop.
AppBarLayout onStopNestedScroll method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onStopNestedScroll( | |
CoordinatorLayout coordinatorLayout, T abl, View target, int type) { | |
// onStartNestedScroll for a fling will happen before onStopNestedScroll for the scroll. This | |
// isn't necessarily guaranteed yet, but it should be in the future. We use this to our | |
// advantage to check if a fling (ViewCompat.TYPE_NON_TOUCH) will start after the touch scroll | |
// (ViewCompat.TYPE_TOUCH) ends | |
if (lastStartedType == ViewCompat.TYPE_TOUCH || type == ViewCompat.TYPE_NON_TOUCH) { | |
// If we haven't been flung, or a fling is ending | |
snapToChildIfNeeded(coordinatorLayout, abl); | |
// ... | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment