commit b81ba99caef00c7b77ca80cb384429f4c674ba64
parent b79bbc6e31b531eb93a10673c2137b87f3344b52
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Wed, 10 Dec 2025 15:33:07 +0000
Bug 2004511 - Part 8: Add a preview of a highlighted IconListItemBeforeIcon in ListItem r=android-reviewers,007
Differential Revision: https://phabricator.services.mozilla.com/D275385
Diffstat:
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/compose/list/ListItem.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/compose/list/ListItem.kt
@@ -67,7 +67,6 @@ import mozilla.components.compose.base.badge.BADGE_SIZE_SMALL
import mozilla.components.compose.base.badge.BadgedIcon
import mozilla.components.compose.base.modifier.thenConditional
import mozilla.components.compose.base.theme.information
-import mozilla.components.compose.base.theme.surfaceDimVariant
import org.mozilla.fenix.compose.Favicon
import org.mozilla.fenix.compose.button.RadioButton
import org.mozilla.fenix.theme.FirefoxTheme
@@ -343,21 +342,6 @@ fun IconListItem(
}
@Composable
-@PreviewLightDark
-private fun IconListItemBeforeIconPreview() {
- FirefoxTheme {
- Box(Modifier.background(MaterialTheme.colorScheme.surfaceDimVariant)) {
- IconListItemBeforeIcon(
- isHighlighted = false,
- painter = painterResource(iconsR.drawable.mozac_ic_shield_slash_critical_24),
- description = "",
- tint = Color.Unspecified,
- )
- }
- }
-}
-
-@Composable
private fun IconListItemBeforeIcon(
isHighlighted: Boolean,
painter: Painter,
@@ -1545,3 +1529,27 @@ private fun SelectableListItemPreview() {
}
}
}
+
+@Composable
+@PreviewLightDark
+private fun IconListItemBeforeIconPreview() {
+ FirefoxTheme {
+ Surface {
+ Row(modifier = Modifier.padding(all = FirefoxTheme.layout.space.static100)) {
+ IconListItemBeforeIcon(
+ isHighlighted = false,
+ painter = painterResource(iconsR.drawable.mozac_ic_shield_slash_critical_24),
+ description = "",
+ tint = Color.Unspecified,
+ )
+
+ IconListItemBeforeIcon(
+ isHighlighted = true,
+ painter = painterResource(iconsR.drawable.mozac_ic_shield_slash_critical_24),
+ description = "",
+ tint = Color.Unspecified,
+ )
+ }
+ }
+ }
+}