Skip to content

Commit 40aa7e6

Browse files
dadachiclaude
andauthored
Fix invisible sparkle on welcome and sign-up screens in light mode (#50)
The welcome screen used theme-following surfaces with a hard-coded white sparkle and white-derived text — in light display mode the sparkle became white-on-white and the screen looked broken. Pin the welcome screen to the brand navy (#1A2332, same as the launcher and splash) regardless of theme so the white sparkle and title always have contrast, extending the launcher/splash look into the first screen the user sees. The sign-up/sign-in screen still follows the system theme since it has chrome (buttons, links) that should match the rest of the app, so swap its sparkle tint from hard-coded white to MaterialTheme.colorScheme.primary so it's visible in both light and dark modes. Mirrors NativeAppTemplate-Android#65. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0b0cec0 commit 40aa7e6

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import androidx.compose.ui.Alignment
2525
import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.graphics.Color
2727
import androidx.compose.ui.platform.LocalContext
28+
import androidx.compose.ui.res.colorResource
2829
import androidx.compose.ui.res.stringResource
2930
import androidx.compose.ui.text.font.FontWeight
3031
import androidx.compose.ui.text.style.TextAlign
@@ -38,8 +39,11 @@ import com.nativeapptemplate.nativeapptemplatefree.ui.common.NonScaledSp.nonScal
3839
internal fun OnboardingView(
3940
onStartClick: () -> Unit,
4041
) {
42+
val brandNavy = colorResource(R.color.ic_launcher_background)
43+
4144
Scaffold(
42-
topBar = { TopAppBar(onStartClick) },
45+
topBar = { TopAppBar(onStartClick, brandNavy) },
46+
containerColor = brandNavy,
4347
modifier = Modifier.fillMaxSize(),
4448
) { padding ->
4549
Column(
@@ -60,7 +64,7 @@ internal fun OnboardingView(
6064
Spacer(Modifier.height(24.dp))
6165
Text(
6266
text = stringResource(R.string.welcome_to_app, stringResource(R.string.app_name)),
63-
color = MaterialTheme.colorScheme.onBackground,
67+
color = Color.White,
6468
fontSize = 34.sp.nonScaledSp,
6569
lineHeight = 41.sp.nonScaledSp,
6670
fontWeight = FontWeight.Bold,
@@ -76,13 +80,16 @@ internal fun OnboardingView(
7680
@Composable
7781
private fun TopAppBar(
7882
onStartClick: () -> Unit,
83+
containerColor: Color,
7984
) {
8085
val context = LocalContext.current
8186

8287
CenterAlignedTopAppBar(
8388
colors = TopAppBarDefaults.topAppBarColors(
84-
containerColor = MaterialTheme.colorScheme.primaryContainer,
85-
titleContentColor = MaterialTheme.colorScheme.primary,
89+
containerColor = containerColor,
90+
titleContentColor = Color.White,
91+
navigationIconContentColor = Color.White,
92+
actionIconContentColor = Color.White,
8693
),
8794
title = { Text("") },
8895
actions = {
@@ -91,6 +98,7 @@ private fun TopAppBar(
9198
) {
9299
Text(
93100
"Start",
101+
color = Color.White,
94102
style = MaterialTheme.typography.displaySmall,
95103
)
96104
}
@@ -101,6 +109,7 @@ private fun TopAppBar(
101109
) {
102110
Text(
103111
stringResource(R.string.support_website),
112+
color = Color.White,
104113
)
105114
}
106115
},

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import androidx.compose.material3.TopAppBarDefaults
2525
import androidx.compose.runtime.Composable
2626
import androidx.compose.ui.Alignment
2727
import androidx.compose.ui.Modifier
28-
import androidx.compose.ui.graphics.Color
2928
import androidx.compose.ui.platform.LocalContext
3029
import androidx.compose.ui.res.stringResource
3130
import androidx.compose.ui.text.LinkAnnotation
@@ -76,7 +75,7 @@ internal fun SignUpOrSignInView(
7675
Icon(
7776
imageVector = Icons.Filled.AutoAwesome,
7877
contentDescription = null,
79-
tint = Color.White,
78+
tint = MaterialTheme.colorScheme.primary,
8079
modifier = Modifier
8180
.fillMaxWidth()
8281
.height(256.dp)

0 commit comments

Comments
 (0)