Skip to content

Commit f8a1689

Browse files
dadachiclaude
andauthored
Group sparkle and welcome text on the onboarding screen (#49)
The previous layout left the AutoAwesome icon stretched across the upper region (fillMaxSize, bottom-padded 192dp) and pinned the welcome text to BottomCenter, producing a large empty gap on tall phones -- substrate review flagged this as a "broken layout" with the title "jammed at the very bottom of the screen". Restructure to a Column with weighted spacers and a fixed 220dp sparkle so icon and title sit together in the upper-middle, mirroring the iOS welcome composition. Mirrors NativeAppTemplate-Android#63. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8f80cd8 commit f8a1689

1 file changed

Lines changed: 22 additions & 28 deletions

File tree

  • app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/app_root

app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/app_root/OnboardingView.kt

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ package com.nativeapptemplate.nativeapptemplatefree.ui.app_root
22

33
import android.content.Intent
44
import android.net.Uri
5-
import androidx.compose.foundation.background
6-
import androidx.compose.foundation.layout.Box
5+
import androidx.compose.foundation.layout.Arrangement
6+
import androidx.compose.foundation.layout.Column
7+
import androidx.compose.foundation.layout.Spacer
78
import androidx.compose.foundation.layout.fillMaxSize
89
import androidx.compose.foundation.layout.fillMaxWidth
10+
import androidx.compose.foundation.layout.height
911
import androidx.compose.foundation.layout.padding
12+
import androidx.compose.foundation.layout.size
1013
import androidx.compose.material.icons.Icons
1114
import androidx.compose.material.icons.filled.AutoAwesome
1215
import androidx.compose.material3.CenterAlignedTopAppBar
@@ -39,41 +42,32 @@ internal fun OnboardingView(
3942
topBar = { TopAppBar(onStartClick) },
4043
modifier = Modifier.fillMaxSize(),
4144
) { padding ->
42-
Box(
45+
Column(
4346
modifier = Modifier
4447
.fillMaxSize()
4548
.padding(padding)
46-
.padding(12.dp)
47-
.padding(top = 12.dp),
49+
.padding(horizontal = 24.dp),
50+
horizontalAlignment = Alignment.CenterHorizontally,
51+
verticalArrangement = Arrangement.Center,
4852
) {
53+
Spacer(Modifier.weight(1f))
4954
Icon(
5055
imageVector = Icons.Filled.AutoAwesome,
5156
contentDescription = null,
5257
tint = Color.White,
53-
modifier = Modifier
54-
.align(Alignment.TopCenter)
55-
.fillMaxSize()
56-
.padding(bottom = 192.dp),
58+
modifier = Modifier.size(220.dp),
5759
)
58-
Box(
59-
modifier = Modifier
60-
.align(Alignment.BottomCenter)
61-
.fillMaxWidth()
62-
.background(MaterialTheme.colorScheme.background),
63-
) {
64-
Text(
65-
text = stringResource(R.string.welcome_to_app, stringResource(R.string.app_name)),
66-
color = MaterialTheme.colorScheme.onBackground,
67-
fontSize = 34.sp.nonScaledSp,
68-
lineHeight = 41.sp.nonScaledSp,
69-
fontWeight = FontWeight.Bold,
70-
textAlign = TextAlign.Center,
71-
modifier = Modifier
72-
.align(Alignment.TopCenter)
73-
.fillMaxWidth()
74-
.padding(16.dp),
75-
)
76-
}
60+
Spacer(Modifier.height(24.dp))
61+
Text(
62+
text = stringResource(R.string.welcome_to_app, stringResource(R.string.app_name)),
63+
color = MaterialTheme.colorScheme.onBackground,
64+
fontSize = 34.sp.nonScaledSp,
65+
lineHeight = 41.sp.nonScaledSp,
66+
fontWeight = FontWeight.Bold,
67+
textAlign = TextAlign.Center,
68+
modifier = Modifier.fillMaxWidth(),
69+
)
70+
Spacer(Modifier.weight(1f))
7771
}
7872
}
7973
}

0 commit comments

Comments
 (0)