Add support for animated images to GlideImage.

Our GlideImage implementation doesn't support animated images, because it loads them as bitmaps and therefore only displays the first image frame as a static image. This change works around that issue by having GlideImage wrap an ImageView to handle cases where we need to display animated images.
This commit is contained in:
Jeffrey Starke
2025-05-12 10:49:23 -04:00
committed by Michelle Tang
parent fb111619d7
commit 288eda5bb1
2 changed files with 100 additions and 17 deletions

View File

@@ -27,6 +27,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
@@ -42,6 +43,7 @@ import org.thoughtcrime.securesms.components.transfercontrols.TransferProgressSt
import org.thoughtcrime.securesms.compose.GlideImage
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri
import org.thoughtcrime.securesms.stickers.AvailableStickerPack.DownloadStatus
import org.thoughtcrime.securesms.util.DeviceProperties
@Composable
fun StickerPackSectionHeader(
@@ -238,6 +240,7 @@ private fun StickerPackInfo(
) {
GlideImage(
model = coverImageUri,
enableApngAnimation = DeviceProperties.shouldAllowApngStickerAnimation(LocalContext.current),
modifier = Modifier
.padding(end = 16.dp)
.size(56.dp)