Skip to content

Commit 1c00bdb

Browse files
committed
Updated adapter to utlize the notifyItemChanged instead ofusing notifyDataSetChanged
1 parent 20b679b commit 1c00bdb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

WordPress/src/main/java/org/wordpress/android/ui/domainregister/suggestionslist/DomainSuggestionsAdapter.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ class DomainSuggestionsAdapter(
2323
}
2424

2525
private fun onDomainSuggestionSelected(suggestion: DomainSuggestionResponse?, position: Int) {
26+
val previousSelectedPosition = selectedPosition
2627
selectedPosition = position
27-
notifyDataSetChanged()
28+
notifyItemChanged(previousSelectedPosition)
29+
if (previousSelectedPosition != selectedPosition) {
30+
notifyItemChanged(selectedPosition)
31+
}
2832
itemSelectionListener(suggestion, position)
2933
}
3034

0 commit comments

Comments
 (0)