Search in sources :

Example 21 with SearchView

use of android.widget.SearchView in project MagiskManager by topjohnwu.

the class ReposFragment method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_repo, menu);
    SearchView search = (SearchView) menu.findItem(R.id.repo_search).getActionView();
    search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            adapter.filter(newText);
            return false;
        }
    });
}
Also used : SearchView(android.widget.SearchView)

Example 22 with SearchView

use of android.widget.SearchView in project MagiskManager by topjohnwu.

the class MagiskHideFragment method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_magiskhide, menu);
    SearchView search = (SearchView) menu.findItem(R.id.app_search).getActionView();
    search.setOnQueryTextListener(searchListener);
}
Also used : SearchView(android.widget.SearchView)

Example 23 with SearchView

use of android.widget.SearchView in project Pepper_v0 by SamDaQueen.

the class CategoryFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View rootView = inflater.inflate(R.layout.fragment_category, container, false);
    searchView = rootView.findViewById(R.id.search);
    searchView.setQueryHint("Enter item");
    firebaseDatabase = FirebaseDatabase.getInstance();
    // the number of items
    notea = rootView.findViewById(R.id.noTea);
    nosnacks = rootView.findViewById(R.id.noSnacks);
    nochat = rootView.findViewById(R.id.noChat);
    nofrankie = rootView.findViewById(R.id.noFrankie);
    nosouth = rootView.findViewById(R.id.noSouth);
    nolunch = rootView.findViewById(R.id.noLunch);
    nosandwich = rootView.findViewById(R.id.noSandwich);
    nopavbhaji = rootView.findViewById(R.id.noPavbhaji);
    nochinese = rootView.findViewById(R.id.noChinese);
    nosalad = rootView.findViewById(R.id.noSalad);
    nospldosa = rootView.findViewById(R.id.noSplDosa);
    notandoori = rootView.findViewById(R.id.noTandoori);
    nosplpunjabi = rootView.findViewById(R.id.noSplPunjabi);
    nopunjabi = rootView.findViewById(R.id.noPunjabi);
    notandoori = rootView.findViewById(R.id.noTandoori);
    nokofta = rootView.findViewById(R.id.noKofta);
    norice = rootView.findViewById(R.id.noRice);
    nostarters = rootView.findViewById(R.id.noStarters);
    nojuice = rootView.findViewById(R.id.noJuice);
    // database references for each category
    teadatabaseReference = firebaseDatabase.getReference("Tea & Coffee");
    snacksdatabaseReference = firebaseDatabase.getReference("Snacks");
    chatdatabaseReference = firebaseDatabase.getReference("Bombay Chat");
    frankiedatabaseReference = firebaseDatabase.getReference("Frankie");
    southdatabaseReference = firebaseDatabase.getReference("South Indian");
    lunchdatabaseReference = firebaseDatabase.getReference("Lunch & Dinner");
    sandwichdatabaseReference = firebaseDatabase.getReference("Sandwich");
    pavbhajidatabaseReference = firebaseDatabase.getReference("Pav Bhaji");
    chinesedatabaseReference = firebaseDatabase.getReference("Chinese Dishes");
    saladdatabaseReference = firebaseDatabase.getReference("Curd, Salad and Fruits");
    spldosadatabaseReference = firebaseDatabase.getReference("Special Dosa");
    tandooridatabaseReference = firebaseDatabase.getReference("Tandoori");
    splpunjabidatabaseReference = firebaseDatabase.getReference("Special Punjabi");
    punjabidatabaseReference = firebaseDatabase.getReference("Punjabi");
    koftadatabaseReference = firebaseDatabase.getReference("Kofta Dishes");
    ricedatabaseReference = firebaseDatabase.getReference("Basmati Rice");
    starterdatabaseReference = firebaseDatabase.getReference("Starters");
    juicesdatabaseReference = firebaseDatabase.getReference("Juices And Shakes");
    // updating the number of items
    updateCount(teadatabaseReference, notea);
    updateCount(snacksdatabaseReference, nosnacks);
    updateCount(chatdatabaseReference, nochat);
    updateCount(frankiedatabaseReference, nofrankie);
    updateCount(southdatabaseReference, nosouth);
    updateCount(lunchdatabaseReference, nolunch);
    updateCount(sandwichdatabaseReference, nosandwich);
    updateCount(pavbhajidatabaseReference, nopavbhaji);
    updateCount(chinesedatabaseReference, nochinese);
    updateCount(saladdatabaseReference, nosalad);
    updateCount(spldosadatabaseReference, nospldosa);
    updateCount(tandooridatabaseReference, notandoori);
    updateCount(splpunjabidatabaseReference, nosplpunjabi);
    updateCount(punjabidatabaseReference, nopunjabi);
    updateCount(koftadatabaseReference, nokofta);
    updateCount(ricedatabaseReference, norice);
    updateCount(starterdatabaseReference, nostarters);
    updateCount(juicesdatabaseReference, nojuice);
    // LinearLayouts
    tea = rootView.findViewById(R.id.tea);
    snacks = rootView.findViewById(R.id.snacks);
    chat = rootView.findViewById(R.id.bombaychat);
    frankie = rootView.findViewById(R.id.frankie);
    south = rootView.findViewById(R.id.south);
    lunch = rootView.findViewById(R.id.lunch);
    sandwich = rootView.findViewById(R.id.sandwich);
    pavbhaji = rootView.findViewById(R.id.pavbhaji);
    chinese = rootView.findViewById(R.id.chinese);
    salad = rootView.findViewById(R.id.salad);
    spldosa = rootView.findViewById(R.id.spldosa);
    tandoori = rootView.findViewById(R.id.tandoori);
    splpunjabi = rootView.findViewById(R.id.splpunjabi);
    punjabi = rootView.findViewById(R.id.punjabi);
    kofta = rootView.findViewById(R.id.kofta);
    rice = rootView.findViewById(R.id.rice);
    starters = rootView.findViewById(R.id.starters);
    juice = rootView.findViewById(R.id.juices);
    addListenerOnCategories();
    return rootView;
}
Also used : SearchView(android.widget.SearchView) TextView(android.widget.TextView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 24 with SearchView

use of android.widget.SearchView in project CodenameOne by codenameone.

the class SearchViewCompatHoneycomb method setSearchableInfo.

public static void setSearchableInfo(View searchView, ComponentName searchableComponent) {
    SearchView sv = ((SearchView) searchView);
    SearchManager searchManager = (SearchManager) sv.getContext().getSystemService(Context.SEARCH_SERVICE);
    sv.setSearchableInfo(searchManager.getSearchableInfo(searchableComponent));
}
Also used : SearchView(android.widget.SearchView) SearchManager(android.app.SearchManager)

Example 25 with SearchView

use of android.widget.SearchView in project weiciyuan by qii.

the class AtUserFragment method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.actionbar_menu_atuserfragment, menu);
    SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
    SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
    searchView.setIconifiedByDefault(false);
    searchView.setQueryHint(getString(R.string.at_other));
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            if (!TextUtils.isEmpty(newText)) {
                if (task != null) {
                    task.cancel(true);
                }
                task = new AtUserTask(newText);
                task.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
            } else {
                if (task != null) {
                    task.cancel(true);
                }
                atList.clear();
                result.clear();
                atList = AtUsersDBTask.get(GlobalContext.getInstance().getCurrentAccountId());
                for (AtUserBean b : atList) {
                    result.add(b.getNickname());
                }
                adapter.notifyDataSetChanged();
            }
            return false;
        }
    });
    searchView.requestFocus();
}
Also used : SearchView(android.widget.SearchView) SearchManager(android.app.SearchManager) AtUserBean(org.qii.weiciyuan.bean.AtUserBean)

Aggregations

SearchView (android.widget.SearchView)67 View (android.view.View)35 TextView (android.widget.TextView)30 MenuItem (android.view.MenuItem)26 ImageView (android.widget.ImageView)16 ListView (android.widget.ListView)15 AdapterView (android.widget.AdapterView)14 RecyclerView (android.support.v7.widget.RecyclerView)13 SearchManager (android.app.SearchManager)11 Activity (android.app.Activity)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)7 SettingsActivity (com.android.settings.SettingsActivity)7 ViewGroup (android.view.ViewGroup)6 Toolbar (android.widget.Toolbar)6 Intent (android.content.Intent)4 MenuInflater (android.view.MenuInflater)4 RecyclerView (androidx.recyclerview.widget.RecyclerView)4 Nullable (android.support.annotation.Nullable)3 FragmentActivity (android.support.v4.app.FragmentActivity)3 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)3