Questions tagged [android-diffutils]

Questions related to Android DiffUtil utility class for calculating difference between two lists

180 questions
0
votes
0 answers

Update Dynamic Data in RecyclerView With DiffUtil

I'm Selecting Files From Device Which I Want To Upload On Firebase Storage. After Selecting Files I'm Showing The List Of Files in RecyclerView. I'm Using 3 List To Contain My Three Different Data FileName, Progress (To Show Progressbar of How Much…
0
votes
1 answer

DiffUtil not refreshing view in Observer call android kotlin

Hey I am using diff util with ListAdapter. The updating of list works but I can only see those new values by scrolling the list, I need to view the updates even without recycling the view (when scrolling) just like notifyItemChanged(). I tried…
0
votes
1 answer

How to proper way of using Diff utils when updating view in adapter kotlin

Hey I am new in DiffUtil in adpater. I read some articles from stack overflow, google docs and some articles. I am trying to understand callback of DiffUtil areItemsTheSame and areContentsTheSame but, I am not clear what that means. I am adding some…
0
votes
2 answers

How to properly use DiffUtils in Recycler view to update array list?

I am implementing diffutils for recyclerview to notify list. While Search filter the recyclerview diffutils works. But when I click the list item app crash with java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at the same time when i use…
0
votes
1 answer

what is the best way to update a list with diffUtils

i want to update a list item with diffUtils but after i set list with diffDiffUtils like this: val coinsDiffUtil = DataDiffUtilCallBack(itemList, newData) val diffUtilResult = DiffUtil.calculateDiff(coinsDiffUtil) itemList =…
0
votes
1 answer

How to avoid duplicate items in PagingAdapter?

I have implemented paging3 for my android project. To avoid duplicated items, I created a DiffUtil.ItemCallback object as follow; companion object { val diffCallback = object : DiffUtil.ItemCallback() { override fun…
Hakan Erbaş
  • 139
  • 1
  • 10
0
votes
0 answers

List gets updated on other list update in Kotlin

I have a recyclerview adapter that I update from my activity but the issue is whenever the live data object gets updated and I update the adapter the object I have in the adapter also gets the same data even I didn't assign updated value to it, this…
0
votes
0 answers

Android Recylerview doesn't render an item when it is moved to the end of the recyclerview whilst the end is onscreen

In my app I display a list of outfits in a 2 column GridLayout RecyclerView, and allow users to swipe an outfit to the side. Upon swiping, I update the viewIndex of the outfit in the database (an integer which it uses for sorting the result of the…
0
votes
1 answer

RecyclerView only displaying data after restarting Activity

So i have this strange behaviour where my RecyclerView only Displays data when i start the App and then restart the activity via Android Studio. Or make a change in XML, then undo it and restart. The then displayed data is correct and also updates…
0
votes
1 answer

Clearing a RecyclerView when User makes a second request (using diffUtils and livedata)

I have made an app that uses an API to make a request and then shows the results in a RecyclerView. I was following a tutorial and in it they used a differCallback and a liveData so the lists updates and such. However whenever the user makes a…
Esteban
  • 69
  • 1
  • 11
0
votes
1 answer

DiffUtil.ItemCallback - define as a companion object or as a class?

I'm currently learning Kotlin through the Kotlin Android Developer program from Udacity. There's two sample apps using DiffUtil.ItemCallback, but declare it in different ways. Both sample apps use a ListAdapter, however one declares the DiffUtil…
0
votes
1 answer

How to change the data of an item at once using DiffUtil?

When I press the toggle button, I want to change the units of the list of the currently displayed recycler views at once. I used ListAdapter + DiffUtil to display the recycler view. The way I tried to implement this feature is to load the current…
0
votes
1 answer

Problem of automatic change of data value when scrolling in RecyclerView

I have attached a picture to help you understand my problem. I'm making an Workout app. When the button is pressed, the routine is added In the added routine, it can use the button again to add detailed data (set, lbs, reps). So, I am using a two…
ybybyb
  • 1,385
  • 1
  • 12
  • 33
0
votes
1 answer

Android Recycleview DiffUtil doesn't work properly

I am using recycle view with diffutil in my application. but while I rotating or comeback from another screen the adapter gets updated. why is this happening?. Here My ViewModel class FeedsViewModel() : ViewModel() { private val feedsRepository…
0
votes
2 answers

Update RecyclerView with DiffUtil and AsyncListDiffer not Working

I'm creating a RecyclerView in Fragmentusing DiffUtil and AsyncListDiffer because I don't want to use notifyDataSetChanged() method. But I'm facing a problem while using this approach. I'm trying to retrieve items from the database, but every time…