mirror of https://github.com/tasks/tasks
Remove SubtaskDiffCallback
parent
61c7f2f0e8
commit
3a7d62f469
@ -1,19 +0,0 @@
|
|||||||
package org.tasks.tasklist;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.DiffUtil;
|
|
||||||
import org.tasks.data.TaskContainer;
|
|
||||||
|
|
||||||
class ItemCallback extends DiffUtil.ItemCallback<TaskContainer> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areItemsTheSame(@NonNull TaskContainer oldItem, @NonNull TaskContainer newItem) {
|
|
||||||
return oldItem.getId() == newItem.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areContentsTheSame(
|
|
||||||
@NonNull TaskContainer oldItem, @NonNull TaskContainer newItem) {
|
|
||||||
return oldItem.equals(newItem);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,10 @@
|
|||||||
|
package org.tasks.tasklist
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
|
import org.tasks.data.TaskContainer
|
||||||
|
|
||||||
|
internal class ItemCallback : DiffUtil.ItemCallback<TaskContainer>() {
|
||||||
|
override fun areItemsTheSame(old: TaskContainer, new: TaskContainer) = old.id == new.id
|
||||||
|
|
||||||
|
override fun areContentsTheSame(old: TaskContainer, new: TaskContainer) = old == new
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
package org.tasks.tasklist;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.DiffUtil;
|
|
||||||
import org.tasks.data.TaskContainer;
|
|
||||||
|
|
||||||
class SubtaskDiffCallback extends DiffUtil.ItemCallback<TaskContainer> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areItemsTheSame(@NonNull TaskContainer oldItem, @NonNull TaskContainer newItem) {
|
|
||||||
return oldItem.getId() == newItem.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean areContentsTheSame(
|
|
||||||
@NonNull TaskContainer oldItem, @NonNull TaskContainer newItem) {
|
|
||||||
return oldItem.equals(newItem);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue