From ed91b8e213e204b4d9a4c1696b9b3672fa763f22 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 18 Jan 2024 13:15:56 +0100 Subject: [PATCH] Use `MainTheme.images.logo` in welcome screen --- .../onboarding/welcome/ui/WelcomeContent.kt | 31 +++- .../res/drawable/onboarding_welcome_logo.xml | 169 ------------------ 2 files changed, 26 insertions(+), 174 deletions(-) delete mode 100644 feature/onboarding/welcome/src/main/res/drawable/onboarding_welcome_logo.xml diff --git a/feature/onboarding/welcome/src/main/kotlin/app/k9mail/feature/onboarding/welcome/ui/WelcomeContent.kt b/feature/onboarding/welcome/src/main/kotlin/app/k9mail/feature/onboarding/welcome/ui/WelcomeContent.kt index 30aeb177e..81ea32599 100644 --- a/feature/onboarding/welcome/src/main/kotlin/app/k9mail/feature/onboarding/welcome/ui/WelcomeContent.kt +++ b/feature/onboarding/welcome/src/main/kotlin/app/k9mail/feature/onboarding/welcome/ui/WelcomeContent.kt @@ -1,17 +1,24 @@ package app.k9mail.feature.onboarding.welcome.ui import androidx.compose.foundation.Image +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.composed +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp import app.k9mail.core.ui.compose.common.annotation.PreviewDevices import app.k9mail.core.ui.compose.designsystem.atom.Background import app.k9mail.core.ui.compose.designsystem.atom.button.Button @@ -25,6 +32,10 @@ import app.k9mail.core.ui.compose.theme.MainTheme import app.k9mail.core.ui.compose.theme.ThunderbirdTheme import app.k9mail.feature.onboarding.welcome.R +private const val CIRCLE_COLOR = 0xFFEEEEEE +private const val CIRCLE_SIZE_DP = 300 +private const val LOGO_SIZE_DP = 200 + @Composable internal fun WelcomeContent( onStartClick: () -> Unit, @@ -75,13 +86,23 @@ private fun WelcomeLogo( modifier: Modifier = Modifier, ) { Column( - modifier = Modifier.then(modifier), + modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally, ) { - Image( - painter = painterResource(id = R.drawable.onboarding_welcome_logo), - contentDescription = null, - ) + Box( + modifier = Modifier + .clip(CircleShape) + .background(Color(CIRCLE_COLOR)) + .size(CIRCLE_SIZE_DP.dp), + ) { + Image( + painter = painterResource(id = MainTheme.images.logo), + contentDescription = null, + modifier = Modifier + .size(LOGO_SIZE_DP.dp) + .align(Alignment.Center), + ) + } } } diff --git a/feature/onboarding/welcome/src/main/res/drawable/onboarding_welcome_logo.xml b/feature/onboarding/welcome/src/main/res/drawable/onboarding_welcome_logo.xml deleted file mode 100644 index 1e2a8735f..000000000 --- a/feature/onboarding/welcome/src/main/res/drawable/onboarding_welcome_logo.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -