Commit 8aa0ad32 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add functions.

parent e8ce6610
package chat.rocket.android.util package chat.rocket.android.util
import android.view.View
import android.widget.TextView import android.widget.TextView
fun String.ifEmpty(value: String): String { fun String.ifEmpty(value: String): String {
...@@ -9,6 +10,22 @@ fun String.ifEmpty(value: String): String { ...@@ -9,6 +10,22 @@ fun String.ifEmpty(value: String): String {
return this return this
} }
var TextView.content: String fun View.setVisibility(value: Boolean) {
if (value) {
this.visibility = View.VISIBLE
} else {
this.visibility = View.GONE
}
}
var TextView.textContent: String
get() = this.text.toString() get() = this.text.toString()
set(value) { this.text = value } set(value) {
\ No newline at end of file this.text = value
}
var TextView.hintContent: String
get() = this.hint.toString()
set(value) {
this.text = value
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment