Skip to content

Fresco Animated Image Support (GIF, Webp)

Maven Central

Add the below dependency to your module's build.gradle file:

dependencies {
    implementation "com.github.skydoves:landscapist-fresco-websupport:$version"
}
dependencies {
    implementation("com.github.skydoves:landscapist-fresco-websupport:$version")
}

You can load animated GIFs and WebP Images with FrescoWebImage composable function. You should pass the AbstractDraweeController like the following example below:

FrescoWebImage(
  controllerBuilder = {
      Fresco.newDraweeControllerBuilder()
          .setUri(poster.gif) // GIF or Webp image url.
          .setAutoPlayAnimations(true)
  },
  modifier = Modifier
    .fillMaxWidth()
    .height(300.dp)
)

For more details, check out DraweeController, and Supported URIs for setting URI addresses. Also, you can load general images (jpeg, png, etc) which can be loaded with FrescoImage by using FrescoWebImage and your custom controller.