mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] Revert "Closes https://github.com/mozilla-mobile/fenix/issues/26750: pr review changes"
This reverts commit 013c9beaa36741d005b363cfedc7f2412906449e.
This commit is contained in:
parent
cd2c0d4cb8
commit
3e06f5b0ca
@ -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.take(THUMBNAILS_COUNT)
|
||||
state.wallpaperState.availableWallpapers.subList(0, 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() },
|
||||
onExploreMoreButtonClicked = {
|
||||
onBottomButtonClicked = {
|
||||
val directions = NavGraphDirections.actionGlobalWallpaperSettingsFragment()
|
||||
findNavController().navigate(directions)
|
||||
},
|
||||
|
@ -90,8 +90,8 @@ fun WallpaperSettings(
|
||||
WallpaperThumbnails(
|
||||
wallpapers = wallpapers,
|
||||
defaultWallpaper = defaultWallpaper,
|
||||
selectedWallpaper = selectedWallpaper,
|
||||
loadWallpaperResource = loadWallpaperResource,
|
||||
selectedWallpaper = selectedWallpaper,
|
||||
onSelectWallpaper = { updatedWallpaper ->
|
||||
coroutineScope.launch {
|
||||
scaffoldState.snackbarHostState.showSnackbar(
|
||||
@ -154,10 +154,10 @@ private fun WallpaperSnackbar(
|
||||
fun WallpaperThumbnails(
|
||||
wallpapers: List<Wallpaper>,
|
||||
defaultWallpaper: Wallpaper,
|
||||
selectedWallpaper: Wallpaper,
|
||||
loadWallpaperResource: suspend (Wallpaper) -> Bitmap?,
|
||||
onSelectWallpaper: (Wallpaper) -> Unit,
|
||||
selectedWallpaper: Wallpaper,
|
||||
numColumns: Int = 3,
|
||||
onSelectWallpaper: (Wallpaper) -> Unit,
|
||||
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 onExploreMoreButtonClicked Callback for when the bottom text button is clicked.
|
||||
* @param onBottomButtonClicked 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,
|
||||
onExploreMoreButtonClicked: () -> Unit,
|
||||
onBottomButtonClicked: () -> Unit,
|
||||
onSelectWallpaper: (Wallpaper) -> Unit,
|
||||
) {
|
||||
Surface(
|
||||
@ -96,8 +96,8 @@ fun WallpaperOnboarding(
|
||||
WallpaperThumbnails(
|
||||
wallpapers = wallpapers,
|
||||
defaultWallpaper = Wallpaper.Default,
|
||||
selectedWallpaper = currentWallpaper,
|
||||
loadWallpaperResource = { loadWallpaperResource(it) },
|
||||
selectedWallpaper = currentWallpaper,
|
||||
onSelectWallpaper = { onSelectWallpaper(it) },
|
||||
verticalPadding = 16,
|
||||
horizontalPadding = 0,
|
||||
@ -107,7 +107,7 @@ fun WallpaperOnboarding(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterHorizontally)
|
||||
.fillMaxWidth(),
|
||||
onClick = { onExploreMoreButtonClicked() },
|
||||
onClick = { onBottomButtonClicked() },
|
||||
) {
|
||||
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 = {},
|
||||
onExploreMoreButtonClicked = {},
|
||||
onBottomButtonClicked = {},
|
||||
loadWallpaperResource = { null },
|
||||
onSelectWallpaper = {},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user