diff --git a/app/src/main/java/com/amaze/filemanager/ui/views/appbar/SearchView.java b/app/src/main/java/com/amaze/filemanager/ui/views/appbar/SearchView.java index 488df27a5c..898eff2359 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/views/appbar/SearchView.java +++ b/app/src/main/java/com/amaze/filemanager/ui/views/appbar/SearchView.java @@ -49,7 +49,6 @@ import android.animation.Animator; import android.animation.ObjectAnimator; -import android.annotation.SuppressLint; import android.content.Context; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; @@ -132,7 +131,6 @@ public class SearchView { private SortType sortType = defaultSortType; @SuppressWarnings("ConstantConditions") - @SuppressLint("NotifyDataSetChanged") public SearchView(final AppBar appbar, MainActivity mainActivity) { this.mainActivity = mainActivity; @@ -378,7 +376,6 @@ private void updateResultList(List newResults, String searchTerm) Collections.sort( items, new SearchResultListSorter(DirSortBy.NONE_ON_TOP, sortType, searchTerm)); searchRecyclerViewAdapter.submitList(items); - searchRecyclerViewAdapter.notifyDataSetChanged(); } else { Toast.makeText(mainActivity, "No search result found", Toast.LENGTH_SHORT).show(); } @@ -614,10 +611,8 @@ private void initSearchViewColor(MainActivity a) { } } - @SuppressLint("NotifyDataSetChanged") private void clearRecyclerView() { - searchRecyclerViewAdapter.submitList(new ArrayList<>()); - searchRecyclerViewAdapter.notifyDataSetChanged(); + searchRecyclerViewAdapter.submitList(Collections.emptyList()); deepSearchTV.setVisibility(View.GONE);