I am using CollapsingToolBarLayout
alongside with AppBarLayout
and CoordinatorLayout
, and they are working Fine altogether. I set my <
This code is working perfect for me. You can use percentage scale How you like
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
double percentage = (double) Math.abs(verticalOffset) / collapsingToolbar.getHeight();
if (percentage > 0.8) {
collapsingToolbar.setTitle("Collapsed");
} else {
collapsingToolbar.setTitle("Expanded");
}
}