Commit fca96c4f authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add extension function.

parent b56dbfda
package chat.rocket.android.util
import android.support.annotation.LayoutRes
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
fun String.ifEmpty(value: String): String {
......@@ -18,6 +21,10 @@ fun View.setVisibility(value: Boolean) {
}
}
fun ViewGroup.inflate(@LayoutRes resource: Int): View {
return LayoutInflater.from(context).inflate(resource, this, false)
}
var TextView.textContent: String
get() = text.toString()
set(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