commit a69a7f3a76482340340cad04819070a7fd6e8a5b
parent 08bd6d66f6c248f437a6173a3027e1af209c3f83
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Tue, 2 Dec 2025 16:41:27 +0000
Bug 1993368 - Part 35: Migrate ProgressBarSetupChecklistView to M3 color tokens r=android-reviewers,007
- borderDisabled used for the progress bar is equivalent to textDisabled and iconDisabled. This would map out to disabled text color token which would be onSurface with 38% opacity.
- Figma: https://www.figma.com/design/7J6gh5D8DbGTExxskKdn3T/Mobile-Onboarding-Experiments?node-id=14570-55402&m=dev
Differential Revision: https://phabricator.services.mozilla.com/D274538
Diffstat:
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/setup/ui/ProgressBarSetupChecklistView.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/setup/ui/ProgressBarSetupChecklistView.kt
@@ -12,6 +12,8 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
@@ -41,7 +43,7 @@ private val shapeProgressBarChecklist = RoundedCornerShape(
*/
@Composable
fun ProgressBarSetupChecklistView(numberOfTasks: Int, numberOfTasksCompleted: Int) {
- Box(modifier = Modifier.background(FirefoxTheme.colors.layer1)) {
+ Surface {
ProgressBarBackground()
ProgressBarCompleted(numberOfTasks, numberOfTasksCompleted)
@@ -60,7 +62,7 @@ private fun ProgressBarBackground() {
.fillMaxWidth()
.height(heightProgressBarChecklist)
.clip(shapeProgressBarChecklist)
- .background(FirefoxTheme.colors.borderDisabled),
+ .background(MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)),
) {}
}
@@ -119,24 +121,24 @@ private fun ProgressBarSegmentation(numberOfTasks: Int) {
modifier = Modifier
.height(heightProgressBarChecklist)
.width(4.dp)
- .background(FirefoxTheme.colors.layer1),
+ .background(MaterialTheme.colorScheme.surface),
) {}
}
}
}
}
-@Suppress("MagicNumber")
@FlexibleWindowLightDarkPreview
@Composable
private fun PreviewProgressIndicatorSetupChecklist() {
FirefoxTheme {
- Box(
- modifier = Modifier
- .background(color = FirefoxTheme.colors.layer1)
- .padding(16.dp),
- ) {
- ProgressBarSetupChecklistView(6, 3)
+ Surface {
+ Box(modifier = Modifier.padding(16.dp)) {
+ ProgressBarSetupChecklistView(
+ numberOfTasks = 6,
+ numberOfTasksCompleted = 3,
+ )
+ }
}
}
}