Questions related to Android DiffUtil utility class for calculating difference between two lists
Questions tagged [android-diffutils]
180 questions
0
votes
1 answer
Renaming item with DiffUtil not updating RecyclerView
For an app I am making I have a list in which I display pixel art creations, I do this with a RecyclerView and DiffUtil, here is the code:
package com.therealbluepandabear.pixapencil.adapters
import android.content.Context
import…

thebluepandabear
- 263
- 2
- 7
- 29
0
votes
1 answer
Change specific items in List when using DiffUtil
In case,
When there is a list with 100 items and wanna change only some of them, should I need to create a new list for comparison with DiffUtil?
fun fetchDynamicItems() {
val items = repository.fetchOnlyDynamicItems()
…

sssrigo
- 55
- 4
0
votes
1 answer
Kotlin Recyclerview change item color onClick
i have a Recyclerview adapter in Kotlin and when i click it change the color to Red but if i click another item, the previous item still have the Red color. How to make the logic when the item click it will change Red and when click another item it…

Jerico
- 5
- 3
0
votes
1 answer
Recyclerview move to penultimate position when the list is update
Currently i have the next config.
RecyclerView + MutableLiveData + DiffUtils
The behavior is:
When i move to the last position and update the list, the RecyclerView move automatically to penultimate item, but only happen with the last position

David Hackro
- 3,652
- 6
- 41
- 61
0
votes
1 answer
need to use DiffUtill facilities in recyclerView Kotlin
Employee class:
data class Employee(
val id: Long,
val fullName: String,
val city: String,
var isLiked: Boolean = false,
) {
companion object {
fun getMockEmployees() = listOf(
…

evgeni2306
- 3
- 2
0
votes
1 answer
DiffUtil.Callback getChangePayload oldItem is same as newItem
I have a DiffUtil.Callback that compares 2 lists of model StorageModelUi.
sealed class StorageModelUi {
class ServerItem(val server: Server): StorageModelUi()
class StorageContent(val used: Int, val large: Int, val server: Server, val…

james04
- 1,580
- 2
- 20
- 46
0
votes
1 answer
Multiple RecyclerView(two) has lag - android
I have a list that load in RecyclerView with CardView and in CardView I have a RecyclerView that have (max) 10 items, I load it now, but it has lag:
My First LessonContentListAdapter.kt:
class LessonContentListAdapter :…

jo jo
- 1,758
- 3
- 20
- 34
0
votes
1 answer
Problems with DiffUtil. It works slowly and sometimes incorrectly
I started learning DiffIUtil and met some problems. I want to write a simple android app with a seachview and a recyclerview what use DiffUtil, but the recycler sometimes shows uncorrect data despite right data coming to the recycler.
Here is my…

MihaelKrau
- 31
- 1
0
votes
1 answer
ListAdapter currentList and itemCount not returning updates after filter or submitList
I am implementing filterable list for RecyclerView using ListAdapter with AsyncDifferConfig.Builder that implements Filterable. When searching and no result match, a TextView will be shown.
adapter.filter.filter(filterConstraint)
// Searched…

Bitwise DEVS
- 2,858
- 4
- 24
- 67
0
votes
2 answers
How can DiffUtil know about list changes when only the companion object has changed?
As shown in the image, I would like the unit of the Detail item to be changed at once according to the toggle button.
Detail list items were set as companion objects because it was determined that it was not necessary to have a unit property…

ybybyb
- 1,385
- 1
- 12
- 33
0
votes
1 answer
diffutil callback in recyclerView doesn't work perfectly
I'm trying to add some search on the RecyclerView list without using
notifyDataSetChanged()
instead to it using
diffutil.callback()
but the issue is that it change the list correctly but it doesn't change the UI correctly
Here is my code and I…

Mohammad Khair
- 436
- 6
- 15
0
votes
1 answer
Diff util not updating UI - Multitype recyclerview - Model contains lists
I have a recyclerview which displays multiple viewholders containing horizontal rows, grids, vertical lists etc so my Model that I pass to the recyclerview has a few different lists contained in it.
Some of the data in the List is genereated by…

AndroidDev123
- 280
- 3
- 24
0
votes
1 answer
How to implement DiffUtil for images
Hello there I'm heard about this library DiffUtil which improves the recycler view performance and hence my recycler view contains images it is will be better for me to implement it but I don't know-how
Note: I didn't include the Fragment code so…

Vasant Raval
- 257
- 1
- 12
- 31
0
votes
2 answers
DiffUtil Not working in nested recyclerview Kotlin
I have two recycler views. My view is not updated until I used notifyDataSetChanged. I asked for a similar type of issue, but this time I have Github Link. So please have a look and explain to me what I am doing wrong. Thanks
MainActivity.kt
package…

Kotlin Learner
- 3,995
- 6
- 47
- 127
0
votes
2 answers
DiffUtil redraw all items in ListAdapter Kotlin
I am using DiffUtil with ListAdapter in Android Kotlin. I am calling the data from the server in the onResume method. When onResume called every item whole data is redrawing the view. I want to update the view if any data change on the server side,…

Kotlin Learner
- 3,995
- 6
- 47
- 127