Skip to content

Commit

Permalink
Small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tonidero committed Oct 17, 2023
1 parent 9e967ba commit a455cbb
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ internal class PaywallActivity : ComponentActivity(), PaywallListener {
}

private fun getFontProvider(): FontProvider? {
return getArgs()?.fonts?.let { fonts ->
val fontsMap = fonts.mapValues { entry ->
entry.value?.let { fontRes ->
ResourcesCompat.getFont(this, fontRes)?.let { FontFamily(it) }
}
val fontsMap = getArgs()?.fonts?.mapValues { entry ->
entry.value?.let { fontRes ->
ResourcesCompat.getFont(this, fontRes)?.let { FontFamily(it) }
}
object : FontProvider {
override fun getFont(type: TypographyType): FontFamily? {
return fontsMap[type]
}
} ?: return null
return object : FontProvider {
override fun getFont(type: TypographyType): FontFamily? {
return fontsMap[type]
}
}
}
Expand Down

0 comments on commit a455cbb

Please sign in to comment.