Skip to content

Commit c3453d5

Browse files
committed
Adapt large text colors to different alpha per label
1 parent 674a982 commit c3453d5

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

WordPress/src/jetpack/java/org/wordpress/android/ui/accounts/login/components/LoopingText.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.wordpress.android.ui.accounts.login.components
22

3+
import android.content.res.Configuration
34
import androidx.compose.material.Text
45
import androidx.compose.runtime.Composable
56
import androidx.compose.ui.Modifier
@@ -24,16 +25,16 @@ private val fontSize = 40.sp
2425
private fun LargeTexts() {
2526
val texts = stringArrayResource(R.array.login_prologue_revamped_jetpack_feature_texts)
2627

27-
val oddColor = colorResource(R.color.text_color_jetpack_login_feature_odd)
28-
val evenColor = colorResource(R.color.text_color_jetpack_login_feature_even)
28+
val secondaryColor = colorResource(R.color.text_color_jetpack_login_label_secondary)
29+
val primaryColor = colorResource(R.color.text_color_jetpack_login_label_primary)
2930

3031
val styledText = buildAnnotatedString {
3132
texts.forEachIndexed { index, text ->
3233
when ((index + 1).isOdd) {
33-
true -> withStyle(SpanStyle(color = oddColor)) {
34+
true -> withStyle(SpanStyle(color = secondaryColor)) {
3435
append(text)
3536
}
36-
false -> withStyle(SpanStyle(color = evenColor)) {
37+
false -> withStyle(SpanStyle(color = primaryColor)) {
3738
append(text)
3839
}
3940
}
@@ -63,7 +64,8 @@ fun LoopingText(modifier: Modifier = Modifier) {
6364
}
6465
}
6566

66-
@Preview(showBackground = true, device = Devices.PIXEL_4_XL)
67+
@Preview(showBackground = true, device = Devices.PIXEL_4)
68+
@Preview(showBackground = true, device = Devices.PIXEL_4, uiMode = Configuration.UI_MODE_NIGHT_YES)
6769
@Composable
6870
fun PreviewLoopingText() {
6971
AppTheme {

WordPress/src/jetpack/res/values-night/colors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
<color name="bg_jetpack_login_splash_top_gradient_3">#D9001C09</color>
2121
<color name="bg_jetpack_login_splash_top_gradient_4">#00001C09</color>
2222

23-
<color name="text_color_jetpack_login_feature_odd">#CC008710</color>
24-
<color name="text_color_jetpack_login_feature_even">#CC64CA43</color>
23+
<color name="text_color_jetpack_login_label_primary">@color/jetpack_green_20</color>
24+
<color name="text_color_jetpack_login_label_secondary">#80008710</color>
2525
</resources>

WordPress/src/jetpack/res/values/colors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
<color name="bg_jetpack_login_splash_top_gradient_3">#D9F1F3EC</color>
2121
<color name="bg_jetpack_login_splash_top_gradient_4">#00F1F3EC</color>
2222

23-
<color name="text_color_jetpack_login_feature_odd">#CC008710</color>
24-
<color name="text_color_jetpack_login_feature_even">#CC2FB41F</color>
23+
<color name="text_color_jetpack_login_label_primary">#80008710</color>
24+
<color name="text_color_jetpack_login_label_secondary">@color/jetpack_green_50</color>
2525
</resources>

0 commit comments

Comments
 (0)