本文整理匯總了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);
}