mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-08 15:58:48 +00:00
DonateFragment: craft bitcoin URI by hand
This lets us get rid of the `integration-android` artifact.
This commit is contained in:
parent
a16e298047
commit
bb4ce986e0
5 changed files with 6 additions and 13 deletions
|
@ -12,7 +12,6 @@ configurations {
|
|||
|
||||
dependencies {
|
||||
implementation project(':public-transport-enabler')
|
||||
implementation 'de.schildbach.wallet:integration-android:2.0'
|
||||
implementation 'androidx.annotation:annotation:1.3.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
<string name="about_donate_title">Donations</string>
|
||||
<string name="about_donate_bitcoin_title">Donate Bitcoins</string>
|
||||
<string name="about_donate_bitcoin_summary">Bitcoin is an Internet currency.</string>
|
||||
<string name="about_donate_bitcoin_uri">bitcoin:bc1q8ruc8hanp7hrzfs48dvtuzz4ukmpe7cgsvvzrt</string>
|
||||
<string name="about_donate_euro_title">Donate Euros</string>
|
||||
<string name="about_donate_euro_summary">https://oeffi.schildbach.de/donate.html</string>
|
||||
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
<Preference
|
||||
android:key="about_donate_bitcoin"
|
||||
android:summary="@string/about_donate_bitcoin_summary"
|
||||
android:title="@string/about_donate_bitcoin_title" />
|
||||
android:title="@string/about_donate_bitcoin_title">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="@string/about_donate_bitcoin_uri" />
|
||||
</Preference>
|
||||
<Preference
|
||||
android:key="about_donate_euro"
|
||||
android:summary="@string/about_donate_euro_summary"
|
||||
|
|
|
@ -30,8 +30,6 @@ public class Constants {
|
|||
public static final String PLAN_INDEX_FILENAME = "plans-index.txt";
|
||||
public static final String PLAN_STATIONS_FILENAME = "plans-stations.txt";
|
||||
|
||||
public static final String BITCOIN_ADDRESS = "bc1q8ruc8hanp7hrzfs48dvtuzz4ukmpe7cgsvvzrt";
|
||||
|
||||
public static final String REPORT_EMAIL = "oeffi.app@gmail.com";
|
||||
|
||||
public static final long LOCATION_UPDATE_FREQ_MS = 10 * DateUtils.SECOND_IN_MILLIS;
|
||||
|
|
|
@ -20,21 +20,12 @@ package de.schildbach.oeffi.preference;
|
|||
import android.os.Bundle;
|
||||
import android.preference.PreferenceFragment;
|
||||
import androidx.annotation.Nullable;
|
||||
import de.schildbach.oeffi.Constants;
|
||||
import de.schildbach.oeffi.R;
|
||||
import de.schildbach.wallet.integration.android.BitcoinIntegration;
|
||||
|
||||
public class DonateFragment extends PreferenceFragment {
|
||||
private static final String KEY_ABOUT_DONATE_BITCOIN = "about_donate_bitcoin";
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
addPreferencesFromResource(R.xml.preference_donate);
|
||||
findPreference(KEY_ABOUT_DONATE_BITCOIN).setOnPreferenceClickListener(preference -> {
|
||||
BitcoinIntegration.request(getActivity(), Constants.BITCOIN_ADDRESS);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue