commit a490b16307aff4c55cb8d53f2b28f6168e30a129
parent b81ba99caef00c7b77ca80cb384429f4c674ba64
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Wed, 10 Dec 2025 15:33:07 +0000
Bug 2004511 - Part 9: Migrate UrlWarningCard to use M3 color token r=android-reviewers,007
Differential Revision: https://phabricator.services.mozilla.com/D275386
Diffstat:
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/ProfilerStopDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/ProfilerStopDialogFragment.kt
@@ -17,6 +17,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Dialog
import androidx.fragment.app.DialogFragment
@@ -105,25 +106,35 @@ class ProfilerStopDialogFragment : DialogFragment() {
}
}
}
+}
- @Composable
- private fun UrlWarningCard(
- onStopAndSave: () -> Unit,
- onStopWithoutSaving: () -> Unit,
+@Composable
+private fun UrlWarningCard(
+ onStopAndSave: () -> Unit,
+ onStopWithoutSaving: () -> Unit,
+) {
+ BaseProfilerDialogContent(
+ titleText = stringResource(R.string.profiler_url_warning),
+ negativeActionText = stringResource(R.string.profiler_start_cancel),
+ onNegativeAction = onStopWithoutSaving,
+ positiveActionText = stringResource(R.string.profiler_as_url),
+ onPositiveAction = onStopAndSave,
) {
- BaseProfilerDialogContent(
- titleText = stringResource(R.string.profiler_url_warning),
- negativeActionText = stringResource(R.string.profiler_start_cancel),
- onNegativeAction = onStopWithoutSaving,
- positiveActionText = stringResource(R.string.profiler_as_url),
- onPositiveAction = onStopAndSave,
- ) {
- Text(
- text = stringResource(R.string.profiler_url_warning_explained),
- color = FirefoxTheme.colors.textPrimary,
- fontWeight = FontWeight.Medium,
- fontSize = 15.sp,
- )
- }
+ Text(
+ text = stringResource(R.string.profiler_url_warning_explained),
+ fontWeight = FontWeight.Medium,
+ fontSize = 15.sp,
+ )
+ }
+}
+
+@Composable
+@PreviewLightDark
+private fun UrlWarningCardPreview() {
+ FirefoxTheme {
+ UrlWarningCard(
+ onStopAndSave = {},
+ onStopWithoutSaving = {},
+ )
}
}