Java Code Examples for android.widget.Filter

The following are top voted examples for showing how to use android.widget.Filter. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: revolution-irc   File: ChatAutoCompleteEditText.java   View source code 6 votes vote down vote up
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();
        }
    });
}
 
Example 2
Project: revolution-irc   File: AutoRunCommandListEditText.java   View source code 6 votes vote down vote up
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();
    });
}
 
Example 3
Project: GCSApp   File: EaseConversationAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (conversationFilter == null) {
        conversationFilter = new ConversationFilter(conversationList);
    }
    return conversationFilter;
}
 
Example 4
Project: Movie-Notifier-Android   File: CinemaIDAdapter.java   View source code 5 votes vote down vote up
@NonNull
@Override
public Filter getFilter() {
    if (filter == null) {
        filter = new CinemaIDFilter();
    }
    return filter;
}
 
Example 5
Project: 2017.1-Trezentos   File: ClassAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (friendFilter == null) {
        friendFilter = new FriendFilter(userClasses, this);
    }

    return friendFilter;
}
 
Example 6
Project: FanChat   File: EaseContactAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if(myFilter==null){
        myFilter = new MyFilter(userList);
    }
    return myFilter;
}
 
Example 7
Project: markor   File: FilesystemDialogAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (_filter == null) {
        _filter = new StringFilter(this, _adapterData);
    }
    return _filter;
}
 
Example 8
Project: crockpod   File: AutoCompleteSearchViewTest.java   View source code 5 votes vote down vote up
@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);
}
 
Example 9
Project: Moodr   File: LatestMoodListAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (moodFilter == null) {
        moodFilter = new MoodFilterHolder(this, origMoods);
    }

    return moodFilter.getFilter();
}
 
Example 10
Project: browser   File: SearchAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
	if (mFilter == null) {
		mFilter = new SearchFilter();
	}
	return mFilter;
}
 
Example 11
Project: Android-FileBrowser-FilePicker   File: CustomAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mFileFilter == null) {
        mFileFilter = new FileFilter();
    }
    return mFileFilter;
}
 
Example 12
Project: polling-station-app   File: ElectionsAdapter.java   View source code 5 votes vote down vote up
/**
 * Get the custom election filter
 * @return filter
 */
@Override
public Filter getFilter() {
    if (electionFilter == null) {
        electionFilter = new ElectionFilter();
    }
    return electionFilter;
}
 
Example 13
Project: chips-input-layout   File: FilterableChipsAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (filter == null) {
        this.filter = new ChipFilter();
    }
    return filter;
}
 
Example 14
Project: EosCommander   File: AccountAdapter.java   View source code 5 votes vote down vote up
@Override
public @NonNull Filter getFilter() {
    if (mFilter == null) {
        mFilter = new AccountFilter();
    }
    return mFilter;
}
 
Example 15
Project: search-dialog   File: BaseSearchDialogCompat.java   View source code 5 votes vote down vote up
public BaseSearchDialogCompat(Context context, ArrayList<T> items, Filter filter,
                              RecyclerView.Adapter adapter,
                              FilterResultListener filterResultListener) {
    this(context);
    mItems = items;
    mFilter = filter;
    mAdapter = adapter;
    mFilterResultListener = filterResultListener;
}
 
Example 16
Project: android-apps   File: MyBaseAdapterFilter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
  if (arrayFilter == null) {
    arrayFilter = new ArrayFilter();
  }
  return arrayFilter;
}
 
Example 17
Project: KTalk   File: EaseContactAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if(myFilter==null){
        myFilter = new MyFilter(userList);
    }
    return myFilter;
}
 
Example 18
Project: KTalk   File: EaseConversationAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (conversationFilter == null) {
        conversationFilter = new ConversationFilter(conversationList);
    }
    return conversationFilter;
}
 
Example 19
Project: MaterialChipsInput   File: FilterableListView.java   View source code 5 votes vote down vote up
public void filterList(CharSequence text) {
    mAdapter.getFilter().filter(text, new Filter.FilterListener() {
        @Override
        public void onFilterComplete(int count) {
            // show if there are results
            if(mAdapter.getItemCount() > 0)
                fadeIn();
            else
                fadeOut();
        }
    });
}
 
Example 20
Project: Tribe   File: EaseContactAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if(myFilter==null){
        myFilter = new MyFilter(userList);
    }
    return myFilter;
}
 
Example 21
Project: Tribe   File: EaseConversationAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (conversationFilter == null) {
        conversationFilter = new ConversationFilter(conversationList);
    }
    return conversationFilter;
}
 
Example 22
Project: Tribe   File: EaseConversationAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (conversationFilter == null) {
        conversationFilter = new ConversationFilter(conversationList);
    }
    return conversationFilter;
}
 
Example 23
Project: IslamicLibraryAndroid   File: TableOfContentRecyclerViewAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mFilter == null) {
        mFilter = new TitlesFilter();
    }
    return mFilter;
}
 
Example 24
Project: IslamicLibraryAndroid   File: BookCategoryRecyclerViewAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mFilter == null) {
        mFilter = new BookGridFilter();
    }
    return mFilter;
}
 
Example 25
Project: exciting-app   File: HeaderViewListAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
	if (mIsFilterable) {
		return ((Filterable) mAdapter).getFilter();
	}
	return null;
}
 
Example 26
Project: youkes_browser   File: SearchAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
	if (mFilter == null) {
		mFilter = new SearchFilter();
	}
	return mFilter;
}
 
Example 27
Project: StopApp   File: AppListAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mAppFilter == null) {
        mAppFilter = new AppFilter();
        mOriginalAppInfo = getData();
    }
    return mAppFilter;
}
 
Example 28
Project: CodeCompilerApp   File: AdapterDetailedList.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (customFilter == null) {
        customFilter = new CustomFilter();
    }
    return customFilter;
}
 
Example 29
Project: StopApp   File: DisableAppAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mAppFilter == null) {
        mAppFilter = new AppFilter();
        mOriginalAppInfo = getData();
    }
    return mAppFilter;
}
 
Example 30
Project: javaide   File: SortedFilterArrayAdapter.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public Filter getFilter() {
    if (mFilter == null) {
        mFilter = new ArrayFilter();
    }
    return mFilter;
}
 
Example 31
Project: aos-Video   File: HeaderGridView.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example 32
Project: GCSApp   File: PublicChatRoomsActivity.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter(){
	if(filter == null){
		filter = new RoomFilter();
	}
	return filter;
}
 
Example 33
Project: Slide-RSS   File: SideArrayAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {

    if (filter == null) {
        filter = new SubFilter();
    }
    return filter;
}
 
Example 34
Project: MyAnimeViewer   File: HeaderGridView.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example 35
Project: MyAnimeViewer   File: HistoryRecyclerAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    switch (mFilterType) {
        case 0:
            mFilter = new HistoryRecordFilter();
            break;
        case 1:
            mFilter = new HistoryRecordCustomFilter();
            break;
    }
    return mFilter;
}
 
Example 36
Project: MyAnimeViewer   File: FlexibleAdapter.java   View source code 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public Filter getFilter() {
	if (mFilter == null) {
		mFilter = new FlexibleFilter();
	}
	return mFilter;
}
 
Example 37
Project: MyAnimeViewer   File: AnimeRecyclerAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    switch (mFilterType) {
        case 0:
            mFilter = new AnimeFilter();
            break;
        case 1:
            mFilter = new AnimeCustomFilter();
            break;
    }
    return mFilter;
}
 
Example 38
Project: MyAnimeViewer   File: LibraryRecyclerAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mFilter == null)
        mFilter = new FileFilter();

    return mFilter;
}
 
Example 39
Project: MyAnimeViewer   File: OfflineHistoryRecyclerAdapter.java   View source code 5 votes vote down vote up
@Override
public Filter getFilter() {
    switch (mFilterType) {
        case 0:
            mFilter = new RecordFilter();
            break;
        case 1:
            mFilter = new RecordCustomFilter();
            break;
    }
    return mFilter;
}
 
Example 40
Project: q-mail   File: FolderList.java   View source code 4 votes vote down vote up
public Filter getFilter() {
    return mFilter;
}