Added legend, privacy and about to setup menu

This commit is contained in:
M66B
2018-09-19 11:28:24 +00:00
parent 8b14f68a35
commit 2ea9986977
4 changed files with 45 additions and 8 deletions

View File

@@ -364,6 +364,10 @@ public class FragmentSetup extends FragmentEx {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_legend:
onMenuLegend();
return true;
case R.id.menu_export:
if (Helper.isPro(getContext()))
startActivityForResult(getIntentExport(), ActivitySetup.REQUEST_EXPORT);
@@ -378,6 +382,14 @@ public class FragmentSetup extends FragmentEx {
startActivityForResult(getIntentImport(), ActivitySetup.REQUEST_IMPORT);
return true;
case R.id.menu_privacy:
onMenuPrivacy();
return true;
case R.id.menu_about:
onMenuAbout();
return true;
default:
return super.onOptionsItemSelected(item);
}
@@ -411,6 +423,22 @@ public class FragmentSetup extends FragmentEx {
}
}
private void onMenuPrivacy() {
Helper.view(getContext(), Helper.getIntentPrivacy());
}
private void onMenuLegend() {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentLegend()).addToBackStack("legend");
fragmentTransaction.commit();
}
private void onMenuAbout() {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentAbout()).addToBackStack("about");
fragmentTransaction.commit();
}
private Intent getIntentHelp() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/SETUP.md"));