Skip to content

Commit

Permalink
💄 Update BTModern and use it in recap
Browse files Browse the repository at this point in the history
  • Loading branch information
jheubuch committed Dec 4, 2024
1 parent f546979 commit de56d31
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
38 changes: 22 additions & 16 deletions app/src/main/kotlin/de/hbch/traewelling/ui/wrapped/Wrapped.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,17 @@ fun WrappedTotalJourneys(
) {
val primaryColor = LocalColorScheme.current.primary
val primarySpanStyle = SpanStyle(color = primaryColor)
val btModernStyle = SpanStyle(fontFamily = BTModern)
val largeSpanStyle = SpanStyle(fontSize = AppTypography.headlineLarge.fontSize)
WrappedScaffold(
graphicsLayer = graphicsLayer,
modifier = modifier,
header = {
val annotatedString = buildAnnotatedString {
withStyle(primarySpanStyle) {
withStyle(primarySpanStyle.merge(btModernStyle)) {
append(yearInReviewData.count.toString())
append(' ')
}
append(' ')
append(stringResource(R.string.wrapped_times))
}
Text(
Expand All @@ -159,13 +160,13 @@ fun WrappedTotalJourneys(
val annotatedString = buildAnnotatedString {
appendLine(stringResource(R.string.wrapped_times_checked_in))
appendLine()
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
appendLine(getFormattedDistance(yearInReviewData.distance.total.toInt()))
}
appendLine()
appendLine(stringResource(R.string.and))
appendLine()
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
appendLine(getDurationString(yearInReviewData.duration.total.toInt()))
}
appendLine()
Expand Down Expand Up @@ -202,18 +203,19 @@ fun WrappedOperatorDistance(
val primarySpanStyle = SpanStyle(color = primaryColor)
val largeSpanStyle = SpanStyle(fontSize = AppTypography.headlineLarge.fontSize)
val centerAlignedStyle = ParagraphStyle(textAlign = TextAlign.Center)
val btModernStyle = SpanStyle(fontFamily = BTModern)

val annotatedString = buildAnnotatedString {
appendLine(stringResource(R.string.wrapped_farest_travels))
appendLine()
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
withStyle(centerAlignedStyle) {
appendLine(yearInReviewData.operators.topByDistance.operator)
}
}
appendLine()
append(stringResource(R.string.wrapped_in_a_total))
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
appendLine(" ${getFormattedDistance(yearInReviewData.operators.topByDistance.distance.toInt())}")
}
}
Expand Down Expand Up @@ -248,17 +250,18 @@ fun WrappedOperatorDuration(
val primarySpanStyle = SpanStyle(color = primaryColor)
val largeSpanStyle = SpanStyle(fontSize = AppTypography.headlineLarge.fontSize)
val centerAlignedStyle = ParagraphStyle(textAlign = TextAlign.Center)
val btModernStyle = SpanStyle(fontFamily = BTModern)

val annotatedString = buildAnnotatedString {
appendLine(stringResource(R.string.wrapped_longest_travels))
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
withStyle(centerAlignedStyle) {
append(yearInReviewData.operators.topByDuration.operator)
}
}
appendLine()
append(stringResource(R.string.wrapped_in_a_total))
withStyle(primarySpanStyle.merge(largeSpanStyle)) {
withStyle(primarySpanStyle.merge(largeSpanStyle).merge(btModernStyle)) {
appendLine(" ${getDurationString(yearInReviewData.operators.topByDuration.duration.toInt())}")
}
appendLine()
Expand Down Expand Up @@ -293,30 +296,31 @@ fun WrappedLines(
) {
val primaryColor = LocalColorScheme.current.primary
val primarySpanStyle = SpanStyle(color = primaryColor)
val btModernStyle = SpanStyle(fontFamily = BTModern)

val annotatedString = buildAnnotatedString {
appendLine(stringResource(R.string.wrapped_line_distance))
withStyle(primarySpanStyle) {
withStyle(primarySpanStyle.merge(btModernStyle)) {
append(yearInReviewData.lines.topByDistance.line)
}
append(' ')
append(stringResource(R.string.operated_by))
append(' ')
withStyle(primarySpanStyle) {
withStyle(primarySpanStyle.merge(btModernStyle)) {
append(yearInReviewData.lines.topByDistance.operator)
append(' ')
append("(${getFormattedDistance(yearInReviewData.lines.topByDistance.distance.toInt())})")
}
appendLine()
appendLine()
appendLine(stringResource(R.string.wrapped_line_duration))
withStyle(primarySpanStyle) {
withStyle(primarySpanStyle.merge(btModernStyle)) {
append(yearInReviewData.lines.topByDuration.line)
}
append(' ')
append(stringResource(R.string.operated_by))
append(' ')
withStyle(primarySpanStyle) {
withStyle(primarySpanStyle.merge(btModernStyle)) {
append(yearInReviewData.lines.topByDuration.operator)
append(' ')
append("(${getDurationString(yearInReviewData.lines.topByDuration.duration.toInt())})")
Expand Down Expand Up @@ -530,8 +534,9 @@ fun WrappedTopDestinations(
yearInReviewData.topDestinations.forEachIndexed { index, destination ->
Text(
text = "${index + 1}. ${destination.station.name} (${destination.count}x)",
style = AppTypography.titleMedium,
textAlign = TextAlign.Center
style = AppTypography.headlineMedium,
textAlign = TextAlign.Center,
fontFamily = BTModern
)
}
Spacer(Modifier)
Expand Down Expand Up @@ -571,8 +576,9 @@ fun WrappedLonelyDestinations(
yearInReviewData.lonelyStations.forEachIndexed { index, destination ->
Text(
text = "${index + 1}. ${destination.station.name} (${destination.count}x)",
style = AppTypography.titleMedium,
textAlign = TextAlign.Center
style = AppTypography.headlineMedium,
textAlign = TextAlign.Center,
fontFamily = BTModern
)
}
Spacer(Modifier)
Expand Down
Binary file modified app/src/main/res/font/ae_matrix16_btmodern_standard.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion config/libraries/ae-matrix16-btmodern-standard.ttf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "AEBahn"
}
],
"artifactVersion": "001.0000",
"artifactVersion": "1.1",
"name": "AE_Matrix16_BTModern",
"licenses": [
"SIL Open Font License"
Expand Down

0 comments on commit de56d31

Please sign in to comment.