mirror of https://git.sr.ht/~oppen/ariane
22 lines
542 B
Kotlin
22 lines
542 B
Kotlin
package oppen
|
|
|
|
import android.app.AlertDialog
|
|
import android.content.Context
|
|
import android.view.View
|
|
|
|
fun String.alert(context: Context){
|
|
AlertDialog.Builder(context)
|
|
.setMessage(this)
|
|
.setPositiveButton("OK"){_, _ ->}
|
|
.show()
|
|
}
|
|
|
|
fun View.visible(visible: Boolean) = when {
|
|
visible -> this.visibility = View.VISIBLE
|
|
else -> this.visibility = View.GONE
|
|
}
|
|
|
|
fun View.visibleRetainingSpace(visible: Boolean) = when {
|
|
visible -> this.visibility = View.VISIBLE
|
|
else -> this.visibility = View.INVISIBLE
|
|
} |