2

I want show Gif image in Glide library. I write below codes but when show my gif, show very very slow motion . i want show gif normally bit rate not slow motion.

ImageView test = (ImageView) findViewById(R.id.testImageGif);
GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(test);
Glide.with(this)
        .load(R.drawable.login_image)
        .into(imageViewTarget);

how can it?

  • follow this link, this might help you [visit here](http://stackoverflow.com/questions/31082330/show-gif-file-with-glide-image-loading-and-caching-library) – xbadal Mar 11 '17 at 08:05
  • 1
    try to use *.diskCacheStrategy(DiskCacheStrategy.NONE)* `..// .load(R.drawable.login_image) .diskCacheStrategy(DiskCacheStrategy.NONE) //.....` and see – Charuක Mar 11 '17 at 08:35

2 Answers2

1

try this

ImageView test = (ImageView) findViewById(R.id.testImageGif);
    Glide  
    .with(this)
    .load(R.drawable.login_image)
    .asGif()
    .into(test);
Darish
  • 11,032
  • 5
  • 50
  • 70
0

as @SachinThampan said Here

Xml:

<ImageView
                android:id="@+id/title_gif"
                android:layout_width="@dimen/gif_width"
                android:layout_height="@dimen/gif_height"
                />

Java:

    ImageView imageView = (ImageView) findViewById(R.id.title_gif);
    Glide.with(this).asGif().load(R.raw.animated_gif).into(imageView);

In build.gradle:

implementation 'com.github.bumptech.glide:glide:4.0.0'
pz64_
  • 2,212
  • 2
  • 20
  • 43
Hila Grossbard
  • 521
  • 7
  • 20