Add landscape previews
This commit is contained in:
parent
2215fabbc8
commit
f2618581dd
1 changed files with 16 additions and 1 deletions
|
|
@ -111,8 +111,12 @@ fun MediaViewerView(
|
||||||
val snackbarHostState = rememberSnackbarHostState(snackbarMessage = state.snackbarMessage)
|
val snackbarHostState = rememberSnackbarHostState(snackbarMessage = state.snackbarMessage)
|
||||||
var showOverlay by remember { mutableStateOf(true) }
|
var showOverlay by remember { mutableStateOf(true) }
|
||||||
|
|
||||||
val defaultBottomPaddingInPixels = if (LocalInspectionMode.current) 303 else 0
|
|
||||||
val currentData = state.listData.getOrNull(state.currentIndex)
|
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() }
|
BackHandler { onBackClick() }
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier,
|
modifier,
|
||||||
|
|
@ -642,3 +646,14 @@ internal fun MediaViewerViewPreview(@PreviewParameter(MediaViewerStateProvider::
|
||||||
onBackClick = {},
|
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 = {},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue