mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Add landscape previews
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
70e45d9bfe
commit
42a572cce2
+16
-1
@@ -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 = {},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user