Search in sources :

Example 81 with SearchView

use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.

the class TopBarManagerExample method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.general);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    try {
        worker = TopBarManager.Builder.with(this).companyLogo(R.drawable.starz_logo).searchBarEvents(new SimpleSearchCallBack() {

            @Override
            public void onKeySearchStartConfirm(String text) {
                Log.d("start", text);
            }

            @Override
            public void onKeySearchLetter(String text) {
                Log.d("start", text);
            }

            @Override
            public void onRestoreToNormal(ActionBar toolbar) {
                worker.showBack();
            }

            @Override
            public void onPressSearchButton(ActionBar toolbar) {
                Log.d("tolk", toolbar.toString());
            }
        }).burgerIcon(R.drawable.ic_burger).searchMagnetifyIcon(R.drawable.ic_search_action_icn).searchView(LayoutAsset.classic_3).searchCancelColorId(R.color.amber_a100).searchCancalIconColorId(R.mipmap.cross_mi).setLiveIcon(R.layout.dynamic_icon_p, R.mipmap.crossmp).background(R.drawable.actionbar_bg_dark_black).searchArea(R.drawable.search_area).build(toolbar);
        toolbar.setTitleTextColor(Color.WHITE);
        worker.showCompanyLogo();
        dynamic_icon = worker.getDynamicIcon();
    } catch (Exception e) {
        e.printStackTrace();
    }
    Button b = (Button) findViewById(R.id.b3);
    b.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            worker.triggerfromSearchIcon();
        }
    });
    social = (combar) findViewById(R.id.social_bar_component);
    social.connectAlert(getFragmentManager()).setShareContent("Share item now", "This is the best to share the items", "http://www.wonderful.com");
}
Also used : Button(android.widget.Button) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) SimpleSearchCallBack(com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack)

Example 82 with SearchView

use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.

the class TestOfCandyBar2Icons method onCreate.

@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.general);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    try {
        worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new commonSearchBarMgr() {

            @Override
            public void onKeySearchStartConfirm(String text) {
                Log.d("start", text);
            }

            @Override
            public void onKeySearchLetter(String text) {
                Log.d("start", text);
            }

            @Override
            public void onRestoreToNormal(ActionBar toolbar) {
                worker.showBack();
            }

            @Override
            public void onPressSearchButton(ActionBar toolbar) {
                Log.d("addNow", toolbar.toString());
            }
        }).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
    } catch (Exception e) {
        e.printStackTrace();
    }
    // show title
    Button b1 = (Button) findViewById(R.id.b1);
    // how main bar
    Button b2 = (Button) findViewById(R.id.b2);
    // show search bar
    Button b3 = (Button) findViewById(R.id.b3);
    // other function
    Button b4 = (Button) findViewById(R.id.b4);
    // other function
    Button b5 = (Button) findViewById(R.id.b5);
    // other function
    Button bx = (Button) findViewById(R.id.bxx);
    bx.setText("close this App");
    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    bx.setOnClickListener(this);
}
Also used : V3.layout.commonSearchBarMgr(com.hkm.advancedtoolbar.V3.layout.commonSearchBarMgr) Button(android.widget.Button) ActionBar(android.support.v7.app.ActionBar) SuppressLint(android.annotation.SuppressLint)

Example 83 with SearchView

use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.

the class FragmentWeb method onDestroyOptionsMenu.

@Override
public void onDestroyOptionsMenu() {
    if (itemSearch != null) {
        SearchView searchView = (SearchView) itemSearch.getActionView();
        searchView.setOnQueryTextListener(null);
        MenuItemCompat.setOnActionExpandListener(itemSearch, null);
        itemSearch = null;
    }
    toolbar.setOnMenuItemClickListener(null);
    toolbarActions.setOnMenuItemClickListener(null);
    super.onDestroyOptionsMenu();
}
Also used : SearchView(android.support.v7.widget.SearchView)

Example 84 with SearchView

use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.

the class FragmentProfile method onDestroyOptionsMenu.

@Override
public void onDestroyOptionsMenu() {
    if (itemSearch != null) {
        SearchView searchView = (SearchView) itemSearch.getActionView();
        searchView.setOnQueryTextListener(null);
        itemSearch = null;
    }
    super.onDestroyOptionsMenu();
}
Also used : SearchView(android.support.v7.widget.SearchView)

Example 85 with SearchView

use of android.support.v7.widget.SearchView in project Reader by TheKeeperOfPie.

the class FragmentHistory method setUpOptionsMenu.

private void setUpOptionsMenu() {
    toolbar.inflateMenu(R.menu.menu_history);
    toolbar.setOnMenuItemClickListener(this);
    menu = toolbar.getMenu();
    itemInterface = menu.findItem(R.id.item_interface);
    switch(preferences.getString(AppSettings.INTERFACE_MODE, AppSettings.MODE_GRID)) {
        case AppSettings.MODE_LIST:
            itemInterface.setIcon(R.drawable.ic_view_module_white_24dp);
            break;
        case AppSettings.MODE_GRID:
            itemInterface.setIcon(R.drawable.ic_view_list_white_24dp);
            break;
    }
    itemSearch = menu.findItem(R.id.item_search);
    final SearchView searchView = (SearchView) itemSearch.getActionView();
    View view = searchView.findViewById(android.support.v7.appcompat.R.id.search_go_btn);
    if (view instanceof ImageView) {
        ((ImageView) view).setColorFilter(themer.getColorFilterPrimary());
    }
    MenuItemCompat.setOnActionExpandListener(itemSearch, new MenuItemCompat.OnActionExpandListener() {

        @Override
        public boolean onMenuItemActionExpand(MenuItem item) {
            return true;
        }

        @Override
        public boolean onMenuItemActionCollapse(MenuItem item) {
            controllerHistory.setQuery("");
            Log.d(TAG, "collapse");
            return true;
        }
    });
    searchView.setQueryHint(getString(R.string.hint_title));
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            controllerHistory.setQuery(query);
            return true;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            controllerHistory.setQuery(newText);
            return true;
        }
    });
    searchView.setSubmitButtonEnabled(true);
    for (int index = 0; index < menu.size(); index++) {
        menu.getItem(index).getIcon().mutate().setColorFilter(themer.getColorFilterPrimary());
    }
}
Also used : MenuItemCompat(android.support.v4.view.MenuItemCompat) SearchView(android.support.v7.widget.SearchView) MenuItem(android.view.MenuItem) ImageView(android.widget.ImageView) SpannableString(android.text.SpannableString) SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

SearchView (android.support.v7.widget.SearchView)151 MenuItem (android.view.MenuItem)88 View (android.view.View)56 SearchManager (android.app.SearchManager)37 RecyclerView (android.support.v7.widget.RecyclerView)35 TextView (android.widget.TextView)26 MenuInflater (android.view.MenuInflater)24 ImageView (android.widget.ImageView)20 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)19 MenuItemCompat (android.support.v4.view.MenuItemCompat)18 Toolbar (android.support.v7.widget.Toolbar)16 SearchView (android.widget.SearchView)12 ArrayList (java.util.ArrayList)11 ViewGroup (android.view.ViewGroup)10 MaterialSearchView (com.miguelcatalan.materialsearchview.MaterialSearchView)10 Intent (android.content.Intent)9 ListView (android.widget.ListView)9 BindView (butterknife.BindView)9 AdapterView (android.widget.AdapterView)8 EditText (android.widget.EditText)8