-
Notifications
You must be signed in to change notification settings - Fork 170
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
Add contenttypes to lazy columns #984
Conversation
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.
According to the docs, this is just supposed to refer to the type of item, for lists which have different types. So it just needs to be "comment", "post", etc.
app/src/main/java/com/jerboa/ui/components/community/list/CommunityList.kt
Outdated
Show resolved
Hide resolved
@@ -233,7 +233,7 @@ fun LazyListScope.commentNodeItem( | |||
.commentView.counts.child_count > 0 && !isFlat | |||
|
|||
increaseLazyListIndexTracker() | |||
item(key = commentId) { | |||
item(key = commentId, contentType = { "contentNodeItemL${node.depth}" }) { |
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.
Eh it's just this one that worries me, I ll leave this one out for now and when I get some more time I ll try to get a microbench for this, bc the macrobench currently is not showing any significant perf changes. Same was for the scrolling with baselines/without but from personal expercience the baselines make a bigger impact than they are showing from the tests. So they aren't very reliable imo.
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.
Gotcha. Yep I'm guessing these aren't going to really matter until we have combined lists, like putting all the notification types (messages, comment replies, and mentions), in a single LazyList.
# Conflicts: # app/src/main/java/com/jerboa/ui/components/common/Dialogs.kt # app/src/main/java/com/jerboa/ui/components/home/Home.kt # app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt # benchmarks/src/main/java/com/jerboa/actions/JerboaActions.kt
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.
Seems good, not sure why build is failing, I'll try a restart.
https://developer.android.com/jetpack/compose/lists#content-type
Adds content types to the lazy columns. From my limited testing, I did not notice any significant performance changes.