Skip to content

Commit

Permalink
donate
Browse files Browse the repository at this point in the history
  • Loading branch information
arrase committed Apr 28, 2017
1 parent 3079223 commit 2ce9841
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
Expand Down Expand Up @@ -94,6 +95,17 @@ public boolean onPreferenceClick(Preference preference) {
}
});
}

// Donate
Preference donate = (Preference) findPreference(getString(R.string.pref_donate));
donate.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/OnPanic"));
startActivity(browserIntent);
return true;
}
});
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<string name="pref_set_server_onion" translatable="false">pref_set_server_onion</string>
<string name="pref_orbot_installed" translatable="false">pref_orbot_installed</string>
<string name="pref_run_on_boot" translatable="false">pref_run_on_boot</string>
<string name="pref_donate" translatable="false">pref_donate</string>

<string name="app_name">Onioncat</string>
<string name="action_settings">Settings</string>
Expand All @@ -21,5 +22,7 @@
<string name="delete">Delete</string>
<string name="done">Done</string>
<string name="cancel">Cancel</string>
<string name="donate">Donate</string>
<string name="donate_some_bucks_with_paypal">Donate some bucks with Paypal</string>

</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/xml/ocat_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@
android:key="@string/pref_run_on_boot"
android:title="@string/run_on_boot" />

<Preference
android:key="@string/pref_donate"
android:summary="@string/donate_some_bucks_with_paypal"
android:title="@string/donate" />

</PreferenceScreen>

0 comments on commit 2ce9841

Please sign in to comment.