public class AutoCompleteAdapter extends ListViewAdapter implements AutoCompleteAdapterBase
Constructor and Description |
---|
AutoCompleteAdapter(Context context,
List<TokenModel> items,
Integer layoutItem)
Creates an instance of AutoCompleteAdapter.
|
AutoCompleteAdapter(Context context,
List<TokenModel> items,
ListViewHolder layoutItem)
Creates an instance of AutoCompleteAdapter.
|
Modifier and Type | Method and Description |
---|---|
void |
filter(String charText)
Filtering logic used to filter only the suggestions which are appropriate for the input text.
|
Function2Async<String,List<TokenModel>,List<TokenModel>> |
getCompletionMode()
Returns current completion mode.
|
ArrayList<TokenModel> |
getFilteredList()
Returns filtered list of suggestions.
|
int |
getHighlightColor()
Returns current highlight color used to identify matching parts of the suggestions.
|
boolean |
getHighlightingEnabled()
Returns boolean identifying whether highlighting is enabled.
|
List<TokenModel> |
getInitialListOfItems()
Returns list of all items given initially to the adapter before any filtering was applied.
|
void |
onBindViewHolder(ListViewHolder holder,
int position) |
ListViewHolder |
onCreateViewHolder(ViewGroup viewGroup,
int viewType) |
void |
setCompletionMode(Function2Async<String,List<TokenModel>,List<TokenModel>> mode)
Sets current completion mode.
|
void |
setFilteredList(ArrayList<TokenModel> list) |
void |
setHighlightColor(int color)
Sets current highlight color used to identify matching parts of the suggestions.
|
void |
setHighlightingEnabled(boolean isEnabled)
Sets whether highlighting is enabled.
|
void |
setInitialListOfItems(List<TokenModel> allItems)
Sets initial list of items form which suggestions will be filtered and shown.
|
add, add, canDeselect, canReorder, canSelect, canSwipe, getItem, getItem, getItemCount, getItemId, getItemId, getItems, getPosition, getPosition, notifyLoadingFinished, notifyRefreshFinished, notifySwipeExecuteFinished, onBindSwipeContentHolder, onCreateSwipeContentHolder, remove, remove, reorderItem, setItems
bindViewHolder, createViewHolder, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
public AutoCompleteAdapter(Context context, List<TokenModel> items, Integer layoutItem)
context
- Current context.items
- List of items used as suggestions.layoutItem
- The code of the layout used to represent single suggestion item.public AutoCompleteAdapter(Context context, List<TokenModel> items, ListViewHolder layoutItem)
context
- Current context.items
- List of items used as suggestions.layoutItem
- The view which will represent a suggestion item.public List<TokenModel> getInitialListOfItems()
public void setInitialListOfItems(List<TokenModel> allItems)
public ArrayList<TokenModel> getFilteredList()
getFilteredList
in interface AutoCompleteAdapterBase
public Function2Async<String,List<TokenModel>,List<TokenModel>> getCompletionMode()
getCompletionMode
in interface AutoCompleteAdapterBase
public void setCompletionMode(Function2Async<String,List<TokenModel>,List<TokenModel>> mode)
setCompletionMode
in interface AutoCompleteAdapterBase
public int getHighlightColor()
public void setHighlightColor(int color)
public boolean getHighlightingEnabled()
public void setHighlightingEnabled(boolean isEnabled)
public void setFilteredList(ArrayList<TokenModel> list)
public void filter(String charText)
filter
in interface AutoCompleteAdapterBase
charText
- The input text by which the suggestions are filtered.public void onBindViewHolder(ListViewHolder holder, int position)
onBindViewHolder
in class ListViewAdapter
public ListViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType)
onCreateViewHolder
in class ListViewAdapter