I’m trying to replace our custom setGone()
method with the Android KTX version. When I use this, it just deletes the line and adds an import.
@Deprecated("Use Android KTX - `.isGone = true`", ReplaceWith("this.isGone = true", "androidx.core.view.isGone"))
fun View.setGone() {
visibility = View.GONE
}
The isGone
is defined as follows in KTX -
inline var View.isGone: Boolean
get() = visibility == View.GONE
set(value) {
visibility = if (value) View.GONE else View.VISIBLE
}
Any suggestions on how to make this work?