commit 0acb6780a80711829e9e9f3a7cc3990bf0d379ba parent c6623bc09223ea220dc35ee88abff20d25051bf8 Author: t-p-white <towhite@mozilla.com> Date: Fri, 21 Nov 2025 18:01:05 +0000 Bug 2001487 - Swapped order the ToU bottom sheet's Accept and Remind Me Later buttons and added outline to secondary button. r=android-reviewers,joberhauser Figma | {F41390859} | Patch | {F41390585} | {F41390593} Differential Revision: https://phabricator.services.mozilla.com/D273552 Diffstat:
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/button/TextButton.kt b/mobile/android/android-components/components/compose/base/src/main/java/mozilla/components/compose/base/button/TextButton.kt @@ -4,6 +4,7 @@ package mozilla.components.compose.base.button +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.material3.ButtonColors @@ -28,6 +29,7 @@ import androidx.compose.material3.TextButton as M3TextButton * @param enabled Controls the enabled state of the button. When `false`, this button will not * be clickable. * @param colors The [ButtonColors] used to color the [TextButton]. + * @param border Optional [BorderStroke] to apply to the [TextButton]. */ @Composable fun TextButton( @@ -36,12 +38,14 @@ fun TextButton( modifier: Modifier = Modifier, enabled: Boolean = true, colors: ButtonColors = ButtonDefaults.textButtonColors(), + border: BorderStroke? = null, ) { M3TextButton( onClick = onClick, modifier = modifier, enabled = enabled, colors = colors, + border = border, ) { Text( text = text, @@ -71,7 +75,7 @@ private fun TextButtonPreview() { } @Composable -@Preview() +@Preview private fun PrivateTextButtonPreview() { AcornTheme( colors = privateColorPalette, diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/termsofuse/ui/TermsOfUseBottomSheet.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/termsofuse/ui/TermsOfUseBottomSheet.kt @@ -4,6 +4,7 @@ package org.mozilla.fenix.termsofuse.ui +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -14,6 +15,7 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.BottomSheetDefaults import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.ModalBottomSheetProperties import androidx.compose.material3.SheetState @@ -146,7 +148,7 @@ private fun BottomSheetContent( Column( modifier = Modifier .verticalScroll(scrollState) - .padding(horizontal = 32.dp), + .padding(start = 32.dp, end = 32.dp, bottom = 16.dp), ) { if (!showDragHandle) { Spacer(Modifier.size(16.dp)) @@ -180,21 +182,9 @@ private fun BottomSheetContent( Spacer(Modifier.size(16.dp)) - FilledButton( - modifier = Modifier.fillMaxWidth(), - text = stringResource(R.string.terms_of_use_prompt_accept), - ) { - onAcceptClicked() - - coroutineScope.launch { - sheetState.hide() - }.invokeOnCompletion { - onDismiss() - } - } - TextButton( modifier = Modifier.fillMaxWidth(), + border = BorderStroke(width = 1.dp, color = MaterialTheme.colorScheme.outline), text = stringResource(R.string.terms_of_use_prompt_postpone), onClick = { onRemindMeLaterClicked() @@ -206,6 +196,19 @@ private fun BottomSheetContent( } }, ) + + FilledButton( + modifier = Modifier.fillMaxWidth(), + text = stringResource(R.string.terms_of_use_prompt_accept), + ) { + onAcceptClicked() + + coroutineScope.launch { + sheetState.hide() + }.invokeOnCompletion { + onDismiss() + } + } } }