mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 13:48:52 +01:00
Revert "Allow null typeface to be passed in FontProvider callback"
This reverts commit f1ac0c002d.
This commit is contained in:
@@ -31,7 +31,7 @@ class FontProvider @Inject constructor(context: Context) {
|
|||||||
|
|
||||||
private var lato: Typeface? = null
|
private var lato: Typeface? = null
|
||||||
|
|
||||||
private val pendingCallbacks = ArrayList<(Typeface?) -> Unit>()
|
private val pendingCallbacks = ArrayList<(Typeface) -> Unit>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
ResourcesCompat.getFont(context, R.font.lato, object : ResourcesCompat.FontCallback() {
|
ResourcesCompat.getFont(context, R.font.lato, object : ResourcesCompat.FontCallback() {
|
||||||
@@ -48,11 +48,11 @@ class FontProvider @Inject constructor(context: Context) {
|
|||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLato(callback: (Typeface?) -> Unit) {
|
fun getLato(callback: (Typeface) -> Unit) {
|
||||||
lato?.run(callback)
|
lato?.run(callback)
|
||||||
|
|
||||||
if (lato == null) {
|
if (lato == null) {
|
||||||
pendingCallbacks.add(callback)
|
pendingCallbacks += callback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user