|
|
|
@ -94,7 +94,7 @@ interface AlertBuilder<out D : DialogInterface> { |
|
|
|
|
|
|
|
|
|
fun build(): D |
|
|
|
|
fun show(): D |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun AlertBuilder<*>.customTitle(view: () -> View) { |
|
|
|
|
customTitle = view() |
|
|
|
@ -104,14 +104,15 @@ fun AlertBuilder<*>.customView(view: () -> View) { |
|
|
|
|
customView = view() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline fun AlertBuilder<*>.okButton(noinline handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
fun AlertBuilder<*>.okButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
positiveButton(android.R.string.ok, handler) |
|
|
|
|
|
|
|
|
|
inline fun AlertBuilder<*>.cancelButton(noinline handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
fun AlertBuilder<*>.cancelButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
negativeButton(android.R.string.cancel, handler) |
|
|
|
|
|
|
|
|
|
inline fun AlertBuilder<*>.yesButton(noinline handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
fun AlertBuilder<*>.yesButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
positiveButton(R.string.yes, handler) |
|
|
|
|
|
|
|
|
|
inline fun AlertBuilder<*>.noButton(noinline handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
fun AlertBuilder<*>.noButton(handler: ((dialog: DialogInterface) -> Unit)? = null) = |
|
|
|
|
negativeButton(R.string.no, handler) |
|
|
|
|
} |
|
|
|
|