Untitled

mail@pastecode.io avatar
unknown
kotlin
15 days ago
953 B
4
Indexable
Never
@Composable
fun Preview() {
    val configuration = LocalConfiguration.current
    val cutoutPadding = WindowInsets.displayCutout.asPaddingValues()
    val statusBarPadding = WindowInsets.statusBars.asPaddingValues()

    val isLandscape = configuration.orientation == Configuration.ORIENTATION_LANDSCAPE

    InnerpipeTheme {
        LazyColumn(
            modifier = Modifier.fillMaxSize(),
            contentPadding = PaddingValues(
                top = statusBarPadding.calculateTopPadding(),
                start = if (isLandscape) cutoutPadding.calculateStartPadding(LocalLayoutDirection.current) else 0.dp,
                end = if (isLandscape) cutoutPadding.calculateEndPadding(LocalLayoutDirection.current) else 0.dp
            )
        ) {
            item {
                VideoItem()
                Playlist()
            }
            items(3) {
                VideoItem()
            }
        }
    }
}
Leave a Comment