val behavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
val maxLines = if (behavior.state.collapsedFraction > .7f) 1 else 2
The start and end results are like I want them to be, but because the two texts are at some point visible at the same time during the transition, it does look a little wonky. If anyone knows anything better, then I'd love to hear it.
Dunno why LargeTopAppBar does that, never used it myself. I have done something similar in my own "CollapsingAppBar" layout.
Based on collapsedFraction, I lerp title's y coord (placeable) and also its text size & maxLines. Given that's it's your own layout, you have full control over what you want to do with it.
Could point you to the code if you'd like to see it, but it's fairly straightforward.
s
sindrenm
01/04/2024, 8:13 AM
Yeah, it's a little strange. If you have the source somewhere, that would be interesting to see.