Created
November 26, 2018 06:27
-
-
Save pennya/ff97558d597a98e2091e1976e5e00906 to your computer and use it in GitHub Desktop.
detect AppBarLayout collapsed or expanded.
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
appbar.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset -> | |
if(Math.abs(verticalOffset) - appBarLayout.totalScrollRange == 0) { | |
// collapse | |
} else { | |
// expanded | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment