本文整理匯總了Java中android.widget.Filter.filter方法的典型用法代碼示例。如果您正苦於以下問題:Java Filter.filter方法的具體用法?Java Filter.filter怎麽用?Java Filter.filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.Filter
的用法示例。
在下文中一共展示了Filter.filter方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: performFiltering
import android.widget.Filter; //導入方法依賴的package包/類
private void performFiltering(boolean completeIfSingle) {
final CharSequence text = getCurrentLineToken();
if (text == null)
return;
Filter filter = mCommandAdapter.getFilter();
filter.filter(text, (int i) -> {
if (i == 0) {
dismissDropDown();
return;
}
if (!text.equals(getCurrentLineToken()) && !enoughToFilter())
return;
if (completeIfSingle && i == 1) {
onItemClick(mCommandAdapter.getItem(0));
return;
}
if (i > 0)
showDropDown();
});
}
示例2: performFiltering
import android.widget.Filter; //導入方法依賴的package包/類
private void performFiltering(boolean completeIfSingle) {
if (!updateCompletingCommandFlags())
mAdapter.setEnabledSuggestions(true, mDoChannelSuggestions, false);
final String text = getCurrentToken();
Filter filter = isCommandNameToken() ? mCommandAdapter.getFilter() : mAdapter.getFilter();
filter.filter(text, (int i) -> {
if (i == 0) {
dismissDropDown();
return;
}
if (!getCurrentToken().equals(text) && !enoughToFilter())
return;
if (completeIfSingle && i == 1) {
if (filter == mCommandAdapter.getFilter())
onItemClick(mCommandAdapter.getItem(0));
else
onItemClick(mAdapter.getItem(0));
return;
}
if (i > 0) {
setCurrentCommandAdapter(filter == mCommandAdapter.getFilter());
showDropDown();
}
});
}
示例3: search
import android.widget.Filter; //導入方法依賴的package包/類
private void search(String filterText) {
Filter filter = mLogListAdapter.getFilter();
filter.filter(filterText, this);
mSearchingString = filterText;
}
示例4: doInBackground
import android.widget.Filter; //導入方法依賴的package包/類
@Override
protected Object doInBackground(Object[] objects) {
Filter filter = (Filter) objects[0];
CharSequence s = (CharSequence) objects[1];
filter.filter(s);
return null;
}