-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a session time scrolling sticky #666
Conversation
} | ||
} | ||
var currentDurationTime: DurationTime? = null | ||
visibleItemsInfo.value.forEachIndexed { visibleItemIndex, visibleItemInfo -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your great effort!
Probably this cause performance problem.
I think it is tough. But I came up with two approaches to solve this problem.
- Use draw behind
In this way, you can skip the composition and layout phase
LazyColumn(
modifier = Modifier.fillMaxSize().drawBehind {
...
}
- Pass sessionsListListState and consume it in the function
This way, you can't skip the recompose, but you can narrow the recompose.
fun TimeLane(sessionsListListState, timetable) {
val visibleItemsInfo = remember {
derivedStateOf {
sessionsListListState.layoutInfo.visibleItemsInfo
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for my late response.
Your advice helped me for fixing the code, thank you!
I adopted the second one in my code (I tried to solve this by using drawBehind but I can't ...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Can you run ./gradlew spotlessKotlinApply? 🙏 |
|
Please run ./gradlew composeLint and fix the issues🙇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for your contribution!
Issue
Overview (Required)
Links
Screenshot
Before
session_time_scroll.webm
After
sticky_scroll.webm