-
Notifications
You must be signed in to change notification settings - Fork 271
Step 3 - Add separators every 10k stars #48
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
Conversation
6e2e501 to
cb7e88c
Compare
cb7e88c to
9f4b68a
Compare
app/src/main/java/com/example/android/codelabs/paging/ui/ReposAdapter.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/example/android/codelabs/paging/ui/ReposAdapter.kt
Outdated
Show resolved
Hide resolved
| override fun areItemsTheSame(oldItem: Repo, newItem: Repo): Boolean { | ||
| return if (oldItem is Repo && newItem is Repo) { | ||
| oldItem == newItem | ||
| private val UIMODEL_COMPARATOR = object : DiffUtil.ItemCallback<UiModel>() { |
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.
The code as written will cause all separators to shimmer, it should be checking for separators too
Should be fine to say all separators are the same, since DiffUtil will be doing greedy matching
I don't think any of this matters in behavior here, since without swipe to refresh, you're not actually going to see any diffing 🤷♂️ but still good to recommend correct code in case they do
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.
added separator as well
app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt
Outdated
Show resolved
Hide resolved
4bedb47 to
e018324
Compare
7ad2afc to
13e22e5
Compare
dd95eec to
93a42bf
Compare
* Simplifying insertSeparators * Simplifying ReposAdapter
312c28c to
fd66251
Compare
Fix for separator logic
No description provided.