@Test @SuppressWarnings("unchecked") public void testOnTextChanged() throws Exception { adapterDelegate.setItems(dataset); OnTokensChangedListener mockListener = mock(OnTokensChangedListener.class); adapterDelegate.setOnTokensChangedListener(mockListener); adapterDelegate.onTextChanged(" Spain"); ShadowLooper.runUiThreadTasks(); verify(mockListener).onTokenAdded(eq("Spain"), eq("Spain")); adapterDelegate.onTextChanged(" Spai"); ShadowLooper.runUiThreadTasks(); verify(mockListener).onTokenRemoved(eq("Spain"), eq("Spain")); }
@Override public final void onTextChanged(@NonNull CharSequence text) { lastText = text; computeTokenChangesAsync(text); }
BaseTypeAdapterDelegate extends BaseAdapter implements TypeAdapterDelegate<M>, AutoCompleteTypeAdapter<M> { @Override public final void onTextChanged(@NonNull CharSequence text) { lastText = text; computeTokenChangesAsync(text); } }
BaseTypeAdapterDelegate extends BaseAdapter implements TypeAdapterDelegate<M>, AutoCompleteTypeAdapter<M> { @Override public final void onTextChanged(@NonNull CharSequence text) { lastText = text; computeTokenChangesAsync(text); } BaseTypeAdapterDelegate(@NonNull AutoCompleteViewBinder<M> viewBinder, @NonNull TokenFilter<M> tokenFilter); @VisibleForTesting  BaseTypeAdapterDelegate(@NonNull Executor computationExecutor,
                                               @NonNull Handler mainThreadHandler,
                                               @NonNull AutoCompleteViewBinder<M> viewBinder,
                                               @NonNull TokenFilter<M> tokenFilter); }
BaseTypeAdapterDelegate extends BaseAdapter implements TypeAdapterDelegate<M>, AutoCompleteTypeAdapter<M> { @Override public final void onTextChanged(@NonNull CharSequence text) { lastText = text; computeTokenChangesAsync(text); } BaseTypeAdapterDelegate(@NonNull AutoCompleteViewBinder<M> viewBinder, @NonNull TokenFilter<M> tokenFilter); @VisibleForTesting  BaseTypeAdapterDelegate(@NonNull Executor computationExecutor,
                                               @NonNull Handler mainThreadHandler,
                                               @NonNull AutoCompleteViewBinder<M> viewBinder,
                                               @NonNull TokenFilter<M> tokenFilter); @Override @NonNull TokenFilter<M> getFilter(); @Override @CallSuper void setItems(@NonNull List<M> items); @Override final void setFilteredItems(@NonNull List<M> filteredItems); @Override final int getCount(); @Override final @NonNull M getItem(int position); @Override long getItemId(int position); @Override @NonNull View getView(@NonNull LayoutInflater inflater,
                                 int position,
                                 @Nullable View convertView,
                                 @NonNull ViewGroup parent,
                                 @Nullable CharSequence constraint); @Override View getView(int position, View convertView, ViewGroup parent); @Override @WorkerThread final @NonNull List<M> performFiltering(@NonNull CharSequence constraint); @Override final void setOnTokensChangedListener(@Nullable OnTokensChangedListener<M> listener); @Override final void onTextChanged(@NonNull CharSequence text); }
BaseTypeAdapterDelegate extends BaseAdapter implements TypeAdapterDelegate<M>, AutoCompleteTypeAdapter<M> { @Override public final void onTextChanged(@NonNull CharSequence text) { lastText = text; computeTokenChangesAsync(text); } BaseTypeAdapterDelegate(@NonNull AutoCompleteViewBinder<M> viewBinder, @NonNull TokenFilter<M> tokenFilter); @VisibleForTesting  BaseTypeAdapterDelegate(@NonNull Executor computationExecutor,
                                               @NonNull Handler mainThreadHandler,
                                               @NonNull AutoCompleteViewBinder<M> viewBinder,
                                               @NonNull TokenFilter<M> tokenFilter); @Override @NonNull TokenFilter<M> getFilter(); @Override @CallSuper void setItems(@NonNull List<M> items); @Override final void setFilteredItems(@NonNull List<M> filteredItems); @Override final int getCount(); @Override final @NonNull M getItem(int position); @Override long getItemId(int position); @Override @NonNull View getView(@NonNull LayoutInflater inflater,
                                 int position,
                                 @Nullable View convertView,
                                 @NonNull ViewGroup parent,
                                 @Nullable CharSequence constraint); @Override View getView(int position, View convertView, ViewGroup parent); @Override @WorkerThread final @NonNull List<M> performFiltering(@NonNull CharSequence constraint); @Override final void setOnTokensChangedListener(@Nullable OnTokensChangedListener<M> listener); @Override final void onTextChanged(@NonNull CharSequence text);  }