Reordered navigation menus

pull/147/head
M66B 6 years ago
parent f628fa0942
commit 62e1d8eedb

@ -132,9 +132,6 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
case R.string.title_setup_help: case R.string.title_setup_help:
onMenuHelp(); onMenuHelp();
break; break;
case R.string.title_setup_notifications:
onManageNotifications();
break;
case R.string.title_setup_export: case R.string.title_setup_export:
onMenuExport(); onMenuExport();
break; break;
@ -146,6 +143,9 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
case R.string.title_setup_black_theme: case R.string.title_setup_black_theme:
onMenuTheme(item.getId()); onMenuTheme(item.getId());
break; break;
case R.string.title_setup_notifications:
onManageNotifications();
break;
case R.string.title_setup_advanced: case R.string.title_setup_advanced:
onMenuOptions(); onMenuOptions();
break; break;
@ -175,9 +175,6 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); drawerArray.add(new DrawerItem(R.layout.item_drawer_separator));
if (getIntentNotifications(this).resolveActivity(pm) != null)
drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_notifications_24, R.string.title_setup_notifications));
if (getIntentExport().resolveActivity(pm) != null) if (getIntentExport().resolveActivity(pm) != null)
drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_archive_24, R.string.title_setup_export)); drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_archive_24, R.string.title_setup_export));
if (getIntentImport().resolveActivity(pm) != null) if (getIntentImport().resolveActivity(pm) != null)
@ -192,6 +189,9 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
else else
drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_palette_24, R.string.title_setup_dark_theme)); drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_palette_24, R.string.title_setup_dark_theme));
if (getIntentNotifications(this).resolveActivity(pm) != null)
drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_notifications_24, R.string.title_setup_notifications));
drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_settings_applications_24, R.string.title_setup_advanced)); drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_settings_applications_24, R.string.title_setup_advanced));
drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); drawerArray.add(new DrawerItem(R.layout.item_drawer_separator));

@ -176,24 +176,24 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
case -1: case -1:
onMenuFolders((long) item.getData()); onMenuFolders((long) item.getData());
break; break;
case R.string.menu_setup:
onMenuSetup();
break;
case R.string.menu_answers: case R.string.menu_answers:
onMenuAnswers(); onMenuAnswers();
break; break;
case R.string.menu_operations: case R.string.menu_operations:
onMenuOperations(); onMenuOperations();
break; break;
case R.string.menu_pro:
onMenuPro();
break;
case R.string.menu_setup:
onMenuSetup();
break;
case R.string.menu_legend: case R.string.menu_legend:
onMenuLegend(); onMenuLegend();
break; break;
case R.string.menu_faq: case R.string.menu_faq:
onMenuFAQ(); onMenuFAQ();
break; break;
case R.string.menu_pro:
onMenuPro();
break;
case R.string.menu_privacy: case R.string.menu_privacy:
onMenuPrivacy(); onMenuPrivacy();
break; break;
@ -222,12 +222,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
case -1: case -1:
onMenuInbox((long) item.getData()); onMenuInbox((long) item.getData());
break; break;
case R.string.menu_setup:
onReload();
break;
case R.string.menu_operations: case R.string.menu_operations:
onShowLog(); onShowLog();
break; break;
case R.string.menu_setup:
onReload();
break;
case R.string.menu_faq: case R.string.menu_faq:
onDebugInfo(); onDebugInfo();
break; break;
@ -295,21 +295,22 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); drawerArray.add(new DrawerItem(R.layout.item_drawer_separator));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_settings_applications_24, R.string.menu_setup));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_reply_24, R.string.menu_answers)); drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_reply_24, R.string.menu_answers));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_list_24, R.string.menu_operations));
Intent pro = getIntentPro();
if (pro == null || pro.resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_monetization_on_24, R.string.menu_pro));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_settings_applications_24, R.string.menu_setup));
drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); drawerArray.add(new DrawerItem(R.layout.item_drawer_separator));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_list_24, R.string.menu_operations));
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_help_24, R.string.menu_legend)); drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_help_24, R.string.menu_legend));
if (Helper.getIntentFAQ().resolveActivity(getPackageManager()) != null) if (Helper.getIntentFAQ().resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_question_answer_24, R.string.menu_faq)); drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_question_answer_24, R.string.menu_faq));
Intent pro = getIntentPro();
if (pro == null || pro.resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_monetization_on_24, R.string.menu_pro));
if (Helper.getIntentPrivacy().resolveActivity(getPackageManager()) != null) if (Helper.getIntentPrivacy().resolveActivity(getPackageManager()) != null)
drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_account_box_24, R.string.menu_privacy)); drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_account_box_24, R.string.menu_privacy));
@ -854,10 +855,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}.execute(this, args, "menu:inbox"); }.execute(this, args, "menu:inbox");
} }
private void onMenuSetup() {
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
}
private void onMenuAnswers() { private void onMenuAnswers() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAnswers()).addToBackStack("answers"); fragmentTransaction.replace(R.id.content_frame, new FragmentAnswers()).addToBackStack("answers");
@ -870,22 +867,26 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
private void onMenuLegend() { private void onMenuPro() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentLegend()).addToBackStack("legend"); fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
private void onMenuFAQ() { private void onMenuSetup() {
Helper.view(this, this, Helper.getIntentFAQ()); startActivity(new Intent(ActivityView.this, ActivitySetup.class));
} }
private void onMenuPro() { private void onMenuLegend() {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro"); fragmentTransaction.replace(R.id.content_frame, new FragmentLegend()).addToBackStack("legend");
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
private void onMenuFAQ() {
Helper.view(this, this, Helper.getIntentFAQ());
}
private void onMenuPrivacy() { private void onMenuPrivacy() {
Helper.view(this, this, Helper.getIntentPrivacy()); Helper.view(this, this, Helper.getIntentPrivacy());
} }

Loading…
Cancel
Save