summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/main')
-rw-r--r--ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt b/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt
index ae2c1c91..59980dcb 100644
--- a/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt
+++ b/ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt
@@ -5,13 +5,13 @@
package com.wireguard.android.preference
-import android.app.AlertDialog
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.util.AttributeSet
import android.widget.Toast
import androidx.preference.Preference
+import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.wireguard.android.BuildConfig
import com.wireguard.android.R
import com.wireguard.android.util.ErrorMessages
@@ -22,13 +22,15 @@ class DonatePreference(context: Context, attrs: AttributeSet?) : Preference(cont
override fun getTitle() = context.getString(R.string.donate_title)
override fun onClick() {
+ /* Google Play Store forbids links to our donation page. */
if (BuildConfig.IS_GOOGLE_PLAY) {
- AlertDialog.Builder(context)
+ MaterialAlertDialogBuilder(context)
.setTitle(R.string.donate_title)
.setMessage(R.string.donate_google_play_disappointment)
.show()
return
}
+
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse("https://www.wireguard.com/donations/")
try {
@@ -37,4 +39,4 @@ class DonatePreference(context: Context, attrs: AttributeSet?) : Preference(cont
Toast.makeText(context, ErrorMessages[e], Toast.LENGTH_SHORT).show()
}
}
-} \ No newline at end of file
+}