Use toolbar as action bar

This commit is contained in:
serso 2016-02-22 10:19:15 +01:00
parent ca0cd3e1b1
commit 49ea547003

View File

@ -182,14 +182,10 @@ public class ActivityUi {
if (activity instanceof CalculatorActivity) { if (activity instanceof CalculatorActivity) {
return; return;
} }
toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha); activity.setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() { final ActionBar actionBar = activity.getSupportActionBar();
@Override Check.isNotNull(actionBar);
public void onClick(View v) { actionBar.setDisplayHomeAsUpEnabled(true);
activity.onBackPressed();
}
});
toolbar.setTitle(activity.getTitle());
} }
public void restoreSavedTab() { public void restoreSavedTab() {