import android.view.View var View.isVisible: Boolean get() = visibility == View.VISIBLE set(value) { visibility = if (value) { View.VISIBLE } else { View.GONE } } fun View.invisible() { visibility = View.INVISIBLE } fun View.visible() { visibility = View.VISIBLE } fun View.gone() { visibility = View.GONE }