Bug 1905665 - Set max width on the review prompt to match the figma for tablet design. r=android-reviewers,amejiamarmol,gmalekpour

Differential Revision: https://phabricator.services.mozilla.com/D215373
This commit is contained in:
t-p-white 2024-07-19 12:30:30 +00:00
parent ba3ae86bda
commit 521cebe3bf

View File

@ -25,7 +25,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.PreviewScreenSizes
@ -37,9 +39,13 @@ import org.mozilla.fenix.compose.annotation.LightDarkPreview
import org.mozilla.fenix.compose.button.PrimaryButton
import org.mozilla.fenix.compose.utils.KeyboardState
import org.mozilla.fenix.compose.utils.keyboardAsState
import org.mozilla.fenix.ext.isTablet
import org.mozilla.fenix.microsurvey.ui.ext.MicrosurveyUIData
import org.mozilla.fenix.theme.FirefoxTheme
private const val TABLET_WIDTH_FRACTION = 0.5f
private const val NON_TABLET_WIDTH_FRACTION = 1.0f
/**
* Initial microsurvey prompt displayed to the user to request completion of feedback.
*
@ -67,13 +73,22 @@ fun MicrosurveyRequestPrompt(
enter = slideInVertically(initialOffsetY = { it }),
exit = slideOutVertically(targetOffsetY = { it }),
) {
Column {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.background(color = FirefoxTheme.colors.layer1),
) {
Divider()
Column(
modifier = Modifier
.background(color = FirefoxTheme.colors.layer1)
.padding(all = 16.dp),
.padding(all = 16.dp)
.fillMaxWidth(
if (LocalContext.current.isTablet()) {
TABLET_WIDTH_FRACTION
} else {
NON_TABLET_WIDTH_FRACTION
},
),
) {
Header(microsurvey.promptTitle) {
onCloseButtonClicked()