Use toolbar as action bar
This commit is contained in:
parent
ca0cd3e1b1
commit
49ea547003
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user