Media: some code clean-up

This commit is contained in:
ganfra 2023-05-24 22:23:38 +02:00
parent 92e19c3dd9
commit 3e01a2f317
7 changed files with 18 additions and 16 deletions

View file

@ -22,7 +22,7 @@ import io.element.android.libraries.matrix.api.media.MediaFile
interface LocalMediaFactory {
/**
* This method will create a [LocalMedia] with the given [MediaFile] and [mimeType]
* This method will create a [LocalMedia] with the given [MediaFile] and [mimeType].
*
*/
fun createFromMediaFile(mediaFile: MediaFile, mimeType: String?): LocalMedia

View file

@ -74,17 +74,18 @@ private fun MediaImageView(
modifier = modifier.fillMaxSize(),
contentDescription = null,
)
} else {
val zoomableState = rememberZoomableState(
zoomSpec = ZoomSpec(maxZoomFactor = 3f)
)
ZoomableAsyncImage(
modifier = modifier.fillMaxSize(),
state = rememberZoomableImageState(zoomableState),
model = localMedia.model,
contentDescription = "Image",
contentScale = ContentScale.Fit,
)
}
val zoomableState = rememberZoomableState(
zoomSpec = ZoomSpec(maxZoomFactor = 3f)
)
ZoomableAsyncImage(
modifier = modifier.fillMaxSize(),
state = rememberZoomableImageState(zoomableState),
model = localMedia.model,
contentDescription = "Image",
contentScale = ContentScale.Fit,
)
}
@UnstableApi