add an extension for View.INVISIBLE
This commit is contained in:
parent
2bf5ff0487
commit
c738abcf56
1 changed files with 5 additions and 1 deletions
|
@ -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 }
|
||||
|
|
Loading…
Reference in a new issue