Add landscape previews

This commit is contained in:
Jorge Martín 2026-04-15 10:00:20 +02:00 committed by Jorge Martin Espinosa
parent 70e45d9bfe
commit 42a572cce2

View file

@ -111,8 +111,12 @@ fun MediaViewerView(
val snackbarHostState = rememberSnackbarHostState(snackbarMessage = state.snackbarMessage)
var showOverlay by remember { mutableStateOf(true) }
val defaultBottomPaddingInPixels = if (LocalInspectionMode.current) 303 else 0
val currentData = state.listData.getOrNull(state.currentIndex)
val isLandscape = with(LocalWindowInfo.current) {
containerDpSize.width > containerDpSize.height
}
val defaultBottomPaddingInPixels = if (LocalInspectionMode.current && !isLandscape) 303 else 0
BackHandler { onBackClick() }
Scaffold(
modifier,
@ -642,3 +646,14 @@ internal fun MediaViewerViewPreview(@PreviewParameter(MediaViewerStateProvider::
onBackClick = {},
)
}
@Preview(device = "spec:width=411dp,height=891dp, orientation=landscape")
@Composable
internal fun MediaViewerViewLandscapePreview(@PreviewParameter(MediaViewerStateProvider::class) state: MediaViewerState) = ElementPreviewDark {
MediaViewerView(
state = state,
audioFocus = null,
textFileViewer = { _, _ -> },
onBackClick = {},
)
}