private void onTextChanged(CharSequence newText) { CharSequence text = mEditText.getText(); mUserQuery = text; if (mAdapter != null && mAdapter instanceof Filterable) { ((Filterable) mAdapter).getFilter().filter(text); } if (mOnQueryChangeListener != null && !TextUtils.equals(newText, mOldQueryText)) { dispatchFilters(); mOnQueryChangeListener.onQueryTextChange(newText.toString()); } mOldQueryText = newText.toString(); if (!TextUtils.isEmpty(newText)) { showClearTextIcon(); } else { hideClearTextIcon(); } }
public HeaderViewListAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public PLA_HeaderViewListAdapter(ArrayList<PLA_ListView$FixedViewInfo> headerViewInfos, ArrayList<PLA_ListView$FixedViewInfo> footerViewInfos, ListAdapter adapter) { this.mAdapter = adapter; this.mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { this.mHeaderViewInfos = EMPTY_INFO_LIST; } else { this.mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { this.mFooterViewInfos = EMPTY_INFO_LIST; } else { this.mFooterViewInfos = footerViewInfos; } boolean z = areAllListInfosSelectable(this.mHeaderViewInfos) && areAllListInfosSelectable (this.mFooterViewInfos); this.mAreAllFixedViewsSelectable = z; }
public PLA_HeaderViewListAdapter(ArrayList<PLA_ListView.FixedViewInfo> headerViewInfos, ArrayList<PLA_ListView.FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
@Override public <T extends ListAdapter & Filterable> void setAdapter(T adapter) { super.setAdapter(adapter); BaseRecipientAdapter baseAdapter = (BaseRecipientAdapter) adapter; baseAdapter.registerUpdateObserver(new BaseRecipientAdapter.EntriesUpdatedObserver() { @Override public void onChanged(List<RecipientEntry> entries) { // Scroll the chips field to the top of the screen so // that the user can see as many results as possible. if (entries != null && entries.size() > 0) { scrollBottomIntoView(); } } }); baseAdapter.setDropdownChipLayouter(mDropdownChipLayouter); }
public PLAHeaderViewListAdapter(ArrayList<PLAListView.FixedViewInfo> headerViewInfos, ArrayList<PLAListView.FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public HeaderViewListAdapter(ArrayList<StaggeredGridView.FixedViewInfo> headerViewInfos, ArrayList<StaggeredGridView.FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public HeaderViewListAdapter(ArrayList<ExtendableListView.FixedViewInfo> headerViewInfos, ArrayList<ExtendableListView.FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public FilterWidgetSupport(MenuItem searchMenuItem, final Filterable filterable) { this.searchMenuItem = searchMenuItem; searchViewStrategy = (Build.VERSION.SDK_INT >= HONEYCOMB) ? new HoneycombStrategy() : new LegacyStrategy(); searchViewStrategy.setup(searchMenuItem, new SearchViewStrategy.OnFilterTextListener() { public void onFilterTextChange(String newText) { Filter filter = filterable.getFilter(); if (filter != null) filter.filter(newText); } public void onFilterTextSubmit(String query) { Log.d(TAG, "onFilterTextSubmit : '"+query+"'"); clearSearchViewOnSubmit(); } }); }
public HeaderViewListAdapter(List<ViewInfo> headerViewInfos, List<ViewInfo> footerViewInfos, ListAdapter adapter, ListAdapterCallback listener) { super(adapter, listener); mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { mHeaderViewInfos = EMPTY_INFO_LIST; } else { mHeaderViewInfos = headerViewInfos; } if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos); }
public FooterViewGridAdapter(ArrayList<HeaderGridView.FixedViewInfo> headerViewInfos, ArrayList<HeaderGridView.FixedViewInfo> footerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (footerViewInfos == null) { mFooterViewInfos = EMPTY_INFO_LIST; } else { mFooterViewInfos = footerViewInfos; } mAreAllFixedViewsSelectable = areAllListInfosSelectable(mFooterViewInfos); }
@Override public <T extends ListAdapter & Filterable> void setAdapter(final T adapter) { super.setAdapter(adapter); ((BaseRecipientAdapter)adapter).registerUpdateObserver(new BaseRecipientAdapter.EntriesUpdatedObserver() { @Override public void onChanged(final List<RecipientEntry> entries) { // Scroll the chips field to the top of the screen so // that the user can see as many results as possible. if(entries!=null&&entries.size()>0) scrollBottomIntoView(); } }); }
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) { mAdapter = adapter; if (mAdapter != null) { mFilter = ((Filterable) mAdapter).getFilter(); } else { mFilter = null; } }
@Override public Filter getFilter() { if (mIsFilterable) { return ((Filterable) mAdapter).getFilter(); } return null; }
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) { mAdapter = adapter; mIsFilterable = adapter instanceof Filterable; if (headerViewInfos == null) { throw new IllegalArgumentException("headerViewInfos cannot be null"); } mHeaderViewInfos = headerViewInfos; mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos); }