本文整理汇总了Java中android.widget.Filter类的典型用法代码示例。如果您正苦于以下问题:Java Filter类的具体用法?Java Filter怎么用?Java Filter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Filter类属于android.widget包,在下文中一共展示了Filter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
});
}
示例2: 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();
});
}
示例3: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (conversationFilter == null) {
conversationFilter = new ConversationFilter(conversationList);
}
return conversationFilter;
}
示例4: getFilter
import android.widget.Filter; //导入依赖的package包/类
@NonNull
@Override
public Filter getFilter() {
if (filter == null) {
filter = new CinemaIDFilter();
}
return filter;
}
示例5: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (friendFilter == null) {
friendFilter = new FriendFilter(userClasses, this);
}
return friendFilter;
}
示例6: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if(myFilter==null){
myFilter = new MyFilter(userList);
}
return myFilter;
}
示例7: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (_filter == null) {
_filter = new StringFilter(this, _adapterData);
}
return _filter;
}
示例8: setUp
import android.widget.Filter; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
Context context = RuntimeEnvironment.application.getApplicationContext();
adapter = mock(ArrayAdapter.class);
Filter filter = mock(Filter.class);
when(adapter.getFilter()).thenReturn(filter);
view = new AutoCompleteSearchView(context, null);
}
示例9: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (moodFilter == null) {
moodFilter = new MoodFilterHolder(this, origMoods);
}
return moodFilter.getFilter();
}
示例10: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (mFilter == null) {
mFilter = new SearchFilter();
}
return mFilter;
}
示例11: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (mFileFilter == null) {
mFileFilter = new FileFilter();
}
return mFileFilter;
}
示例12: getFilter
import android.widget.Filter; //导入依赖的package包/类
/**
* Get the custom election filter
* @return filter
*/
@Override
public Filter getFilter() {
if (electionFilter == null) {
electionFilter = new ElectionFilter();
}
return electionFilter;
}
示例13: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public Filter getFilter() {
if (filter == null) {
this.filter = new ChipFilter();
}
return filter;
}
示例14: getFilter
import android.widget.Filter; //导入依赖的package包/类
@Override
public @NonNull Filter getFilter() {
if (mFilter == null) {
mFilter = new AccountFilter();
}
return mFilter;
}
示例15: BaseSearchDialogCompat
import android.widget.Filter; //导入依赖的package包/类
public BaseSearchDialogCompat(Context context, ArrayList<T> items, Filter filter,
RecyclerView.Adapter adapter,
FilterResultListener filterResultListener) {
this(context);
mItems = items;
mFilter = filter;
mAdapter = adapter;
mFilterResultListener = filterResultListener;
}