From 80c2d20c9bdf22318284d15eee216e662e6c7548 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 3 Oct 2019 22:57:28 +0200 Subject: [PATCH] Clean up comments in FolderListFilter --- .../fsck/k9/activity/FolderListFilter.java | 39 +------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/app/ui/src/main/java/com/fsck/k9/activity/FolderListFilter.java b/app/ui/src/main/java/com/fsck/k9/activity/FolderListFilter.java index 554070740..ca8c139aa 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/FolderListFilter.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/FolderListFilter.java @@ -8,47 +8,20 @@ import timber.log.Timber; import android.widget.Filter; /** - * Filter to search for occurrences of the search-expression in any place of the - * folder-name instead of doing just a prefix-search. - * - * @author Marcus@Wolschon.biz + * Filter to search for occurrences of the search-expression in any place of the folder name. */ public class FolderListFilter extends Filter { - /** - * ArrayAdapter that contains the list of folders displayed in the - * ListView. - * This object is modified by {@link #publishResults} to reflect the - * changes due to the filtering performed by {@link #performFiltering}. - * This in turn will change the folders displayed in the ListView. - */ private FilterableAdapter mFolders; - - /** - * All folders. - */ private List mOriginalValues = null; - /** - * Create a filter for a list of folders. - * - * @param folders - */ public FolderListFilter(final FilterableAdapter folders) { this.mFolders = folders; } - /** - * Do the actual search. - * {@inheritDoc} - * - * @see #publishResults(CharSequence, FilterResults) - */ @Override protected FilterResults performFiltering(CharSequence searchTerm) { FilterResults results = new FilterResults(); - // Copy the values from mFolders to mOriginalValues if this is the - // first time this method is called. if (mOriginalValues == null) { int count = mFolders.getCount(); mOriginalValues = new ArrayList<>(count); @@ -89,14 +62,9 @@ public class FolderListFilter extends Filter { return results; } - /** - * Publish the results to the user-interface. - * {@inheritDoc} - */ @SuppressWarnings("unchecked") @Override protected void publishResults(CharSequence constraint, FilterResults results) { - //noinspection unchecked final List folders = (List) results.values; mFolders.clear(); if (folders != null) { @@ -109,14 +77,9 @@ public class FolderListFilter extends Filter { Timber.w("FolderListFilter.publishResults - null search-result "); } - // Send notification that the data set changed now mFolders.notifyDataSetChanged(); } - public void invalidate() { - mOriginalValues = null; - } - public interface FilterableAdapter { void notifyDataSetChanged(); void clear();