core-ktx / androidx.view / android.view.View / isVisible

isVisible

inline var View.isVisible: Boolean

Returns true when this view's visibility is View.VISIBLE, false otherwise.

if (view.isVisible) {
    // Behavior...
}

Setting this property to true sets the visibility to View.VISIBLE, false to View.GONE.

view.isVisible = true