[fenix] For https://github.com/mozilla-mobile/fenix/issues/23752: Address switch is off the screen in the Wallpaper settings.

pull/600/head
Arturo Mejia 3 years ago committed by mergify[bot]
parent 1971f8984c
commit 8ed591874a

@ -68,8 +68,7 @@ import java.util.Locale
* @param wallpapers Wallpapers to add to grid. * @param wallpapers Wallpapers to add to grid.
* @param selectedWallpaper The currently selected wallpaper. * @param selectedWallpaper The currently selected wallpaper.
* @param defaultWallpaper The default wallpaper * @param defaultWallpaper The default wallpaper
* @param loadWallpaperResource Callback to handle loading a wallpaper bitmap. Only optional in the * @param loadWallpaperResource Callback to handle loading a wallpaper bitmap. Only optional in the default case.
* default case.
* @param onSelectWallpaper Callback for when a new wallpaper is selected. * @param onSelectWallpaper Callback for when a new wallpaper is selected.
* @param onViewWallpaper Callback for when the view action is clicked from snackbar. * @param onViewWallpaper Callback for when the view action is clicked from snackbar.
* @param tapLogoSwitchChecked Enabled state for switch controlling taps to change wallpaper. * @param tapLogoSwitchChecked Enabled state for switch controlling taps to change wallpaper.
@ -164,8 +163,7 @@ private fun WallpaperSnackbar(
* *
* @param wallpapers Wallpapers to add to grid. * @param wallpapers Wallpapers to add to grid.
* @param defaultWallpaper The default wallpaper * @param defaultWallpaper The default wallpaper
* @param loadWallpaperResource Callback to handle loading a wallpaper bitmap. Only optional in the * @param loadWallpaperResource Callback to handle loading a wallpaper bitmap. Only optional in the default case.
* default case.
* @param selectedWallpaper The currently selected wallpaper. * @param selectedWallpaper The currently selected wallpaper.
* @param numColumns The number of columns that will occupy the grid. * @param numColumns The number of columns that will occupy the grid.
* @param onSelectWallpaper Action to take when a new wallpaper is selected. * @param onSelectWallpaper Action to take when a new wallpaper is selected.
@ -269,33 +267,34 @@ private fun WallpaperThumbnailItem(
} }
@Composable @Composable
@Suppress("MagicNumber")
private fun WallpaperLogoSwitch( private fun WallpaperLogoSwitch(
checked: Boolean, checked: Boolean,
onCheckedChange: (Boolean) -> Unit onCheckedChange: (Boolean) -> Unit
) { ) {
Column( Row(
modifier = Modifier.padding(horizontal = 12.dp, vertical = 16.dp), modifier = Modifier
.padding(horizontal = 16.dp, vertical = 16.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) { ) {
Row( Text(
horizontalArrangement = Arrangement.SpaceBetween, text = stringResource(R.string.wallpaper_tap_to_change_switch_label_1),
modifier = Modifier.fillMaxWidth() color = FirefoxTheme.colors.textPrimary,
) { fontSize = 18.sp,
Text( modifier = Modifier
text = stringResource(R.string.wallpaper_tap_to_change_switch_label_1), .weight(0.8f)
color = FirefoxTheme.colors.textPrimary, )
fontSize = 18.sp,
modifier = Modifier.padding(start = 4.dp) Switch(
) checked = checked,
Switch( onCheckedChange = onCheckedChange,
checked = checked, colors = SwitchDefaults.colors(
onCheckedChange = onCheckedChange, checkedThumbColor = FirefoxTheme.colors.formSelected,
colors = SwitchDefaults.colors( checkedTrackColor = FirefoxTheme.colors.formSurface,
checkedThumbColor = FirefoxTheme.colors.formSelected, uncheckedTrackColor = FirefoxTheme.colors.formSurface
checkedTrackColor = FirefoxTheme.colors.formSurface,
uncheckedTrackColor = FirefoxTheme.colors.formSurface
)
) )
} )
} }
} }

Loading…
Cancel
Save