From eb1ffa0c7a1889bc2f5c0bd237a8de11a536b7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf=20Montwe=CC=81?= Date: Tue, 4 Apr 2023 17:57:51 +0200 Subject: [PATCH] Fix missing logo background and padding --- .../feature/onboarding/OnboardingContent.kt | 53 +++--- .../res/drawable/onboarding_welcome_logo.xml | 169 ++++++++++++++++++ 2 files changed, 192 insertions(+), 30 deletions(-) create mode 100644 feature/onboarding/src/main/res/drawable/onboarding_welcome_logo.xml diff --git a/feature/onboarding/src/main/kotlin/net/thunderbird/feature/onboarding/OnboardingContent.kt b/feature/onboarding/src/main/kotlin/net/thunderbird/feature/onboarding/OnboardingContent.kt index ba7c5aae9..7c56482ac 100644 --- a/feature/onboarding/src/main/kotlin/net/thunderbird/feature/onboarding/OnboardingContent.kt +++ b/feature/onboarding/src/main/kotlin/net/thunderbird/feature/onboarding/OnboardingContent.kt @@ -1,19 +1,15 @@ package net.thunderbird.feature.onboarding 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.fillMaxHeight +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.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip +import androidx.compose.ui.composed import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import app.k9mail.core.ui.compose.common.DevicePreviews @@ -34,38 +30,38 @@ internal fun OnboardingContent( onImportClick: () -> Unit, modifier: Modifier = Modifier, ) { - ResponsiveContent { - Background( - modifier = modifier, - ) { + Background( + modifier = modifier, + ) { + ResponsiveContent { LazyColumnWithFooter( - modifier = Modifier - .fillMaxHeight() - .padding(MainTheme.spacings.double), + modifier = Modifier.fillMaxSize(), footer = { WelcomeFooter( modifier = Modifier .fillMaxWidth() - .padding(top = MainTheme.spacings.triple), + .padding(top = MainTheme.spacings.quadruple), onStartClick = onStartClick, onImportClick = onImportClick, ) }, - verticalArrangement = Arrangement.spacedBy(MainTheme.sizes.large, Alignment.CenterVertically), + verticalArrangement = Arrangement.spacedBy(MainTheme.sizes.medium, Alignment.CenterVertically), ) { item { WelcomeLogo( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .defaultItemModifier() + .padding(top = MainTheme.spacings.quadruple), ) } item { WelcomeTitle( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.defaultItemModifier(), ) } item { WelcomeMessage( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.defaultItemModifier(), ) } } @@ -81,18 +77,10 @@ private fun WelcomeLogo( modifier = Modifier.then(modifier), horizontalAlignment = Alignment.CenterHorizontally, ) { - Box( - modifier = Modifier - .size(MainTheme.sizes.huge) - .clip(shape = RoundedCornerShape(percent = 50)) - .background(color = MainTheme.colors.surface), - ) { - Image( - painter = painterResource(id = MainTheme.images.logo), - contentDescription = null, - modifier = Modifier.size(MainTheme.sizes.huge), - ) - } + Image( + painter = painterResource(id = R.drawable.onboarding_welcome_logo), + contentDescription = null, + ) } } @@ -148,6 +136,11 @@ private fun WelcomeFooter( } } +private fun Modifier.defaultItemModifier() = composed { + fillMaxWidth() + .padding(MainTheme.spacings.double) +} + @Composable @DevicePreviews internal fun OnboardingContentK9Preview() { diff --git a/feature/onboarding/src/main/res/drawable/onboarding_welcome_logo.xml b/feature/onboarding/src/main/res/drawable/onboarding_welcome_logo.xml new file mode 100644 index 000000000..8d5930d51 --- /dev/null +++ b/feature/onboarding/src/main/res/drawable/onboarding_welcome_logo.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +