mirror of https://github.com/M66B/FairEmail.git
Added legend, privacy and about to setup menu
This commit is contained in:
parent
8b14f68a35
commit
2ea9986977
|
@ -215,7 +215,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
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 (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_info_24, R.string.menu_about));
|
||||
|
@ -562,12 +562,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
}.load(this, new Bundle());
|
||||
}
|
||||
|
||||
private Intent getIntentPrivacy() {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://email.faircode.eu/privacy/"));
|
||||
return intent;
|
||||
}
|
||||
|
||||
private Intent getIntentFAQ() {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/FAQ.md"));
|
||||
|
@ -634,7 +628,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
}
|
||||
|
||||
private void onMenuPrivacy() {
|
||||
Helper.view(this, getIntentPrivacy());
|
||||
Helper.view(this, Helper.getIntentPrivacy());
|
||||
}
|
||||
|
||||
private void onMenuAbout() {
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -97,6 +97,12 @@ public class Helper {
|
|||
customTabsIntent.launchUrl(context, uri);
|
||||
}
|
||||
|
||||
static Intent getIntentPrivacy() {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://email.faircode.eu/privacy/"));
|
||||
return intent;
|
||||
}
|
||||
|
||||
static int resolveColor(Context context, int attr) {
|
||||
int[] attrs = new int[]{attr};
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_legend"
|
||||
android:title="@string/menu_legend" />
|
||||
<item
|
||||
android:id="@+id/menu_export"
|
||||
android:title="@string/title_setup_export" />
|
||||
<item
|
||||
android:id="@+id/menu_import"
|
||||
android:title="@string/title_setup_import" />
|
||||
<item
|
||||
android:id="@+id/menu_privacy"
|
||||
android:title="@string/menu_privacy" />
|
||||
<item
|
||||
android:id="@+id/menu_about"
|
||||
android:title="@string/menu_about" />
|
||||
</menu>
|
||||
|
|
Loading…
Reference in New Issue