Skip to content

Commit 91a75b6

Browse files
committed
ui: always use MaterialAlertDialogBuilder
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 0efdf0c commit 91a75b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/src/main/java/com/wireguard/android/preference/DonatePreference.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
package com.wireguard.android.preference
77

8-
import android.app.AlertDialog
98
import android.content.Context
109
import android.content.Intent
1110
import android.net.Uri
1211
import android.util.AttributeSet
1312
import android.widget.Toast
1413
import androidx.preference.Preference
14+
import com.google.android.material.dialog.MaterialAlertDialogBuilder
1515
import com.wireguard.android.BuildConfig
1616
import com.wireguard.android.R
1717
import com.wireguard.android.util.ErrorMessages
@@ -22,13 +22,15 @@ class DonatePreference(context: Context, attrs: AttributeSet?) : Preference(cont
2222
override fun getTitle() = context.getString(R.string.donate_title)
2323

2424
override fun onClick() {
25+
/* Google Play Store forbids links to our donation page. */
2526
if (BuildConfig.IS_GOOGLE_PLAY) {
26-
AlertDialog.Builder(context)
27+
MaterialAlertDialogBuilder(context)
2728
.setTitle(R.string.donate_title)
2829
.setMessage(R.string.donate_google_play_disappointment)
2930
.show()
3031
return
3132
}
33+
3234
val intent = Intent(Intent.ACTION_VIEW)
3335
intent.data = Uri.parse("https://www.wireguard.com/donations/")
3436
try {
@@ -37,4 +39,4 @@ class DonatePreference(context: Context, attrs: AttributeSet?) : Preference(cont
3739
Toast.makeText(context, ErrorMessages[e], Toast.LENGTH_SHORT).show()
3840
}
3941
}
40-
}
42+
}

0 commit comments

Comments
 (0)