From 1b8bebc8e298d193b9935c31507c1ae4904c2bd7 Mon Sep 17 00:00:00 2001 From: DavidAparicioAlbaAsenjo <137989685+DavidAparicioAlbaAsenjo@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:04:18 +0100 Subject: [PATCH] ANDROAPP-5714-Font-weight-of-accordian-title (#147) * update: [ANDROAPP-5714] section title font weight modified * update: [ANDROAPP-5714] title font weight updated * update: [ANDROAPP-5714] typography changed * update: [ANDROAPP-5714] code formatted * update: [ANDROAPP-5714] styles modified --- .../common/screens/LegendDescriptionScreen.kt | 3 +-- .../hisp/dhis/common/screens/LegendScreen.kt | 3 +-- .../screens/previews/LegendSampleList.kt | 11 +++++------ .../ui/designsystem/component/InputShell.kt | 2 +- .../ui/designsystem/component/ListCard.kt | 2 +- .../designsystem/component/SupportingText.kt | 2 +- .../ui/designsystem/theme/SurfaceColor.kt | 5 +++-- .../mobile/ui/designsystem/theme/TextColor.kt | 4 ++-- .../dhis/mobile/ui/designsystem/theme/Theme.kt | 18 ++++++++++-------- .../ui/designsystem/component/ListCardTest.kt | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendDescriptionScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendDescriptionScreen.kt index 79c627d12..f01138ede 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendDescriptionScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendDescriptionScreen.kt @@ -10,7 +10,6 @@ import org.hisp.dhis.mobile.ui.designsystem.component.LegendRange import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor -import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor @Composable fun LegendDescriptionScreen() { @@ -44,7 +43,7 @@ fun LegendDescriptionScreen() { IntRange(0, 5), ), LegendDescriptionData(SurfaceColor.CustomYellow, "Medium", IntRange(5, 10)), - LegendDescriptionData(TextColor.OnWarning, "High", IntRange(10, 20)), + LegendDescriptionData(SurfaceColor.Warning, "High", IntRange(10, 20)), LegendDescriptionData(SurfaceColor.CustomPink, "Very high", IntRange(20, 40)), LegendDescriptionData(SurfaceColor.CustomBrown, "Extreme", IntRange(40, 120)), LegendDescriptionData( diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendScreen.kt index 885088309..149d31bf0 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/LegendScreen.kt @@ -11,7 +11,6 @@ import org.hisp.dhis.mobile.ui.designsystem.component.LegendDescriptionData import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor -import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor @Composable fun LegendScreen() { @@ -21,7 +20,7 @@ fun LegendScreen() { Spacer(Modifier.size(Spacing.Spacing18)) SubTitle("Orange Legend") - Legend(LegendData(TextColor.OnWarning, "Legend")) + Legend(LegendData(SurfaceColor.Warning, "Legend")) Spacer(Modifier.size(Spacing.Spacing18)) SubTitle("Pink Legend") diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/previews/LegendSampleList.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/previews/LegendSampleList.kt index 4cf3bd154..8cb321507 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/previews/LegendSampleList.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/previews/LegendSampleList.kt @@ -2,7 +2,6 @@ package org.hisp.dhis.common.screens.previews import org.hisp.dhis.mobile.ui.designsystem.component.LegendDescriptionData import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor -import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor val regularLegendList = listOf( LegendDescriptionData( @@ -16,7 +15,7 @@ val regularLegendList = listOf( IntRange(5, 10), ), LegendDescriptionData( - TextColor.OnWarning, + SurfaceColor.Warning, "High", IntRange(10, 20), ), @@ -49,7 +48,7 @@ val longLegendList = listOf( IntRange(5, 10), ), LegendDescriptionData( - TextColor.OnWarning, + SurfaceColor.Warning, "High", IntRange(10, 20), ), @@ -79,7 +78,7 @@ val longLegendList = listOf( IntRange(5, 10), ), LegendDescriptionData( - TextColor.OnWarning, + SurfaceColor.Warning, "High", IntRange(10, 20), ), @@ -109,7 +108,7 @@ val longLegendList = listOf( IntRange(5, 10), ), LegendDescriptionData( - TextColor.OnWarning, + SurfaceColor.Warning, "High", IntRange(10, 20), ), @@ -139,7 +138,7 @@ val longLegendList = listOf( IntRange(5, 10), ), LegendDescriptionData( - TextColor.OnWarning, + SurfaceColor.Warning, "High", IntRange(10, 20), ), diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputShell.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputShell.kt index 93252fe5f..8ae1053d1 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputShell.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/InputShell.kt @@ -214,5 +214,5 @@ enum class InputShellState(val color: Color) { UNFOCUSED(TextColor.OnSurfaceVariant), ERROR(SurfaceColor.Error), DISABLED(TextColor.OnDisabledSurface), - WARNING(TextColor.OnWarning), + WARNING(SurfaceColor.Warning), } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt index 32dedb118..a02de65d0 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCard.kt @@ -504,7 +504,7 @@ enum class AdditionalInfoItemColor(val color: Color) { DEFAULT_KEY(TextColor.OnSurfaceLight), DEFAULT_VALUE(TextColor.OnSurface), ERROR(SurfaceColor.Error), - WARNING(TextColor.OnWarning), + WARNING(SurfaceColor.Warning), DISABLED(TextColor.OnDisabledSurface), SUCCESS(SurfaceColor.CustomGreen), } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/SupportingText.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/SupportingText.kt index ed407e27d..cb7866c3e 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/SupportingText.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/SupportingText.kt @@ -160,7 +160,7 @@ fun SupportingText( enum class SupportingTextState(val color: Color) { DEFAULT(TextColor.OnSurfaceVariant), - WARNING(TextColor.OnWarning), + WARNING(SurfaceColor.Warning), ERROR(SurfaceColor.Error), } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/SurfaceColor.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/SurfaceColor.kt index 949d596ca..785fc2ec7 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/SurfaceColor.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/SurfaceColor.kt @@ -3,13 +3,14 @@ package org.hisp.dhis.mobile.ui.designsystem.theme object SurfaceColor { val Primary = Color.Blue500 val Error = Color.Red600 + val Warning = Color.Orange800 val PrimaryContainer = Color.Blue50 val Surface = Color.NeutralVariant val SurfaceBright = Color.NeutralWhite - val SurfaceDim = Color.Ash500 + val SurfaceDim = Color.Ash400 val DisabledSurface = Color.Ash300 val DisabledSurfaceBright = Color.Ash200 - val ErrorContainer = Color.Red200 + val ErrorContainer = Color.Red100 val WarningContainer = Color.Orange50 val ContainerLowest = Color.NeutralWhite val ContainerLow = Color.Blue50 diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/TextColor.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/TextColor.kt index 9244bf5db..4d9c6de87 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/TextColor.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/TextColor.kt @@ -7,8 +7,8 @@ object TextColor { val OnSurfaceVariant = Color.Charcoal500 val OnSurfaceLight = Color.Charcoal300 val OnError = Color.NeutralWhite - val OnErrorContainer = Color.Red900 + val OnErrorContainer = Color.Red700 val OnDisabledSurface = Color.Ash800 - val OnWarning = Color.Orange800 + val OnWarning = Color.NeutralWhite val OnWarningContainer = Color.Orange900 } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/Theme.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/Theme.kt index 60f9d81c3..abda8ae29 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/Theme.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/theme/Theme.kt @@ -58,7 +58,7 @@ fun DHIS2Theme(content: @Composable () -> Unit) { color = TextColor.OnSurface, ), titleLarge = TextStyle( - fontSize = 22.sp, + fontSize = 20.sp, lineHeight = 28.sp, fontFamily = provideFontResource(), fontWeight = FontWeight.Medium, @@ -137,19 +137,21 @@ fun DHIS2Theme(content: @Composable () -> Unit) { internal object DHIS2SCustomTextStyles { - val titleBold = TextStyle( + val titleMediumBold = TextStyle( fontSize = 16.sp, lineHeight = 24.sp, - fontWeight = FontWeight.Medium, + fontWeight = FontWeight.Bold, color = TextColor.OnSurface, letterSpacing = 0.15.sp, ) - val bodyLargeBold - @Composable - get() = MaterialTheme.typography.bodyLarge.copy( - fontWeight = FontWeight.Bold, - ) + val bodyLargeBold = TextStyle( + fontSize = 16.sp, + lineHeight = 24.sp, + fontWeight = FontWeight.Bold, + color = TextColor.OnSurface, + letterSpacing = 0.5.sp, + ) val clickableSupportingText = SpanStyle( fontSize = 14.sp, diff --git a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCardTest.kt b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCardTest.kt index 8b624323f..a3f482445 100644 --- a/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCardTest.kt +++ b/designsystem/src/desktopTest/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/ListCardTest.kt @@ -48,11 +48,11 @@ class ListCardTest { Icon( imageVector = Icons.Outlined.SyncProblem, contentDescription = "Icon Button", - tint = TextColor.OnWarning, + tint = SurfaceColor.Warning, ) }, value = "Sync warning", - color = TextColor.OnWarning, + color = SurfaceColor.Warning, isConstantItem = true, ), AdditionalInfoItem(