Created
October 1, 2016 09:27
-
-
Save vincent-paing/e257cfedef2d1a28f13db2d3e62b1663 to your computer and use it in GitHub Desktop.
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
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { | |
boolean isShow = false; | |
int scrollRange = -1; | |
@Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { | |
if (scrollRange == -1) { | |
scrollRange = appBarLayout.getTotalScrollRange(); | |
} | |
if (scrollRange + verticalOffset == 0) { | |
getSupportActionBar().setTitle(series.title_english); | |
isShow = true; | |
} else if (isShow) { | |
getSupportActionBar().setTitle(""); | |
isShow = false; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment