Closed ArcherEmiya05 closed 2 years ago
Maybe the functionality was stripped by ProGuard which usually happens when using third library UI?
Will it work if you remove app:contentScrim="?attr/colorPrimary"
from your view attributes?
Will it work if you remove
app:contentScrim="?attr/colorPrimary"
from your view attributes?
I checked it now but nothing change except that the Toolbar background color when collapsed became plain dark in night mode and didn't follow the set color.
@ArcherEmiya05 the behavior you're seeing is actually consistent with the new M3 spec, which involves collapsing to show a toolbar color fill at the top.
This new effect is achieved in the M3 Top App Bar styles mainly via AppBarLayout app:liftOnScroll="true" and CollapsingToolbarLayout app:titleCollapseMode="fade".
So to get more of an M2 collapsing toolbar I would probably try setting app:liftOnScroll="false"
on your AppBarLayout and titleCollapseMode="scale"
on your CollapsingToolbarLayout.
Here is the full list of M3 AppBarLayout/CollapsingToolbarLayout default attributes. Feel free to reopen if this doesn't help.
@ArcherEmiya05 the behavior you're seeing is actually consistent with the new M3 spec, which involves collapsing to show a toolbar color fill at the top.
This new effect is achieved in the M3 Top App Bar styles mainly via AppBarLayout app:liftOnScroll="true" and CollapsingToolbarLayout app:titleCollapseMode="fade".
So to get more of an M2 collapsing toolbar I would probably try setting
app:liftOnScroll="false"
on your AppBarLayout andtitleCollapseMode="scale"
on your CollapsingToolbarLayout.Here is the full list of M3 AppBarLayout/CollapsingToolbarLayout default attributes. Feel free to reopen if this doesn't help.
Thanks a lot, modifying scrimAnimationDuration
also helps
Description: CollapsingToolbarLayout collapse transition is not working properly in Material 3, tested on multiple device. Notice how the Toolbar color went solid immediately instead of having some fade effect like the first example.
Expected behavior:
Expected
Actual
https://user-images.githubusercontent.com/38008900/168493911-f4a1f8fa-b851-4eaf-8757-0bbfd5b64d07.mp4
Source code:
Activity
Theme
Style
Android API version: SDK 21 and above
Material Library version: 1.7.0-alpha01