mtcn/MotionLayoutExamples

Collapsing Toolbar with cover image

Opened this issue · 4 comments

When image is collapsed the theme of status bar did not change . How to change the status bar theme when toolbar is collapsed .

mtcn commented

I couldn't see any problem with the current example. It would be good if you can provide video and more information about the issue.

BDF4C3FF-8D82-4CC3-A8E3-736A8D882797
7B28F50C-4DF7-4681-9CA0-664E8EB95CF7

The theme of status bar before transition and after transition is changed how to do that programmatically or in layout file please explain that sir .

mtcn commented

In this example, I don't change the status bar color because it's a translucent theme. Layouts stay behind the status bar.
You can check this source or you can do it like in the example ( setTheme() - DemoActivity.kt:58 )
https://medium.com/androiddevelopers/translucent-systembars-the-right-way-across-api-levels-and-themes-6d7ddda21396

I'm only changing status bar icon colors in onTransitionChange callback ( DemoActivity.kt:75 )

// for light icons
window?.decorView?.systemUiVisibility = 0
// for dark icons
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

Note: Status bar icon changes only works for API 23 and above

Ok sir , but this is also my personal problem can you help me to find out that how to change the theme of statusbar to light in this example or i have also seen that in collapsing toolbars when toolbar or image is collapsed the theme of status bar changes , can you tell me please how to do that . Thanku!