mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 19:10:43 +00:00
MediaViewerView: move TopBar to Scaffold topbar
This commit is contained in:
committed by
Benoit Marty
parent
8188ef1463
commit
b1890de26a
+12
-12
@@ -121,19 +121,8 @@ fun MediaViewerView(
|
|||||||
Scaffold(
|
Scaffold(
|
||||||
modifier,
|
modifier,
|
||||||
containerColor = Color.Transparent,
|
containerColor = Color.Transparent,
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
topBar = {
|
||||||
) {
|
|
||||||
val pagerState = rememberPagerState(state.currentIndex, 0f) {
|
|
||||||
state.listData.size
|
|
||||||
}
|
|
||||||
LaunchedEffect(pagerState) {
|
|
||||||
snapshotFlow { pagerState.currentPage }.collect { page ->
|
|
||||||
state.eventSink(MediaViewerEvent.OnNavigateTo(page))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Top bar
|
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
modifier = Modifier.zIndex(1f),
|
|
||||||
visible = showOverlay,
|
visible = showOverlay,
|
||||||
enter = fadeIn(),
|
enter = fadeIn(),
|
||||||
exit = fadeOut(),
|
exit = fadeOut(),
|
||||||
@@ -177,6 +166,17 @@ fun MediaViewerView(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
|
) {
|
||||||
|
val pagerState = rememberPagerState(state.currentIndex, 0f) {
|
||||||
|
state.listData.size
|
||||||
|
}
|
||||||
|
LaunchedEffect(pagerState) {
|
||||||
|
snapshotFlow { pagerState.currentPage }.collect { page ->
|
||||||
|
state.eventSink(MediaViewerEvent.OnNavigateTo(page))
|
||||||
|
}
|
||||||
|
}
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
|
|||||||
Reference in New Issue
Block a user