Twidere-App-Android-Twitter.../twidere/src/main/kotlin/org/mariotaku/ktextension/TextViewExtensions.kt

13 lines
311 B
Kotlin
Raw Normal View History

2016-06-29 15:47:52 +02:00
package org.mariotaku.ktextension
import android.graphics.Typeface
2016-06-29 15:47:52 +02:00
import android.widget.TextView
val TextView.empty: Boolean
get() = length() <= 0
fun TextView.applyFontFamily(lightFont: Boolean) {
if (lightFont) {
2017-01-28 08:32:28 +01:00
typeface = Typeface.create("sans-serif-light", typeface?.style ?: 0)
}
}