mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
Closes #26750: pr review changes
This commit is contained in:
parent
0ff140193b
commit
87334d2a76
@ -169,7 +169,7 @@ interface OnboardingInteractor {
|
||||
* Returns true if the call has been passed down to the controller.
|
||||
*
|
||||
* @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
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class WallpaperOnboardingDialogFragment : BottomSheetDialogFragment() {
|
||||
setContent {
|
||||
FirefoxTheme {
|
||||
val wallpapers = appStore.observeAsComposableState { state ->
|
||||
state.wallpaperState.availableWallpapers.subList(0, THUMBNAILS_COUNT)
|
||||
state.wallpaperState.availableWallpapers.take(THUMBNAILS_COUNT)
|
||||
}.value ?: listOf()
|
||||
val currentWallpaper = appStore.observeAsComposableState { state ->
|
||||
state.wallpaperState.currentWallpaper
|
||||
@ -78,7 +78,7 @@ class WallpaperOnboardingDialogFragment : BottomSheetDialogFragment() {
|
||||
wallpapers = wallpapers,
|
||||
currentWallpaper = currentWallpaper,
|
||||
onCloseClicked = { dismiss() },
|
||||
onBottomButtonClicked = {
|
||||
onExploreMoreButtonClicked = {
|
||||
val directions = NavGraphDirections.actionGlobalWallpaperSettingsFragment()
|
||||
findNavController().navigate(directions)
|
||||
},
|
||||
|
@ -90,8 +90,8 @@ fun WallpaperSettings(
|
||||
WallpaperThumbnails(
|
||||
wallpapers = wallpapers,
|
||||
defaultWallpaper = defaultWallpaper,
|
||||
loadWallpaperResource = loadWallpaperResource,
|
||||
selectedWallpaper = selectedWallpaper,
|
||||
loadWallpaperResource = loadWallpaperResource,
|
||||
onSelectWallpaper = { updatedWallpaper ->
|
||||
coroutineScope.launch {
|
||||
scaffoldState.snackbarHostState.showSnackbar(
|
||||
@ -154,10 +154,10 @@ private fun WallpaperSnackbar(
|
||||
fun WallpaperThumbnails(
|
||||
wallpapers: List<Wallpaper>,
|
||||
defaultWallpaper: Wallpaper,
|
||||
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
|
||||
selectedWallpaper: Wallpaper,
|
||||
numColumns: Int = 3,
|
||||
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
|
||||
onSelectWallpaper: (Wallpaper) -> Unit,
|
||||
numColumns: Int = 3,
|
||||
verticalPadding: Int = 30,
|
||||
horizontalPadding: Int = 20,
|
||||
) {
|
||||
|
@ -40,7 +40,7 @@ import org.mozilla.fenix.theme.Theme
|
||||
* @param currentWallpaper The currently selected wallpaper.
|
||||
* @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 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.
|
||||
*/
|
||||
|
||||
@ -52,7 +52,7 @@ fun WallpaperOnboarding(
|
||||
currentWallpaper: Wallpaper,
|
||||
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
|
||||
onCloseClicked: () -> Unit,
|
||||
onBottomButtonClicked: () -> Unit,
|
||||
onExploreMoreButtonClicked: () -> Unit,
|
||||
onSelectWallpaper: (Wallpaper) -> Unit,
|
||||
) {
|
||||
Surface(
|
||||
@ -96,8 +96,8 @@ fun WallpaperOnboarding(
|
||||
WallpaperThumbnails(
|
||||
wallpapers = wallpapers,
|
||||
defaultWallpaper = Wallpaper.Default,
|
||||
loadWallpaperResource = { loadWallpaperResource(it) },
|
||||
selectedWallpaper = currentWallpaper,
|
||||
loadWallpaperResource = { loadWallpaperResource(it) },
|
||||
onSelectWallpaper = { onSelectWallpaper(it) },
|
||||
verticalPadding = 16,
|
||||
horizontalPadding = 0,
|
||||
@ -107,7 +107,7 @@ fun WallpaperOnboarding(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterHorizontally)
|
||||
.fillMaxWidth(),
|
||||
onClick = { onBottomButtonClicked() },
|
||||
onClick = { onExploreMoreButtonClicked() },
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.wallpapers_onboarding_dialog_explore_more_button_text),
|
||||
@ -133,7 +133,7 @@ private fun WallpaperSnackbarPreview() {
|
||||
wallpapers = listOf(Wallpaper.Default),
|
||||
currentWallpaper = Wallpaper.Default,
|
||||
onCloseClicked = {},
|
||||
onBottomButtonClicked = {},
|
||||
onExploreMoreButtonClicked = {},
|
||||
loadWallpaperResource = { null },
|
||||
onSelectWallpaper = {},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user