Added attribution menu

pull/159/head
M66B 6 years ago
parent cbb1cd48c1
commit 196354cf8c

@ -69,6 +69,8 @@ public class FragmentAbout extends FragmentBase {
getIntentChangelog().resolveActivity(pm) != null);
menu.findItem(R.id.menu_issue).setVisible(
Helper.getIntentIssue(getContext()).resolveActivity(pm) != null);
menu.findItem(R.id.menu_attribution).setVisible(
Helper.getIntentAttribution().resolveActivity(pm) != null);
super.onPrepareOptionsMenu(menu);
}
@ -81,6 +83,9 @@ public class FragmentAbout extends FragmentBase {
case R.id.menu_issue:
onMenuIssue();
return true;
case R.id.menu_attribution:
onMenuAttribution();
return true;
default:
return super.onOptionsItemSelected(item);
}
@ -94,6 +99,10 @@ public class FragmentAbout extends FragmentBase {
startActivity(Helper.getIntentIssue(getContext()));
}
private void onMenuAttribution() {
startActivity(Helper.getIntentAttribution());
}
private Intent getIntentChangelog() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(BuildConfig.CHANGELOG));

@ -260,6 +260,12 @@ public class Helper {
return new Intent(Intent.ACTION_VIEW, Uri.parse(XDA_URI));
}
static Intent getIntentAttribution() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/M66B/FairEmail/blob/master/README.md#attribution"));
return intent;
}
// Graphics
static int dp2pixels(Context context, int dp) {

@ -10,4 +10,9 @@
android:id="@+id/menu_issue"
android:title="@string/menu_issue"
app:showAsAction="never" />
<item
android:id="@+id/menu_attribution"
android:title="@string/menu_attribution"
app:showAsAction="never" />
</menu>

@ -80,6 +80,7 @@
<string name="menu_legend">Legend</string>
<string name="menu_faq">Support</string>
<string name="menu_issue">Report issue</string>
<string name="menu_attribution">Attribution</string>
<string name="menu_privacy">Privacy</string>
<string name="menu_about">About</string>

Loading…
Cancel
Save