You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
739 B
30 lines
739 B
package com.m2049r.xmrwallet.layout;
|
|
|
|
import androidx.recyclerview.widget.DiffUtil;
|
|
|
|
import java.util.List;
|
|
|
|
public abstract class DiffCallback<T> extends DiffUtil.Callback {
|
|
|
|
protected final List<T> mOldList;
|
|
protected final List<T> mNewList;
|
|
|
|
public DiffCallback(List<T> oldList, List<T> newList) {
|
|
this.mOldList = oldList;
|
|
this.mNewList = newList;
|
|
}
|
|
|
|
@Override
|
|
public int getOldListSize() {
|
|
return mOldList.size();
|
|
}
|
|
|
|
@Override
|
|
public int getNewListSize() {
|
|
return mNewList.size();
|
|
}
|
|
|
|
public abstract boolean areItemsTheSame(int oldItemPosition, int newItemPosition);
|
|
|
|
public abstract boolean areContentsTheSame(int oldItemPosition, int newItemPosition);
|
|
} |