Java Code Examples for androidx.recyclerview.widget.DiffUtil#Callback

The following examples show how to use androidx.recyclerview.widget.DiffUtil#Callback . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HomeAdapterHelper.java    From CrazyDaily with Apache License 2.0 4 votes vote down vote up
@Override
protected DiffUtil.Callback getDiffCallBack(List<MultiTypeIdEntity> oldData, List<MultiTypeIdEntity> newData) {
    return new StringDiffCallBack(oldData, newData);
}
 
Example 2
Source File: MyAdapterHelper.java    From MultiTypeRecyclerViewAdapter with Apache License 2.0 4 votes vote down vote up
@Override
protected DiffUtil.Callback getDiffCallBack(List<MutiTypeTitleEntity> oldData, List<MutiTypeTitleEntity> newData) {
    return new TitleDiffCallBack(oldData, newData);
}
 
Example 3
Source File: TagListFragment.java    From android-app with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected DiffUtil.Callback getDiffUtilCallback(List<Tag> oldItems, List<Tag> newItems) {
    return new TagListDiffCallback(oldItems, newItems);
}
 
Example 4
Source File: ArticleListFragment.java    From android-app with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected DiffUtil.Callback getDiffUtilCallback(List<Article> oldItems, List<Article> newItems) {
    return new ArticleListDiffCallback(oldItems, newItems, forceContentUpdate);
}
 
Example 5
Source File: RecyclerViewAdapterHelper.java    From MultiTypeRecyclerViewAdapter with Apache License 2.0 2 votes vote down vote up
/**
 * 返回比较的callback对象,提供新老数据
 * 默认比较id和type,id设为long是为了比较效率,你可以使用字符串的hashCode,注意冲突,甚至你可以自定义Callback
 *
 * @param oldData 老数据
 * @param newData 新数据
 * @return 返回Callback
 */
protected DiffUtil.Callback getDiffCallBack(List<T> oldData, List<T> newData) {
    return new DiffCallBack<>(oldData, newData);
}
 
Example 6
Source File: RecyclerViewListFragment.java    From android-app with GNU General Public License v3.0 votes vote down vote up
protected abstract DiffUtil.Callback getDiffUtilCallback(List<T> oldItems, List<T> newItems);