MediaViewer: add Save action as a main action.

This commit is contained in:
Benoit Marty 2026-04-21 16:21:01 +02:00
parent 97ae775df5
commit 79afb1d9e0
2 changed files with 25 additions and 0 deletions

View file

@ -217,6 +217,9 @@ fun MediaViewerView(
onShareClick = {
state.eventSink(MediaViewerEvent.Share(currentData))
},
onSaveClick = {
state.eventSink(MediaViewerEvent.SaveOnDisk(currentData))
},
onInfoClick = {
state.eventSink(MediaViewerEvent.OpenInfo(currentData))
},
@ -461,6 +464,7 @@ private fun MediaViewerTopBar(
canShowInfo: Boolean,
onBackClick: () -> Unit,
onShareClick: () -> Unit,
onSaveClick: () -> Unit,
onInfoClick: () -> Unit,
eventSink: (MediaViewerEvent) -> Unit,
) {
@ -527,6 +531,15 @@ private fun MediaViewerTopBar(
contentDescription = stringResource(id = CommonStrings.action_share),
)
}
IconButton(
onClick = onSaveClick,
enabled = actionsEnabled,
) {
Icon(
imageVector = CompoundIcons.Download(),
contentDescription = stringResource(id = CommonStrings.action_save),
)
}
if (canShowInfo) {
IconButton(
onClick = onInfoClick,