Package eltos.simpledialogfragment.list
Class AdvancedAdapter.AdvancedFilter
java.lang.Object
android.widget.Filter
eltos.simpledialogfragment.list.AdvancedAdapter.AdvancedFilter
- Enclosing class:
- AdvancedAdapter<T>
public abstract class AdvancedAdapter.AdvancedFilter
extends android.widget.Filter
An advanced filter where only the
matches(T, java.lang.CharSequence)
method needs
to be overwritten-
Nested Class Summary
Nested classes/interfaces inherited from class android.widget.Filter
android.widget.Filter.FilterListener, android.widget.Filter.FilterResults
-
Constructor Summary
ConstructorDescriptionAdvancedFilter
(boolean ignoreCase, boolean matchWordBeginning) The flags specified here are used in the defaultmatches(T, java.lang.CharSequence)
andAdvancedAdapter.highlight(java.lang.String, android.content.Context)
methods. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected boolean
protected boolean
Simple string matcher that uses the current constraint and flags as specified upon creation.protected abstract boolean
matches
(T object, CharSequence constraint) protected boolean
matchesWord
(String string, CharSequence constraint) Deprecated.protected android.widget.Filter.FilterResults
performFiltering
(CharSequence constraint) protected void
publishResults
(CharSequence constraint, android.widget.Filter.FilterResults results) Methods inherited from class android.widget.Filter
convertResultToString, filter, filter
-
Constructor Details
-
AdvancedFilter
public AdvancedFilter() -
AdvancedFilter
public AdvancedFilter(boolean ignoreCase, boolean matchWordBeginning) The flags specified here are used in the defaultmatches(T, java.lang.CharSequence)
andAdvancedAdapter.highlight(java.lang.String, android.content.Context)
methods.- Parameters:
ignoreCase
- whether default matching is not case-sensitivematchWordBeginning
- whether default matching is performed only at the beginning of words
-
-
Method Details
-
isIgnoreCase
protected boolean isIgnoreCase() -
isMatchWordBeginning
protected boolean isMatchWordBeginning() -
matches
-
matchesWord
Deprecated.Usematches(String)
instead- Parameters:
string
- string to search inconstraint
- string to search for- Returns:
- true if string contains the constraint, false otherwise
-
matches
Simple string matcher that uses the current constraint and flags as specified upon creation.- Parameters:
string
- the string to search in- Returns:
- true if at least one match is found
-
performFiltering
@Nullable protected android.widget.Filter.FilterResults performFiltering(@Nullable CharSequence constraint) - Specified by:
performFiltering
in classandroid.widget.Filter
-
publishResults
protected void publishResults(CharSequence constraint, @Nullable android.widget.Filter.FilterResults results) - Specified by:
publishResults
in classandroid.widget.Filter
-