Zhang Zihan
05/05/2024, 7:17 PMAnimatedImageVector.animatedVectorResource()
and rememberAnimatedVectorPainter()
in Android cannot be used in KMP Desktop 😢Marcin Wisniowski
05/08/2024, 11:45 AMKaanixir
06/22/2024, 4:05 AM@Composable
fun GifImage(
modifier: Modifier = Modifier,
) {
val context = LocalContext.current
val imageLoader = ImageLoader.Builder(context)
.components {
if (SDK_INT >= 28) {
add(ImageDecoderDecoder.Factory())
} else {
add(GifDecoder.Factory())
}
}
.build()
Image(
painter = rememberAsyncImagePainter(
ImageRequest.Builder(context).data(data = R.drawable.YOUR_GIF_HERE).apply(block = {
size(Size.ORIGINAL)
}).build(), imageLoader = imageLoader
),
contentDescription = null,
modifier = modifier.fillMaxWidth(),
)
}
this thing doesn't have anything to do with Compose Desktop.
I can't find any resource on playing GIF on Desktop.
Initially I have an mp4 video which is an HD 10 second loop of a rotating earth, turning this into GIF is slightly expensive but it's better than trying to use the retardedd experimental JB video player that captures all focus and mouse clicks and doesn't let you disable it via any parameter.Marcin Wisniowski
06/22/2024, 1:42 PM