mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
MediaViewer: Show divider above the caption only if there is a caption and the media is video (to have a divider with the video controller)
This commit is contained in:
+6
-1
@@ -51,6 +51,7 @@ import io.element.android.compound.theme.ElementTheme
|
|||||||
import io.element.android.compound.tokens.generated.CompoundIcons
|
import io.element.android.compound.tokens.generated.CompoundIcons
|
||||||
import io.element.android.libraries.architecture.AsyncData
|
import io.element.android.libraries.architecture.AsyncData
|
||||||
import io.element.android.libraries.core.mimetype.MimeTypes
|
import io.element.android.libraries.core.mimetype.MimeTypes
|
||||||
|
import io.element.android.libraries.core.mimetype.MimeTypes.isMimeTypeVideo
|
||||||
import io.element.android.libraries.designsystem.components.button.BackButton
|
import io.element.android.libraries.designsystem.components.button.BackButton
|
||||||
import io.element.android.libraries.designsystem.components.dialogs.RetryDialog
|
import io.element.android.libraries.designsystem.components.dialogs.RetryDialog
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||||
@@ -125,6 +126,7 @@ fun MediaViewerView(
|
|||||||
)
|
)
|
||||||
MediaViewerBottomBar(
|
MediaViewerBottomBar(
|
||||||
modifier = Modifier.align(Alignment.BottomCenter),
|
modifier = Modifier.align(Alignment.BottomCenter),
|
||||||
|
showDivider = state.mediaInfo.mimeType.isMimeTypeVideo(),
|
||||||
caption = state.mediaInfo.caption,
|
caption = state.mediaInfo.caption,
|
||||||
onHeightChange = { bottomPaddingInPixels = it },
|
onHeightChange = { bottomPaddingInPixels = it },
|
||||||
)
|
)
|
||||||
@@ -360,6 +362,7 @@ private fun MediaViewerTopBar(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun MediaViewerBottomBar(
|
private fun MediaViewerBottomBar(
|
||||||
caption: String?,
|
caption: String?,
|
||||||
|
showDivider: Boolean,
|
||||||
onHeightChange: (Int) -> Unit,
|
onHeightChange: (Int) -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
@@ -371,8 +374,10 @@ private fun MediaViewerBottomBar(
|
|||||||
onHeightChange(it.height)
|
onHeightChange(it.height)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
HorizontalDivider()
|
|
||||||
if (caption != null) {
|
if (caption != null) {
|
||||||
|
if (showDivider) {
|
||||||
|
HorizontalDivider()
|
||||||
|
}
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|||||||
Reference in New Issue
Block a user