add an extension for View.INVISIBLE

This commit is contained in:
tibbi 2017-02-05 10:40:22 +01:00
parent 2bf5ff0487
commit c738abcf56

View file

@ -2,10 +2,14 @@ package com.simplemobiletools.commons.extensions
import android.view.View
fun View.beVisibleIf(beVisible: Boolean) = if (beVisible) visibility = View.VISIBLE else visibility = View.GONE
fun View.beInvisibleIf(beInvisible: Boolean) = if (beInvisible) beInvisible() else beVisible()
fun View.beVisibleIf(beVisible: Boolean) = if (beVisible) beVisible() else beGone()
fun View.beGoneIf(beGone: Boolean) = if (beGone) beGone() else beVisible()
fun View.beInvisible() = { visibility = View.INVISIBLE }
fun View.beVisible() = { visibility = View.VISIBLE }
fun View.beGone() = { visibility = View.GONE }