Skip to content

Instantly share code, notes, and snippets.

View slavonnet's full-sized avatar

Vyacheslav slavonnet

View GitHub Profile
data class BIf(val res: Boolean, val u: Any)
infix fun BIf.`ee` ( u: Any) = if (!this.res) u else this.u
infix fun Boolean.`ii` ( u: Any) = BIf( this@ii, u)
fun test (): Any {
return true ii "aaa" ee "vccc"
}
@slavonnet
slavonnet / InlineExt.kt
Last active December 28, 2021 13:34
Delegate for auto detect ViewBinding and Binding
// Helpers and utils
internal inline var View.isVisibleEx: Boolean
get() = isVisible
set(value) {
if (value != isVisible) isVisible = value
}
internal inline var View.isEnabledEx: Boolean