1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 18:27:43 +00:00

Added log to setup nav menu

This commit is contained in:
M66B 2021-03-06 16:03:51 +01:00
parent 60a7b44675
commit 1643396973

View file

@ -225,6 +225,14 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
} }
}).setSeparated()); }).setSeparated());
menus.add(new NavMenuItem(R.drawable.twotone_list_alt_24, R.string.title_log, new Runnable() {
@Override
public void run() {
drawerLayout.closeDrawer(drawerContainer);
onMenuLog();
}
}));
menus.add(new NavMenuItem(R.drawable.twotone_help_24, R.string.menu_legend, new Runnable() { menus.add(new NavMenuItem(R.drawable.twotone_help_24, R.string.menu_legend, new Runnable() {
@Override @Override
public void run() { public void run() {
@ -458,6 +466,15 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
private void onMenuLog() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getSupportFragmentManager().popBackStack("logs", FragmentManager.POP_BACK_STACK_INCLUSIVE);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentLogs()).addToBackStack("logs");
fragmentTransaction.commit();
}
private void onMenuLegend() { private void onMenuLegend() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
getSupportFragmentManager().popBackStack("legend", FragmentManager.POP_BACK_STACK_INCLUSIVE); getSupportFragmentManager().popBackStack("legend", FragmentManager.POP_BACK_STACK_INCLUSIVE);