From 444c0c8e49c0b959f6c503bd0f5660b93ec7d6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigvald=20H=C3=B8yheim?= Date: Tue, 22 Oct 2024 10:24:56 +0200 Subject: [PATCH] design tweak --- .../ui/dashboard/DashboardScreen.kt | 106 +++++++++++++----- .../src/main/res/drawable/ic_logo.xml | 8 +- .../src/main/res/values-nb/strings.xml | 1 + .../src/main/res/values-nn/strings.xml | 1 + .../src/main/res/values-no/strings.xml | 1 + .../src/main/res/values/strings.xml | 1 + 6 files changed, 85 insertions(+), 33 deletions(-) diff --git a/dashboard-feature/src/main/java/eu/europa/ec/dashboardfeature/ui/dashboard/DashboardScreen.kt b/dashboard-feature/src/main/java/eu/europa/ec/dashboardfeature/ui/dashboard/DashboardScreen.kt index f15eb45b..f7487d4d 100644 --- a/dashboard-feature/src/main/java/eu/europa/ec/dashboardfeature/ui/dashboard/DashboardScreen.kt +++ b/dashboard-feature/src/main/java/eu/europa/ec/dashboardfeature/ui/dashboard/DashboardScreen.kt @@ -28,6 +28,7 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.calculateEndPadding import androidx.compose.foundation.layout.calculateStartPadding +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -75,6 +76,7 @@ import eu.europa.ec.resourceslogic.theme.values.textPrimaryDark import eu.europa.ec.resourceslogic.theme.values.textSecondaryDark import eu.europa.ec.resourceslogic.theme.values.warning import eu.europa.ec.uilogic.component.AppIcons +import eu.europa.ec.uilogic.component.IconData import eu.europa.ec.uilogic.component.ModalOptionUi import eu.europa.ec.uilogic.component.ScalableText import eu.europa.ec.uilogic.component.UserImageOrPlaceholder @@ -514,7 +516,7 @@ private fun Title( ) .padding( PaddingValues( - top = SPACING_EXTRA_LARGE.dp, + top = SPACING_LARGE.dp, bottom = SPACING_EXTRA_LARGE.dp, start = paddingValues.calculateStartPadding(LayoutDirection.Ltr), end = paddingValues.calculateEndPadding(LayoutDirection.Ltr) @@ -522,43 +524,89 @@ private fun Title( ), contentAlignment = Alignment.Center ) { + Row( modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Start - ) { - UserImageOrPlaceholder( - userBase64Image = userBase64Image, - modifier = Modifier - .size(64.dp) - .clip(RoundedCornerShape(SIZE_SMALL.dp)) - ) + ){ Column( modifier = Modifier - .weight(1f) - .padding(start = SPACING_MEDIUM.dp), - horizontalAlignment = Alignment.Start + .fillMaxWidth() ) { - Text( - text = message, - style = MaterialTheme.typography.bodyMedium, - color = Color.Black - ) - Text( - text = userFirstName, - style = MaterialTheme.typography.headlineSmall, - color = Color.Black - ) - } + Row( + modifier = Modifier.fillMaxWidth().padding(bottom = SPACING_SMALL.dp), + verticalAlignment = Alignment.Top, + horizontalArrangement = Arrangement.Start + ) { + WrapIcon( + iconData = AppIcons.Logo, + contentAlpha = ALPHA_ENABLED, + customTint = MaterialTheme.colorScheme.primary, + modifier = Modifier + .size(36.dp) + ) + Column( + modifier = Modifier + .height(36.dp) + .padding(start = SPACING_EXTRA_SMALL.dp), + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Center + ) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Text( + text = stringResource(id = R.string.dashboard_title_before_badge), + style = MaterialTheme.typography.titleLarge, + color = Color.Black + ) + } + } + } + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.Bottom, + horizontalArrangement = Arrangement.Start + ) { + UserImageOrPlaceholder( + userBase64Image = userBase64Image, + modifier = Modifier + .size(64.dp) + .clip(RoundedCornerShape(SIZE_SMALL.dp)) + ) + Column( + modifier = Modifier + .weight(1f) + .padding(start = SPACING_MEDIUM.dp) + .height(64.dp), + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Center + ) { + Text( + text = message, + style = MaterialTheme.typography.bodyMedium, + color = Color.Black + ) + Text( + text = userFirstName, + style = MaterialTheme.typography.headlineSmall, + color = Color.Black + ) + } - WrapIconButton( - iconData = AppIcons.VerticalMore, - customTint = MaterialTheme.colorScheme.primary, - enabled = allowUserInteraction, - onClick = { - onEventSend(Event.OptionsPressed) + WrapIconButton( + iconData = AppIcons.VerticalMore, + customTint = MaterialTheme.colorScheme.primary, + enabled = allowUserInteraction, + onClick = { + onEventSend(Event.OptionsPressed) + } + ) } - ) + } } } } diff --git a/resources-logic/src/main/res/drawable/ic_logo.xml b/resources-logic/src/main/res/drawable/ic_logo.xml index 4e163367..53ac0451 100644 --- a/resources-logic/src/main/res/drawable/ic_logo.xml +++ b/resources-logic/src/main/res/drawable/ic_logo.xml @@ -19,10 +19,10 @@ android:height="160dp" android:viewportWidth="160" android:viewportHeight="160"> - + diff --git a/resources-logic/src/main/res/values-nb/strings.xml b/resources-logic/src/main/res/values-nb/strings.xml index 93b9f8ff..b13c0773 100644 --- a/resources-logic/src/main/res/values-nb/strings.xml +++ b/resources-logic/src/main/res/values-nb/strings.xml @@ -152,6 +152,7 @@ LES FAQ + Setlaboki Velkommen tilbake Gyldig til Utgått\ diff --git a/resources-logic/src/main/res/values-nn/strings.xml b/resources-logic/src/main/res/values-nn/strings.xml index c252e13e..67111037 100644 --- a/resources-logic/src/main/res/values-nn/strings.xml +++ b/resources-logic/src/main/res/values-nn/strings.xml @@ -152,6 +152,7 @@ LES FAQ + Setlaboki Velkommen tilbake Gyldig til Utgått\ diff --git a/resources-logic/src/main/res/values-no/strings.xml b/resources-logic/src/main/res/values-no/strings.xml index bbcfce38..de208643 100644 --- a/resources-logic/src/main/res/values-no/strings.xml +++ b/resources-logic/src/main/res/values-no/strings.xml @@ -152,6 +152,7 @@ LES FAQ + Setlaboki Velkommen tilbake Gyldig til Utgått\ diff --git a/resources-logic/src/main/res/values/strings.xml b/resources-logic/src/main/res/values/strings.xml index 6315b7c9..b225f8ab 100644 --- a/resources-logic/src/main/res/values/strings.xml +++ b/resources-logic/src/main/res/values/strings.xml @@ -153,6 +153,7 @@ READ FAQs + Setlaboki Welcome back Valid until Expired\