Add contact developer link to preferences

pull/820/head
Alex Baker 7 years ago
parent 0bc53fcce4
commit 21c40c74af

@ -138,16 +138,9 @@ public abstract class InjectingPreferenceActivity extends AppCompatPreferenceAct
@Override
public boolean onMenuItemClick(MenuItem item) {
String email = getString(R.string.support_email);
switch (item.getItemId()) {
case R.id.menu_contact:
Intent mailto =
new Intent(
Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "Alex <" + email + ">", null));
mailto.putExtra(Intent.EXTRA_SUBJECT, "Tasks Feedback");
mailto.putExtra(Intent.EXTRA_TEXT, device.getDebugInfo());
startActivity(mailto);
emailSupport();
return true;
case R.id.menu_help:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getHelpUrl())));
@ -157,6 +150,15 @@ public abstract class InjectingPreferenceActivity extends AppCompatPreferenceAct
}
}
protected void emailSupport() {
startActivity(
new Intent(
Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "Alex <" + getString(R.string.support_email) + ">", null))
.putExtra(Intent.EXTRA_SUBJECT, "Tasks Feedback")
.putExtra(Intent.EXTRA_TEXT, device.getDebugInfo()));
}
protected String getHelpUrl() {
return "http://tasks.org/help";
}

@ -198,6 +198,13 @@ public class BasicPreferences extends InjectingPreferenceActivity
}
});
findPreference(R.string.contact_developer)
.setOnPreferenceClickListener(
preference -> {
emailSupport();
return false;
});
findPreference(R.string.third_party_licenses)
.setOnPreferenceClickListener(
preference -> {

@ -152,6 +152,10 @@
android:key="@string/third_party_licenses"
android:title="@string/third_party_licenses"/>
<Preference
android:key="@string/contact_developer"
android:title="@string/contact_developer"/>
<Preference
android:key="@string/rate_tasks"
android:title="@string/rate_tasks"/>

Loading…
Cancel
Save