Search in sources :

Example 1 with MaterialSearchView

use of com.hkm.advancedtoolbar.materialsearch.MaterialSearchView in project ToolBarLib by jjhesk.

the class BeastBarDemo_v1 method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.general);
    Toolbar temp = (Toolbar) findViewById(R.id.toolbar);
    combar cBar = (combar) findViewById(R.id.social_bar_component);
    cBar.setShareContent("exiting news", "this is the bredf", "http://www.popbee.com");
    BeastBar.Builder bb = new BeastBar.Builder();
    bb.back(R.drawable.ic_m_back);
    bb.companyIcon(R.drawable.starz_logo);
    bb.background(R.drawable.actionbar_bg_dark_black);
    bb.search(R.drawable.ic_find_mg);
    bb.setToolBarTitleSize(R.dimen.tb_title);
    bb.defaultTitle("Wrtie Comment");
    bb.setFontFace(this, "Pacifico.ttf");
    bb.setToolBarTitleColor(R.color.amber_700);
    bb.enableLogoAnimation(false);
    toolbar = BeastBar.withToolbar(this, temp, bb);
    searchView = (MaterialSearchView) findViewById(R.id.cmarterialsearch);
    searchView.setVoiceSearch(true);
    searchView.setCursorDrawable(R.drawable.color_cursor_white);
    // searchView.setSuggestions(getSuggestions());
    searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {

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

        @Override
        public boolean onQueryTextChange(String newText) {
            // Do some magic
            return false;
        }
    });
    // 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);
    b4.setText("show back");
    // other function
    Button b5 = (Button) findViewById(R.id.b5);
    b5.setText("remove back");
    // other function
    Button bx = (Button) findViewById(R.id.bxx);
    // other function
    Button bs = (Button) findViewById(R.id.b_search);
    // other function
    Button search_off = (Button) findViewById(R.id.search_off);
    // other function
    Button search_on = (Button) findViewById(R.id.search_on);
    bx.setText("close this App");
    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    bx.setOnClickListener(this);
    bs.setOnClickListener(this);
    search_off.setOnClickListener(this);
    search_on.setOnClickListener(this);
    toolbar.setFindIconFunc(new ButtonCon());
}
Also used : Button(android.widget.Button) BeastBar(com.hkm.advancedtoolbar.V5.BeastBar) MaterialSearchView(com.hkm.advancedtoolbar.materialsearch.MaterialSearchView) com.hkm.advancedtoolbar.socialbar.combar(com.hkm.advancedtoolbar.socialbar.combar) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 Button (android.widget.Button)1 BeastBar (com.hkm.advancedtoolbar.V5.BeastBar)1 MaterialSearchView (com.hkm.advancedtoolbar.materialsearch.MaterialSearchView)1 com.hkm.advancedtoolbar.socialbar.combar (com.hkm.advancedtoolbar.socialbar.combar)1