mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
#1013 - Add option to use system font
This commit is contained in:
@@ -73,7 +73,6 @@ class QkEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet
|
||||
init {
|
||||
if (!isInEditMode) {
|
||||
appComponent.inject(this)
|
||||
fontProvider.getLato { setTypeface(it, typeface?.style ?: Typeface.NORMAL) }
|
||||
|
||||
context.obtainStyledAttributes(attrs, R.styleable.QkEditText)?.run {
|
||||
val colorAttr = getInt(R.styleable.QkEditText_textColor, -1)
|
||||
@@ -118,6 +117,10 @@ class QkEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet
|
||||
super.onAttachedToWindow()
|
||||
if (isInEditMode) return
|
||||
|
||||
fontProvider.typeface
|
||||
.autoDisposable(scope())
|
||||
.subscribe { setTypeface(it.value, typeface?.style ?: Typeface.NORMAL) }
|
||||
|
||||
textColorObservable
|
||||
?.autoDisposable(scope())
|
||||
?.subscribe { color -> setTextColor(color) }
|
||||
|
||||
Reference in New Issue
Block a user