mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Remove useless Box
This commit is contained in:
committed by
Benoit Marty
parent
70583fc3fc
commit
4e46f12a12
+36
-42
@@ -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) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user