Skip to content

Commit

Permalink
fix(core/ui): fallback typeface
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunk committed Oct 7, 2024
1 parent fe8b5ab commit 8b11ce2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b11ce2

Please sign in to comment.