Media: some code clean-up
This commit is contained in:
parent
92e19c3dd9
commit
3e01a2f317
7 changed files with 18 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue