Remove useless Box

This commit is contained in:
Benoit Marty 2026-04-23 17:45:53 +02:00 committed by Benoit Marty
parent a307df5f64
commit 675f2d913b

View file

@ -204,48 +204,42 @@ fun MediaViewerView(
} }
// Top bar // Top bar
AnimatedVisibility(visible = showOverlay, enter = fadeIn(), exit = fadeOut()) { AnimatedVisibility(visible = showOverlay, enter = fadeIn(), exit = fadeOut()) {
Box( when (currentData) {
modifier = Modifier is MediaViewerPageData.MediaViewerData -> {
.fillMaxSize() MediaViewerTopBar(
.navigationBarsPadding() data = currentData,
) { canShowInfo = state.canShowInfo,
when (currentData) { onBackClick = onBackClick,
is MediaViewerPageData.MediaViewerData -> { onShareClick = {
MediaViewerTopBar( state.eventSink(MediaViewerEvent.Share(currentData))
data = currentData, },
canShowInfo = state.canShowInfo, onSaveClick = {
onBackClick = onBackClick, state.eventSink(MediaViewerEvent.SaveOnDisk(currentData))
onShareClick = { },
state.eventSink(MediaViewerEvent.Share(currentData)) onInfoClick = {
}, state.eventSink(MediaViewerEvent.OpenInfo(currentData))
onSaveClick = { },
state.eventSink(MediaViewerEvent.SaveOnDisk(currentData)) )
}, }
onInfoClick = { else -> {
state.eventSink(MediaViewerEvent.OpenInfo(currentData)) TopAppBar(
}, title = {
) if (currentData is MediaViewerPageData.Loading) {
} Text(
else -> { modifier = Modifier.semantics {
TopAppBar( heading()
title = { },
if (currentData is MediaViewerPageData.Loading) { text = stringResource(id = CommonStrings.common_loading_more),
Text( style = ElementTheme.typography.fontBodyMdMedium,
modifier = Modifier.semantics { color = ElementTheme.colors.textPrimary,
heading() )
}, }
text = stringResource(id = CommonStrings.common_loading_more), },
style = ElementTheme.typography.fontBodyMdMedium, colors = TopAppBarDefaults.topAppBarColors(
color = ElementTheme.colors.textPrimary, containerColor = bgCanvasWithTransparency,
) ),
} navigationIcon = { BackButton(onClick = onBackClick) },
}, )
colors = TopAppBarDefaults.topAppBarColors(
containerColor = bgCanvasWithTransparency,
),
navigationIcon = { BackButton(onClick = onBackClick) },
)
}
} }
} }
} }