diff --git a/app/src/main/java/com/example/sprout/refactor/adapter/DiffCallback.java b/app/src/main/java/com/example/sprout/refactor/adapter/DiffCallback.java deleted file mode 100644 index aa637c3..0000000 --- a/app/src/main/java/com/example/sprout/refactor/adapter/DiffCallback.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.example.sprout.refactor.adapter; - -import android.support.v7.util.DiffUtil; - -import java.util.List; - -/** - * DiffUtilのCallbackの基底クラス - * - * @param 差分を出すクラス - * @author matsumoto_k - */ -public abstract class DiffCallback extends DiffUtil.Callback { - final protected List oldList; - final protected List newList; - - public DiffCallback(List oldList, List newList) { - this.oldList = oldList; - this.newList = newList; - } - - @Override - public int getOldListSize() { - return oldList.size(); - } - - @Override - public int getNewListSize() { - return newList.size(); - } - - @Override - public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) { - return oldList.get(oldItemPosition) == newList.get(newItemPosition); - } - - public abstract Object getChangePayload(int oldItemPosition, int newItemPosition); -}