diff --git a/app/src/main/java/io/legado/app/lib/dialogs/AlertBuilder.kt b/app/src/main/java/io/legado/app/lib/dialogs/AlertBuilder.kt index 27129c7cf..6a245e5fb 100644 --- a/app/src/main/java/io/legado/app/lib/dialogs/AlertBuilder.kt +++ b/app/src/main/java/io/legado/app/lib/dialogs/AlertBuilder.kt @@ -96,23 +96,23 @@ interface AlertBuilder { fun show(): D - fun AlertBuilder<*>.customTitle(view: () -> View) { + fun customTitle(view: () -> View) { customTitle = view() } - fun AlertBuilder<*>.customView(view: () -> View) { + fun customView(view: () -> View) { customView = view() } - fun AlertBuilder<*>.okButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = + fun okButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = positiveButton(android.R.string.ok, handler) - fun AlertBuilder<*>.cancelButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = + fun cancelButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = negativeButton(android.R.string.cancel, handler) - fun AlertBuilder<*>.yesButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = + fun yesButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = positiveButton(R.string.yes, handler) - fun AlertBuilder<*>.noButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = + fun noButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = negativeButton(R.string.no, handler) }