當前位置: 首頁>>代碼示例>>Java>>正文


Java Filter類代碼示例

本文整理匯總了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();
        }
    });
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:26,代碼來源:ChatAutoCompleteEditText.java

示例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();
    });
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:21,代碼來源:AutoRunCommandListEditText.java

示例3: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (conversationFilter == null) {
        conversationFilter = new ConversationFilter(conversationList);
    }
    return conversationFilter;
}
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:8,代碼來源:EaseConversationAdapter.java

示例4: getFilter

import android.widget.Filter; //導入依賴的package包/類
@NonNull
@Override
public Filter getFilter() {
    if (filter == null) {
        filter = new CinemaIDFilter();
    }
    return filter;
}
 
開發者ID:jpelgrom,項目名稱:Movie-Notifier-Android,代碼行數:9,代碼來源:CinemaIDAdapter.java

示例5: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (friendFilter == null) {
        friendFilter = new FriendFilter(userClasses, this);
    }

    return friendFilter;
}
 
開發者ID:fga-gpp-mds,項目名稱:2017.1-Trezentos,代碼行數:9,代碼來源:ClassAdapter.java

示例6: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if(myFilter==null){
        myFilter = new MyFilter(userList);
    }
    return myFilter;
}
 
開發者ID:Vicent9920,項目名稱:FanChat,代碼行數:8,代碼來源:EaseContactAdapter.java

示例7: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (_filter == null) {
        _filter = new StringFilter(this, _adapterData);
    }
    return _filter;
}
 
開發者ID:gsantner,項目名稱:markor,代碼行數:8,代碼來源:FilesystemDialogAdapter.java

示例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);
}
 
開發者ID:KevinLiddle,項目名稱:crockpod,代碼行數:10,代碼來源:AutoCompleteSearchViewTest.java

示例9: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (moodFilter == null) {
        moodFilter = new MoodFilterHolder(this, origMoods);
    }

    return moodFilter.getFilter();
}
 
開發者ID:CMPUT301W17T08,項目名稱:Moodr,代碼行數:9,代碼來源:LatestMoodListAdapter.java

示例10: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
	if (mFilter == null) {
		mFilter = new SearchFilter();
	}
	return mFilter;
}
 
開發者ID:NewCasino,項目名稱:browser,代碼行數:8,代碼來源:SearchAdapter.java

示例11: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (mFileFilter == null) {
        mFileFilter = new FileFilter();
    }
    return mFileFilter;
}
 
開發者ID:adityak368,項目名稱:Android-FileBrowser-FilePicker,代碼行數:8,代碼來源:CustomAdapter.java

示例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;
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:12,代碼來源:ElectionsAdapter.java

示例13: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public Filter getFilter() {
    if (filter == null) {
        this.filter = new ChipFilter();
    }
    return filter;
}
 
開發者ID:tylersuehr7,項目名稱:chips-input-layout,代碼行數:8,代碼來源:FilterableChipsAdapter.java

示例14: getFilter

import android.widget.Filter; //導入依賴的package包/類
@Override
public @NonNull Filter getFilter() {
    if (mFilter == null) {
        mFilter = new AccountFilter();
    }
    return mFilter;
}
 
開發者ID:mithrilcoin-io,項目名稱:EosCommander,代碼行數:8,代碼來源:AccountAdapter.java

示例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;
}
 
開發者ID:mirrajabi,項目名稱:search-dialog,代碼行數:10,代碼來源:BaseSearchDialogCompat.java


注:本文中的android.widget.Filter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。