library / org.akop.kotx.ext.view / android.widget.TextView

Extensions for android.widget.TextView

bottomDrawable

var TextView.bottomDrawable: Drawable?

Sets bottom drawable with intrinsic bounds, clearing left, right and top in the process.

collapseIfEmpty

fun TextView.collapseIfEmpty(): Unit

Sets receiver's visibility to View.GONE if TextView.getText is null or empty; sets it to View.VISIBLE otherwise.

hideIfEmpty

fun TextView.hideIfEmpty(): Unit

Sets receiver's visibility to View.INVISIBLE if TextView.getText is null or empty; sets it to View.VISIBLE otherwise.

leftDrawable

var TextView.leftDrawable: Drawable?

Sets left drawable with intrinsic bounds, clearing right, top and bottom in the process.

rightDrawable

var TextView.rightDrawable: Drawable?

Sets right drawable with intrinsic bounds, clearing left, top and bottom in the process.

textString

val TextView.textString: String?

Returns string value of TextView.getText.

topDrawable

var TextView.topDrawable: Drawable?

Sets top drawable with intrinsic bounds, clearing left, right and bottom in the process.