From fbf5549182a6cf39210ce027b63159684f7479d4 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 14 Sep 2022 14:01:59 +0200 Subject: [PATCH] Fix wrong icons being set on suggestion items The diff util wrongly considered as equal two items with the same text but with different `fromHistory` value --- .../newpipe/fragments/list/search/SuggestionListAdapter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SuggestionListAdapter.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SuggestionListAdapter.java index f859c9e54..856ba22f1 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SuggestionListAdapter.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SuggestionListAdapter.java @@ -80,13 +80,14 @@ public class SuggestionListAdapter @Override public boolean areItemsTheSame(@NonNull final SuggestionItem oldItem, @NonNull final SuggestionItem newItem) { - return oldItem.query.equals(newItem.query); + return oldItem.fromHistory == newItem.fromHistory + && oldItem.query.equals(newItem.query); } @Override public boolean areContentsTheSame(@NonNull final SuggestionItem oldItem, @NonNull final SuggestionItem newItem) { - return oldItem.equals(newItem); + return true; // items' contents never change; the list of items themselves does } } }