Browse Source

Add donate links; via PayPal on full version or refer to website (that has a link) on lite version. Fixes #329.

pull/424/head
Eric Kok 7 years ago
parent
commit
2ecf4c2581
  1. 3
      app/src/full/res/values/strings.xml
  2. 3
      app/src/lite/res/values/strings.xml
  3. 9
      app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java
  4. 2
      app/src/main/res/values/strings.xml
  5. 4
      app/src/main/res/xml/pref_main.xml

3
app/src/full/res/values/strings.xml

@ -18,4 +18,7 @@ @@ -18,4 +18,7 @@
<string name="app_name" translatable="false">Transdroid</string>
<string name="donate_text">Donate with PayPal</string>
<string name="donate_url">https://paypal.me/erickoknl</string>
</resources>

3
app/src/lite/res/values/strings.xml

@ -18,4 +18,7 @@ @@ -18,4 +18,7 @@
<string name="app_name" translatable="false">Transdrone</string>
<string name="donate_text">Donate via transdroid.org</string>
<string name="donate_url">https://transdroid.org</string>
</resources>

9
app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java

@ -23,6 +23,7 @@ import android.content.DialogInterface; @@ -23,6 +23,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.ListPreference;
@ -113,6 +114,13 @@ public class MainSettingsActivity extends PreferenceCompatActivity { @@ -113,6 +114,13 @@ public class MainSettingsActivity extends PreferenceCompatActivity {
return true;
}
};
private OnPreferenceClickListener onDonate = new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.donate_url))));
return true;
}
};
private OnServerClickedListener onServerClicked = new OnServerClickedListener() {
@Override
public void onServerClicked(ServerSetting serverSetting) {
@ -183,6 +191,7 @@ public class MainSettingsActivity extends PreferenceCompatActivity { @@ -183,6 +191,7 @@ public class MainSettingsActivity extends PreferenceCompatActivity {
findPreference("header_background").setOnPreferenceClickListener(onBackgroundSettings);
findPreference("header_system").setOnPreferenceClickListener(onSystemSettings);
findPreference("header_help").setOnPreferenceClickListener(onHelpSettings);
findPreference("header_donate").setOnPreferenceClickListener(onDonate);
// Keep a list of the server codes and names (for default server selection)
List<String> serverCodes = new ArrayList<>();

2
app/src/main/res/values/strings.xml

@ -354,7 +354,7 @@ @@ -354,7 +354,7 @@
<string name="pref_installhelp_info">Available at transdroid.org/download</string>
<string name="pref_changelog">Recent changes</string>
<string name="pref_about">About %1$s</string>
<string name="pref_seedbox_addseedbox">Add %1$s seedbox</string>
<string name="pref_seedbox_client">Torrent client</string>
<string name="pref_seedbox_client_info">Client to connect to</string>

4
app/src/main/res/xml/pref_main.xml

@ -72,6 +72,10 @@ @@ -72,6 +72,10 @@
android:key="header_help"
android:title="@string/pref_help"
android:order="303" />
<Preference
android:key="header_donate"
android:title="@string/donate_text"
android:order="304" />
</PreferenceCategory>
</PreferenceScreen>

Loading…
Cancel
Save