File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
app/src/main/java/com/wstxda/switchai/ui/adapter Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,10 @@ import androidx.recyclerview.widget.DiffUtil
55class AssistantSelectorDiffCallback : DiffUtil .ItemCallback <AssistantSelectorRecyclerView >() {
66 override fun areItemsTheSame (
77 oldItem : AssistantSelectorRecyclerView , newItem : AssistantSelectorRecyclerView
8- ): Boolean = when {
9- oldItem is AssistantSelectorRecyclerView .AssistantSelector && newItem is AssistantSelectorRecyclerView .AssistantSelector -> oldItem.assistantItem.key == newItem.assistantItem.key
10-
11- oldItem is AssistantSelectorRecyclerView .CategoryHeader && newItem is AssistantSelectorRecyclerView .CategoryHeader -> oldItem.title == newItem.title
12-
13- oldItem is AssistantSelectorRecyclerView .ReorderTip && newItem is AssistantSelectorRecyclerView .ReorderTip -> true
14-
8+ ): Boolean = when (oldItem) {
9+ is AssistantSelectorRecyclerView .AssistantSelector if newItem is AssistantSelectorRecyclerView .AssistantSelector -> oldItem.assistantItem.key == newItem.assistantItem.key
10+ is AssistantSelectorRecyclerView .CategoryHeader if newItem is AssistantSelectorRecyclerView .CategoryHeader -> oldItem.title == newItem.title
11+ is AssistantSelectorRecyclerView .ReorderTip if newItem is AssistantSelectorRecyclerView .ReorderTip -> true
1512 else -> false
1613 }
1714
You can’t perform that action at this time.
0 commit comments