Refactoring

This commit is contained in:
M66B 2019-04-25 09:02:29 +02:00
parent 87f2a90645
commit 42960e48e8
1 changed files with 12 additions and 12 deletions

View File

@ -189,12 +189,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Log.i("Navigation id=" + item.getId() + " menu=" + item.getMenuId());
switch (item.getMenuId()) {
case R.string.menu_answers:
onMenuAnswers();
break;
case R.string.menu_operations:
onMenuOperations();
break;
case R.string.menu_answers:
onMenuAnswers();
break;
case R.string.menu_setup:
onMenuSetup();
break;
@ -932,15 +932,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}.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() {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
getSupportFragmentManager().popBackStack("operations", FragmentManager.POP_BACK_STACK_INCLUSIVE);
@ -950,6 +941,15 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
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() {
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
}