commit 9716651a2d7820cbd96c05608b0a9884675471f5
parent 8ace76d4aa8552e32484e5926ba947b7df8a66a1
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Mon, 3 Nov 2025 07:26:15 +0000
Bug 1996435 - Part 1: Add the private browsing mask icon to PrivateBrowsingDescription2 r=android-reviewers,devota
- Adds the PBM icon to align with the intended designs
- Figma: https://www.figma.com/design/NSjxxopvFmRFu0m61T1N4E/HNT-Android-2025?node-id=16750-61327&m=dev
Differential Revision: https://phabricator.services.mozilla.com/D270079
Diffstat:
1 file changed, 44 insertions(+), 32 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/PrivateBrowsingDescription.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/PrivateBrowsingDescription.kt
@@ -15,13 +15,17 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Icon
+import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
+import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
@@ -30,12 +34,14 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
+import mozilla.components.ui.colors.PhotonColors
import org.mozilla.fenix.R
import org.mozilla.fenix.compose.LinkText
import org.mozilla.fenix.compose.LinkTextState
import org.mozilla.fenix.home.ui.HomepageTestTag.HOMEPAGE_PRIVATE_BROWSING_LEARN_MORE_LINK
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.theme.Theme
+import mozilla.components.ui.icons.R as iconsR
/**
* Total Private Browsing Mode homepage informational card.
@@ -111,43 +117,49 @@ fun PrivateBrowsingDescription2(
verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically),
horizontalAlignment = Alignment.CenterHorizontally,
) {
- Text(
- text = stringResource(id = R.string.felt_privacy_desc_card_title),
- color = MaterialTheme.colorScheme.onSurface,
- textAlign = TextAlign.Center,
- style = FirefoxTheme.typography.headline5,
- )
+ CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) {
+ Icon(
+ painter = painterResource(id = iconsR.drawable.mozac_ic_private_mode_72),
+ contentDescription = null,
+ tint = PhotonColors.White.copy(alpha = 0.3f),
+ )
- Text(
- text = stringResource(
- id = R.string.felt_privacy_info_card_subtitle_3,
- stringResource(id = R.string.app_name),
- ),
- color = MaterialTheme.colorScheme.onSurface,
- textAlign = TextAlign.Center,
- style = FirefoxTheme.typography.subtitle1,
- )
+ Text(
+ text = stringResource(id = R.string.felt_privacy_desc_card_title),
+ textAlign = TextAlign.Center,
+ style = FirefoxTheme.typography.headline5,
+ )
- Box(
- modifier = Modifier.semantics {
- testTagsAsResourceId = true
- testTag = HOMEPAGE_PRIVATE_BROWSING_LEARN_MORE_LINK
- },
- ) {
- LinkText(
- text = stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
- linkTextStates = listOf(
- LinkTextState(
- text = stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
- url = "",
- onClick = { onLearnMoreClick() },
- ),
+ Text(
+ text = stringResource(
+ id = R.string.felt_privacy_info_card_subtitle_3,
+ stringResource(id = R.string.app_name),
),
- style = FirefoxTheme.typography.subtitle1,
- linkTextColor = MaterialTheme.colorScheme.onSurface,
- linkTextDecoration = TextDecoration.Underline,
textAlign = TextAlign.Center,
+ style = FirefoxTheme.typography.subtitle1,
)
+
+ Box(
+ modifier = Modifier.semantics {
+ testTagsAsResourceId = true
+ testTag = HOMEPAGE_PRIVATE_BROWSING_LEARN_MORE_LINK
+ },
+ ) {
+ LinkText(
+ text = stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
+ linkTextStates = listOf(
+ LinkTextState(
+ text = stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
+ url = "",
+ onClick = { onLearnMoreClick() },
+ ),
+ ),
+ style = FirefoxTheme.typography.subtitle1,
+ linkTextColor = MaterialTheme.colorScheme.onSurface,
+ linkTextDecoration = TextDecoration.Underline,
+ textAlign = TextAlign.Center,
+ )
+ }
}
}
}