i've always found those extensions incredibly help...
# android
s
Nice android core project. Thanks!!!
m
Having
resId
on any single String, or
html
or any
Int
type doesn’t sound good to me….
r
I’m lazy, so I made these, for whatever they’re worth:```fun View.show() { if (visibility != VISIBLE) { visibility = VISIBLE } } fun View.hide(gone: Boolean = true) { when (visibility) { VISIBLE -> visibility = if (gone) GONE else INVISIBLE INVISIBLE -> if (gone) visibility = GONE GONE -> if (!gone) visibility = INVISIBLE } }```
s
i have added these
Copy code
fun View.invisible() {
	if (visibility != INVISIBLE) {
		visibility = INVISIBLE
	}
}

fun View.gone() {
	if (visibility != GONE) {
		visibility = GONE
	}
}
g
majority of these extensions is in anko or ktx libraries. I'd rather trust their code and copy from there.
3