The Easy Way
世外桃源 edited this page Jul 30, 2015
·
5 revisions
Easy builder implementation, please put these code before the setSupportActionBar
and after findByid for the android.support.v7.widget.Toolbar;
try {
worker = TopBarManager.ManagerBulider.with(this).searchBarEvents(new TopBarManager.searchBarListener() {
@Override
public void onKeySearchStartConfirm(String s) {
/** your own code start in here **/
if (currentFragmentNow instanceof listTemplate) {
listTemplate k = (listTemplate) currentFragmentNow;
k.triggerSearch(s);
} else {
setinternalChangeNoToggle(listTemplate.loadBundle(listTemplate.conSearch(s)), "search");
}
/** your own code ended in here **/
}
@Override
public void onKeySearchLetter(String s) {
}
@Override
public void onRestoreToNormal(ActionBar actionBar) {
worker.showBack();
}
})
.companyLogo(R.drawable.actionbar_bg_pb_logo)
.background(R.drawable.hb_white_normal_border)
.burgerIcon(R.mipmap.ic_action_menu)
.searchView(SearchCustom.LAYOUT.classic_3)
.build(tb);
} catch (Exception e) {
e.printStackTrace();
}