commit 8b11ce27832d4a309dcc865fce7c1beff5d7790b
parent fe8b5ab289502dda43b3f3e2517485add083909b
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Mon, 7 Oct 2024 16:31:42 +0200
fix(core/ui): fallback typeface
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/UserInterface.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/UserInterface.kt
@@ -19,7 +19,7 @@ class UserInterface(
val actionSheetBackground get() = if (context.androidContext.isDarkTheme()) 0xff1e1e1e.toInt() else 0xffffffff.toInt()
val avenirNextTypeface: Typeface by lazy {
- fontMap[600]?.let { context.resources.getFont(it) } ?: throw IllegalStateException("Avenir Next not loaded")
+ fontMap[600]?.let { context.resources.getFont(it) } ?: Typeface.MONOSPACE
}
fun dpToPx(dp: Int): Int {
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/menu/impl/ChatActionMenu.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/menu/impl/ChatActionMenu.kt
@@ -101,7 +101,7 @@ class ChatActionMenu : AbstractMenu() {
this@ChatActionMenu.context.userInterface.apply {
background = createRoundedBackground(actionSheetBackground, 16F, true)
setTextColor(colorPrimary)
- typeface = resources.getFont(getFontResource(600) ?: throw IllegalStateException("Avenir Next not loaded"))
+ typeface = this@ChatActionMenu.context.userInterface.avenirNextTypeface
}
isAllCaps = false
setShadowLayer(0F, 0F, 0F, 0)