mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Add chevron to pending participants view.
This commit is contained in:
committed by
Cody Henthorne
parent
636b5a4ba6
commit
d1475228f7
@@ -22,7 +22,8 @@ object SignalSymbols {
|
||||
}
|
||||
|
||||
enum class Weight {
|
||||
BOLD
|
||||
BOLD,
|
||||
REGULAR
|
||||
}
|
||||
|
||||
private val cache = mutableMapOf<Weight, Typeface>()
|
||||
@@ -45,6 +46,7 @@ object SignalSymbols {
|
||||
private fun getTypeface(context: Context, weight: Weight): Typeface {
|
||||
return when (weight) {
|
||||
Weight.BOLD -> getBoldWeightedFont(context)
|
||||
Weight.REGULAR -> getRegularWeightedFont(context)
|
||||
else -> error("Unsupported weight: $weight")
|
||||
}
|
||||
}
|
||||
@@ -60,6 +62,17 @@ object SignalSymbols {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRegularWeightedFont(context: Context): Typeface {
|
||||
return cache.getOrPut(
|
||||
Weight.REGULAR
|
||||
) {
|
||||
Typeface.createFromAsset(
|
||||
context.assets,
|
||||
"fonts/SignalSymbols-Regular.otf"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom TypefaceSpan to support TypefaceSpan in API<28
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user