本文整理汇总了Java中android.widget.Filterable类的典型用法代码示例。如果您正苦于以下问题:Java Filterable类的具体用法?Java Filterable怎么用?Java Filterable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Filterable类属于android.widget包,在下文中一共展示了Filterable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTextChanged
import android.widget.Filterable; //导入依赖的package包/类
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();
}
}
示例2: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例3: PLA_HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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;
}
示例4: PLA_HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例5: HeaderViewGridAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例6: HeaderViewGridAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例7: setAdapter
import android.widget.Filterable; //导入依赖的package包/类
@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);
}
示例8: PLAHeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例9: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例10: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例11: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例12: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例13: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}
示例14: FilterWidgetSupport
import android.widget.Filterable; //导入依赖的package包/类
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();
}
});
}
示例15: HeaderViewListAdapter
import android.widget.Filterable; //导入依赖的package包/类
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);
}