2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00
This commit is contained in:
mike a 2022-09-09 14:41:43 -07:00 committed by mergify[bot]
parent 7204aa5081
commit d123ba20b5
4 changed files with 11 additions and 11 deletions

View File

@ -169,7 +169,7 @@ interface OnboardingInteractor {
* Returns true if the call has been passed down to the controller. * Returns true if the call has been passed down to the controller.
* *
* @param state The wallpaper state. * @param state The wallpaper state.
* @return Whether the onboarding dialog is currently shown * @return Whether the onboarding dialog is currently shown.
*/ */
fun showWallpapersOnboardingDialog(state: WallpaperState): Boolean fun showWallpapersOnboardingDialog(state: WallpaperState): Boolean
} }

View File

@ -66,7 +66,7 @@ class WallpaperOnboardingDialogFragment : BottomSheetDialogFragment() {
setContent { setContent {
FirefoxTheme { FirefoxTheme {
val wallpapers = appStore.observeAsComposableState { state -> val wallpapers = appStore.observeAsComposableState { state ->
state.wallpaperState.availableWallpapers.subList(0, THUMBNAILS_COUNT) state.wallpaperState.availableWallpapers.take(THUMBNAILS_COUNT)
}.value ?: listOf() }.value ?: listOf()
val currentWallpaper = appStore.observeAsComposableState { state -> val currentWallpaper = appStore.observeAsComposableState { state ->
state.wallpaperState.currentWallpaper state.wallpaperState.currentWallpaper
@ -78,7 +78,7 @@ class WallpaperOnboardingDialogFragment : BottomSheetDialogFragment() {
wallpapers = wallpapers, wallpapers = wallpapers,
currentWallpaper = currentWallpaper, currentWallpaper = currentWallpaper,
onCloseClicked = { dismiss() }, onCloseClicked = { dismiss() },
onBottomButtonClicked = { onExploreMoreButtonClicked = {
val directions = NavGraphDirections.actionGlobalWallpaperSettingsFragment() val directions = NavGraphDirections.actionGlobalWallpaperSettingsFragment()
findNavController().navigate(directions) findNavController().navigate(directions)
}, },

View File

@ -90,8 +90,8 @@ fun WallpaperSettings(
WallpaperThumbnails( WallpaperThumbnails(
wallpapers = wallpapers, wallpapers = wallpapers,
defaultWallpaper = defaultWallpaper, defaultWallpaper = defaultWallpaper,
loadWallpaperResource = loadWallpaperResource,
selectedWallpaper = selectedWallpaper, selectedWallpaper = selectedWallpaper,
loadWallpaperResource = loadWallpaperResource,
onSelectWallpaper = { updatedWallpaper -> onSelectWallpaper = { updatedWallpaper ->
coroutineScope.launch { coroutineScope.launch {
scaffoldState.snackbarHostState.showSnackbar( scaffoldState.snackbarHostState.showSnackbar(
@ -154,10 +154,10 @@ private fun WallpaperSnackbar(
fun WallpaperThumbnails( fun WallpaperThumbnails(
wallpapers: List<Wallpaper>, wallpapers: List<Wallpaper>,
defaultWallpaper: Wallpaper, defaultWallpaper: Wallpaper,
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
selectedWallpaper: Wallpaper, selectedWallpaper: Wallpaper,
numColumns: Int = 3, loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
onSelectWallpaper: (Wallpaper) -> Unit, onSelectWallpaper: (Wallpaper) -> Unit,
numColumns: Int = 3,
verticalPadding: Int = 30, verticalPadding: Int = 30,
horizontalPadding: Int = 20, horizontalPadding: Int = 20,
) { ) {

View File

@ -40,7 +40,7 @@ import org.mozilla.fenix.theme.Theme
* @param currentWallpaper The currently selected wallpaper. * @param currentWallpaper The currently selected 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 onCloseClicked Callback for when the close button is clicked. * @param onCloseClicked Callback for when the close button is clicked.
* @param onBottomButtonClicked Callback for when the bottom text button is clicked. * @param onExploreMoreButtonClicked Callback for when the bottom text button is clicked.
* @param onSelectWallpaper Callback for when a new wallpaper is selected. * @param onSelectWallpaper Callback for when a new wallpaper is selected.
*/ */
@ -52,7 +52,7 @@ fun WallpaperOnboarding(
currentWallpaper: Wallpaper, currentWallpaper: Wallpaper,
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?, loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
onCloseClicked: () -> Unit, onCloseClicked: () -> Unit,
onBottomButtonClicked: () -> Unit, onExploreMoreButtonClicked: () -> Unit,
onSelectWallpaper: (Wallpaper) -> Unit, onSelectWallpaper: (Wallpaper) -> Unit,
) { ) {
Surface( Surface(
@ -96,8 +96,8 @@ fun WallpaperOnboarding(
WallpaperThumbnails( WallpaperThumbnails(
wallpapers = wallpapers, wallpapers = wallpapers,
defaultWallpaper = Wallpaper.Default, defaultWallpaper = Wallpaper.Default,
loadWallpaperResource = { loadWallpaperResource(it) },
selectedWallpaper = currentWallpaper, selectedWallpaper = currentWallpaper,
loadWallpaperResource = { loadWallpaperResource(it) },
onSelectWallpaper = { onSelectWallpaper(it) }, onSelectWallpaper = { onSelectWallpaper(it) },
verticalPadding = 16, verticalPadding = 16,
horizontalPadding = 0, horizontalPadding = 0,
@ -107,7 +107,7 @@ fun WallpaperOnboarding(
modifier = Modifier modifier = Modifier
.align(Alignment.CenterHorizontally) .align(Alignment.CenterHorizontally)
.fillMaxWidth(), .fillMaxWidth(),
onClick = { onBottomButtonClicked() }, onClick = { onExploreMoreButtonClicked() },
) { ) {
Text( Text(
text = stringResource(R.string.wallpapers_onboarding_dialog_explore_more_button_text), text = stringResource(R.string.wallpapers_onboarding_dialog_explore_more_button_text),
@ -133,7 +133,7 @@ private fun WallpaperSnackbarPreview() {
wallpapers = listOf(Wallpaper.Default), wallpapers = listOf(Wallpaper.Default),
currentWallpaper = Wallpaper.Default, currentWallpaper = Wallpaper.Default,
onCloseClicked = {}, onCloseClicked = {},
onBottomButtonClicked = {}, onExploreMoreButtonClicked = {},
loadWallpaperResource = { null }, loadWallpaperResource = { null },
onSelectWallpaper = {}, onSelectWallpaper = {},
) )