To change toolbar icons color on scroll, I used ToolbarColorizeHelper .[https://gist.github.com/chomi3/7e088760ef7bca10430e][1]
i added the addOnOffsetChangedListener to collapsing toolbar to observe the toolbar scroll offset. Below is the code I used to achieve the expected UI attached in the above question.
addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
//Check if the view is collapsed
if (scrollOffset <= toolbar.getHeight()) {
ToolBarColourizer.colorizeToolbar(toolbar, Color.BLACK);
} else {
ToolBarColourizer.colorizeToolbar(toolbar, Color.WHITE);
}
}
});