mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
87f2a90645
commit
42960e48e8
|
@ -189,12 +189,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
Log.i("Navigation id=" + item.getId() + " menu=" + item.getMenuId());
|
Log.i("Navigation id=" + item.getId() + " menu=" + item.getMenuId());
|
||||||
|
|
||||||
switch (item.getMenuId()) {
|
switch (item.getMenuId()) {
|
||||||
case R.string.menu_answers:
|
|
||||||
onMenuAnswers();
|
|
||||||
break;
|
|
||||||
case R.string.menu_operations:
|
case R.string.menu_operations:
|
||||||
onMenuOperations();
|
onMenuOperations();
|
||||||
break;
|
break;
|
||||||
|
case R.string.menu_answers:
|
||||||
|
onMenuAnswers();
|
||||||
|
break;
|
||||||
case R.string.menu_setup:
|
case R.string.menu_setup:
|
||||||
onMenuSetup();
|
onMenuSetup();
|
||||||
break;
|
break;
|
||||||
|
@ -932,15 +932,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
}.execute(this, args, "menu:inbox");
|
}.execute(this, args, "menu:inbox");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onMenuAnswers() {
|
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
|
||||||
getSupportFragmentManager().popBackStack("answers", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
|
||||||
|
|
||||||
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
|
||||||
fragmentTransaction.replace(R.id.content_frame, new FragmentAnswers()).addToBackStack("answers");
|
|
||||||
fragmentTransaction.commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onMenuOperations() {
|
private void onMenuOperations() {
|
||||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
getSupportFragmentManager().popBackStack("operations", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
getSupportFragmentManager().popBackStack("operations", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
@ -950,6 +941,15 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onMenuAnswers() {
|
||||||
|
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
|
||||||
|
getSupportFragmentManager().popBackStack("answers", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
|
||||||
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
|
||||||
|
fragmentTransaction.replace(R.id.content_frame, new FragmentAnswers()).addToBackStack("answers");
|
||||||
|
fragmentTransaction.commit();
|
||||||
|
}
|
||||||
|
|
||||||
private void onMenuSetup() {
|
private void onMenuSetup() {
|
||||||
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
|
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue