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

Reduce recompositions due to TopAppBar #1542

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Jun 9, 2024

When you swipe up and down the top app bar moves. This updates the padding value. All composable which take this as param constantly recompose because the padding constantly changes as the header takes up more/less space. We can avoid that by applying it before the main composables. I had already done this for the feed. But we can do this easily already for the other screens.

@MV-GH MV-GH requested a review from dessalines as a code owner June 9, 2024 00:47
Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully some of the newer jetpack compose tutorials should really tell you about that: to not pass in padding values as it will cause a ton of these recompositions.

@dessalines dessalines enabled auto-merge (squash) June 13, 2024 15:35
@dessalines dessalines merged commit 6b74822 into LemmyNet:main Jun 13, 2024
1 check passed
@MV-GH MV-GH deleted the perf/reduce-recomp branch June 13, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants