diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-04 21:36:30 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-04 21:41:49 +0200 |
commit | 91a75b681d76a863e28db7c14ff1ffd215698997 (patch) | |
tree | 49a09894d5116f4e6d95b09d868d17344225f2fe /ui/src/main/java/com/wireguard/android | |
parent | 0efdf0cdd7324fe444cf67462435ebb4f866b09c (diff) |
ui: always use MaterialAlertDialogBuilder
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt | 8 |
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 +} |