compose-collapsing-toolbar
compose-collapsing-toolbar copied to clipboard
Slight lags using ExitUntilCollapsed ScrollStrategy
Hello! I just launched your app and noticed that there are lags. It's impossible to collapse the toolbar completely by making one scroll with your finger. Toolbar animation will stop somewhere in the middle (depends on your scroll velocity). You need to repeat one more scroll with your finger and toolbar will be collapsed. Only after these actions you are able to scroll the main content.
So, from this moment you can collapse the toolbar by making one scroll with your finger and the main content will be scrolled as well.
Do you have any idea, how to avoid scrolling lags on the first screen launch?
https://user-images.githubusercontent.com/47034849/135983423-02e4427a-ccaf-4777-8209-80a010009408.mp4
That seems to be related to flinging behavior, what version of the library are you using?
Thanks for replying @onebone I'm using v2.1.2
The flinging issue was fixed at 2.2.0. Can you try the latest version and tell me if your issue persists?
The issue is still present in version 2.2.0 @onebone
Can you check if this is the case?
https://issuetracker.google.com/issues/197553056
This issue https://issuetracker.google.com/issues/197553056 is not reproduced to me. @onebone
Sorry for the delay.
Unfortunately, I cannot reproduce your issue. May I ask you to double-check that the issue tracker one is not the case? If you are scrolling faster than the device can consume (i.e. short interval between touch down and up), Compose may not dispatch fling.
Below is the sample app running on my environment (normally):
https://user-images.githubusercontent.com/3233503/139284951-d37c850a-6112-47f4-987e-2e01fc692778.mp4
@voprokudin Does this issue bother you until now?
@onebone Sorry for the delay. The Issue is still reproduces to me. After careful research, I've noticed, that attached code block causes slight lags. So, calculation of progress causes problems. If you want your fontSize to be based on toolbar progress, you will get this lags. Static fontSize works perfect.
fontSize based on toolbar progress:
val textSize = (18 + (30 - 18) * state.toolbarState.progress).sp
Text(
text = "Title",
modifier = Modifier.road(Alignment.CenterStart, Alignment.BottomEnd).padding(60.dp, 16.dp, 16.dp, 16.dp),
color = Color.White,
fontSize = textSize
)
Note: you should use cold app start, because this issue reproduces only for the first time.

Can you give me some information about your environment?
I'm using Android Studio Arctic Fox | 2020.3.1 Patch 2
Test devices with lags: Samsung A51, Android version 10 Xiaomi Redmi Note 5, Android version 9
Devices that don't lag: Xiaomi mi note 10 lite, Android version 11
Thank you, I will test in an environment similar to yours
Thank you, I will test in an environment similar to yours
Same issue with Redmi Note 4, Android 11
For me also same the issue on Pixel 5, Android 12
Hey, I noticed that this lag seems to appear only when using lazy column, using regular column with scroll is smooth
Hi, I'm moving my app (https://github.com/nanihadesuka/NovelDokusha) to compose using this great lib. I'm also having performance issues when using a LazyColumn for the body. In my case it happens for any type of collapsible strategy. The fling also seems to be spotty and work sometimes, some other times not. Using version 3.3.0