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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    return mFilter;
}
 
Example 41
Project: GitHub   File: ItemAdapter.java   Source Code and License 4 votes vote down vote up
/**
 * @return the filter used to filter items
 */
public Filter getItemFilter() {
    return mItemFilter;
}
 
Example 42
Project: GitHub   File: FastItemAdapter.java   Source Code and License 4 votes vote down vote up
/**
 * @return the filter used to filter items
 */
public Filter getItemFilter() {
    return mItemAdapter.getItemFilter();
}
 
Example 43
Project: School1-Android   File: FilterAdapter.java   Source Code and License 4 votes vote down vote up
@NonNull
@Override
public Filter getFilter() {
    return filter;
}
 
Example 44
Project: YandexTranslator   File: LanguageAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
    return filter;
}
 
Example 45
Project: YandexTranslator   File: HistoryAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
    return filter;
}
 
Example 46
Project: TYT   File: ListpopAdapter.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    if (mFilter == null) {
        mFilter = new ArrayFilter();
    }
    return mFilter;
}
 
Example 47
Project: searchablespinner   File: SimpleArrayListAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
    return mStringFilter;
}
 
Example 48
Project: realm-helpers   File: MainActivity.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    return new CatFilter(this);
}
 
Example 49
Project: realm-helpers   File: MainActivity.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    return new CatFilter(this);
}
 
Example 50
Project: boohee_v5.6   File: PLA_HeaderViewListAdapter.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    if (this.mIsFilterable) {
        return ((Filterable) this.mAdapter).getFilter();
    }
    return null;
}
 
Example 51
Project: SuperSelector   File: RecyclerViewCursorAdapter.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    if (mCursorFilter == null) {
        mCursorFilter = new CursorFilter(this);
    }
    return mCursorFilter;
}
 
Example 52
Project: XPrivacy   File: ActivityUsage.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
	return new UsageFilter();
}
 
Example 53
Project: search-dialog   File: ContactSearchDialogCompat.java   Source Code and License 4 votes vote down vote up
public ContactSearchDialogCompat(Context context, String title, String searchHint,
                                 @Nullable Filter filter, ArrayList<T> items,
                                 SearchResultListener<T> searchResultListener) {
    super(context, items, filter, null,null);
    init(title, searchHint, searchResultListener);
}
 
Example 54
Project: search-dialog   File: SimpleSearchDialogCompat.java   Source Code and License 4 votes vote down vote up
public SimpleSearchDialogCompat(Context context, String title, String searchHint,
                                @Nullable Filter filter, ArrayList<T> items,
                                SearchResultListener<T> searchResultListener) {
    super(context, items, filter, null,null);
    init(title, searchHint, searchResultListener);
}
 
Example 55
Project: search-dialog   File: BaseSearchDialogCompat.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
    if (mFilter == null)
        mFilter = new SimpleSearchFilter<>(mItems, mFilterResultListener, true, 0.33f);
    return mFilter;
}
 
Example 56
Project: search-dialog   File: BaseSearchDialogCompat.java   Source Code and License 4 votes vote down vote up
public BaseSearchDialogCompat setFilter(Filter filter) {
    mFilter = filter;
    return this;
}
 
Example 57
Project: letv   File: CursorAdapter.java   Source Code and License 4 votes vote down vote up
public Filter getFilter() {
    if (this.mCursorFilter == null) {
        this.mCursorFilter = new CursorFilter(this);
    }
    return this.mCursorFilter;
}
 
Example 58
Project: MaterialChipsInput   File: FilterableAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
    if(mFilter == null)
        mFilter = new ChipFilter(this, mChipList);
    return mFilter;
}
 
Example 59
Project: EasiestGenericRecyclerAdapter   File: GenericRecyclerAdapter.java   Source Code and License 4 votes vote down vote up
public void setFilter(Filter pFilter) {
    mFilter = pFilter;
}
 
Example 60
Project: XPrivacy   File: ActivityMain.java   Source Code and License 4 votes vote down vote up
@Override
public Filter getFilter() {
	return new AppFilter();
}