Implement new top-level backups settings.

This commit is contained in:
Alex Hart
2024-09-27 11:04:57 -03:00
committed by GitHub
parent ea33fa2af1
commit 5bdc7c2740
25 changed files with 870 additions and 618 deletions

View File

@@ -10,6 +10,12 @@ import android.graphics.Typeface
import android.text.SpannableStringBuilder
import android.text.TextPaint
import android.text.style.MetricAffectingSpan
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.withStyle
/**
* Helper object for working with the SignalSymbols font
@@ -17,6 +23,7 @@ import android.text.style.MetricAffectingSpan
object SignalSymbols {
enum class Glyph(val unicode: Char) {
CHECKMARK('\u2713'),
CHEVRON_RIGHT('\uE025'),
PERSON_CIRCLE('\uE05E')
}
@@ -43,6 +50,17 @@ object SignalSymbols {
return text
}
@Composable
fun AnnotatedString.Builder.SignalSymbol(weight: Weight, glyph: Glyph) {
withStyle(
SpanStyle(
fontFamily = FontFamily(getTypeface(LocalContext.current, weight))
)
) {
append(glyph.unicode.toString())
}
}
private fun getTypeface(context: Context, weight: Weight): Typeface {
return when (weight) {
Weight.BOLD -> getBoldWeightedFont(context)