2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

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

This commit is contained in:
Arturo Mejia 2022-02-16 17:17:39 -05:00 committed by mergify[bot]
parent 1971f8984c
commit 8ed591874a

View File

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