Skip to content
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

Fix disappearance items when fast scrolling #1035

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

cuong-tran
Copy link
Contributor

@cuong-tran cuong-tran commented Jul 23, 2024

Due to update compose-bom and migration from animateItemPlacement to animateItem which by default includes fade-in/fade-out spec, while doing a fast scrolling, items look like disappeared.
=> Don't use fade-in/fade-out with FastScrollLazyColumn.

@AntsyLich
Copy link
Member

Since the same thing is being repeated make it an extension function. Can use the compose name animateItemPlacement

@FooIbar
Copy link
Contributor

FooIbar commented Jul 25, 2024

Add related bug to the workaround function's comment.
https://issuetracker.google.com/352584409

@cuong-tran
Copy link
Contributor Author

animateItemPlacement

since animateItem must be used in LazyItemScope, I don't know how to make an extension function of both LazyItemScope & Modifier at same time. Could you help with that?

@AntsyLich
Copy link
Member

Use context receivers. Example:

context(Json)
inline fun <reified T> Response.parseAs(): T {
return decodeFromJsonResponse(serializer(), this)
}

Avoid using animateItemPlacement name since it's shadowed by compose-bom's deprecated one
@AntsyLich AntsyLich merged commit 913ff22 into mihonapp:main Jul 26, 2024
1 check passed
@cuong-tran cuong-tran deleted the animate-item branch July 26, 2024 19:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants