Fix preview rendering
This commit is contained in:
parent
b42860a8bf
commit
0d39e921e9
3 changed files with 5 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
|
@ -112,6 +113,7 @@ internal fun MediaFileViewPreview(
|
||||||
@PreviewParameter(MediaInfoFileProvider::class) info: MediaInfo
|
@PreviewParameter(MediaInfoFileProvider::class) info: MediaInfo
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
MediaFileView(
|
MediaFileView(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
localMediaViewState = rememberLocalMediaViewState(),
|
localMediaViewState = rememberLocalMediaViewState(),
|
||||||
uri = null,
|
uri = null,
|
||||||
info = info,
|
info = info,
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
package io.element.android.libraries.mediaviewer.impl.local.image
|
package io.element.android.libraries.mediaviewer.impl.local.image
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
|
@ -55,6 +56,7 @@ fun MediaImageView(
|
||||||
@Composable
|
@Composable
|
||||||
internal fun MediaImageViewPreview() = ElementPreview {
|
internal fun MediaImageViewPreview() = ElementPreview {
|
||||||
MediaImageView(
|
MediaImageView(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
localMediaViewState = rememberLocalMediaViewState(),
|
localMediaViewState = rememberLocalMediaViewState(),
|
||||||
localMedia = null,
|
localMedia = null,
|
||||||
onClick = {},
|
onClick = {},
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.wrapContentSize
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.derivedStateOf
|
import androidx.compose.runtime.derivedStateOf
|
||||||
|
|
@ -179,7 +178,7 @@ private fun ExoPlayerMediaVideoView(
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(ElementTheme.colors.bgSubtlePrimary)
|
.background(ElementTheme.colors.bgSubtlePrimary)
|
||||||
.wrapContentSize(),
|
.align(Alignment.Center),
|
||||||
text = "A Video Player will render here",
|
text = "A Video Player will render here",
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue