Remove useless Box
This commit is contained in:
parent
a307df5f64
commit
675f2d913b
1 changed files with 36 additions and 42 deletions
|
|
@ -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) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue