public abstract class AutocompletePresenter<T>
extends java.lang.Object
getView() and onQuery(CharSequence).| Modifier and Type | Class and Description |
|---|---|
static interface |
AutocompletePresenter.ClickProvider<T> |
static class |
AutocompletePresenter.PopupDimensions
Provides width, height, maxWidth and maxHeight for the popup.
|
| Constructor and Description |
|---|
AutocompletePresenter(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
protected android.content.Context |
getContext() |
protected AutocompletePresenter.PopupDimensions |
getPopupDimensions()
Provide the
AutocompletePresenter.PopupDimensions for this popup. |
protected abstract android.view.ViewGroup |
getView()
Called each time the popup is shown.
|
protected boolean |
isShowing() |
protected abstract void |
onQuery(java.lang.CharSequence query)
Called to update the view to filter results with the query.
|
protected abstract void |
onViewHidden()
Called when the popup is hidden, to release resources.
|
protected abstract void |
onViewShown()
Perform firther initialization here.
|
protected void |
registerClickProvider(AutocompletePresenter.ClickProvider<T> provider)
At this point the presenter is passed the
AutocompletePresenter.ClickProvider. |
protected void |
registerDataSetObserver(android.database.DataSetObserver observer)
Useful if you wish to change width/height based on content height.
|
public AutocompletePresenter(android.content.Context context)
protected void registerClickProvider(AutocompletePresenter.ClickProvider<T> provider)
AutocompletePresenter.ClickProvider.
The contract is that AutocompletePresenter.ClickProvider.click(Object) must be called when a list item
is clicked. This ensure that the autocomplete callback will receive the event.provider - a click provider for this presenter.protected void registerDataSetObserver(android.database.DataSetObserver observer)
DataSetObserver.onChanged() when your view has
changes.
This is called after getView().observer - the observer.protected abstract android.view.ViewGroup getView()
getContext().protected AutocompletePresenter.PopupDimensions getPopupDimensions()
AutocompletePresenter.PopupDimensions for this popup. Called just once.
You can use fixed dimensions or ViewGroup.LayoutParams.WRAP_CONTENT and
ViewGroup.LayoutParams.MATCH_PARENT.protected abstract void onViewShown()
getView(),
each time the popup is shown.protected abstract void onQuery(@Nullable
java.lang.CharSequence query)
query - query from the edit text, to filter our resultsprotected abstract void onViewHidden()
protected final android.content.Context getContext()
protected final boolean isShowing()