Created
January 1, 2019 20:09
-
-
Save piotrmadry/5a6b864b1b14411237a52a72cddcf8fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun TextView.textViewDelegate() : ReadWriteProperty<Any, String> = object : ReadWriteProperty<Any, String> { | |
override fun getValue(thisRef: Any, property: KProperty<*>): String = text.toString() | |
override fun setValue(thisRef: Any, property: KProperty<*>, value: String) { | |
text = value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment