mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-16 16:47:21 +02:00
enhance(dialog): use MaterialAlertDialogBuilder (#3491)
* Fix example insets * Add app-region: drag * Use `Theme.Material3.DayNight.NoActionBar` * Re-generate some kotlin files * Use MaterialAlertDialogBuilder * Add change file * Revert back to margin-top: 0.5rem * Re-generate outdated gradle wrapper from #3039 * Move title bar to its own file * Fix cancel message
This commit is contained in:
@@ -35,8 +35,8 @@ android {
|
||||
dependencies {
|
||||
|
||||
implementation("androidx.core:core-ktx:1.9.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.0")
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||
implementation("com.google.android.material:material:1.13.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
package app.tauri.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
@@ -21,6 +20,7 @@ import app.tauri.plugin.Invoke
|
||||
import app.tauri.plugin.JSArray
|
||||
import app.tauri.plugin.JSObject
|
||||
import app.tauri.plugin.Plugin
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
@InvokeArg
|
||||
class Filter {
|
||||
@@ -158,7 +158,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
|
||||
Handler(Looper.getMainLooper())
|
||||
.post {
|
||||
val builder = AlertDialog.Builder(activity)
|
||||
val builder = MaterialAlertDialogBuilder(activity)
|
||||
|
||||
if (args.title != null) {
|
||||
builder.setTitle(args.title)
|
||||
@@ -191,8 +191,7 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
|
||||
}
|
||||
}
|
||||
|
||||
val dialog = builder.create()
|
||||
dialog.show()
|
||||
builder.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user