mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 17:13:23 +02:00
Added legend, privacy and about to setup menu
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user