Search in sources :

Example 1 with SimpleSearchCallBack

use of com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack in project ToolBarLib by jjhesk.

the class TestOfCandyBar 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 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();
            }
        }).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.cross_grey, 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 bxx = (Button) findViewById(R.id.bxx);
    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    bxx.setOnClickListener(this);
}
Also used : Button(android.widget.Button) ActionBar(android.support.v7.app.ActionBar) SimpleSearchCallBack(com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack) SuppressLint(android.annotation.SuppressLint)

Example 2 with SimpleSearchCallBack

use of com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack 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)

Aggregations

ActionBar (android.support.v7.app.ActionBar)2 Button (android.widget.Button)2 SimpleSearchCallBack (com.hkm.advancedtoolbar.V3.layout.SimpleSearchCallBack)2 SuppressLint (android.annotation.SuppressLint)1 View (android.view.View)1