I'm using this library (Xamarin binding library of Glide), to display Gif in my app. But i would like to display Webp animations to save some space in my app.
Glide.With(context)
.Load(url)
.Into(imageView);
But the animation is locked on the first frame and didn't played (webp animation example).
Did i miss something?
Thank you.
Regards, Samih
It's a known issue.
Right now, Glide has no built-in webp support and defaults to the system.It seems like Glide will work when you introduce some libraries that support WebP.
Related
I'm new to Kotlin and Java and don't know how to scale an image in an image view.
I want something like this: MyImageView.setHeight(300)
I don't want to distort the image.
Thanks in advance!
This solution might be overkill for your current question, but if you have to show images in your app, I recommend using an image handling library such as Picasso or Glide.
If you are to use Picasso, add it to your dependencies by adding the following line to your gradle files :
dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
}
Then in your Kotlin file, when you are about to load the picture onto an ImageView,
do it using Picasso using the following lines :
Picasso
.get()
.load(imageUrl)
.fit()
.centerInside()
.into(imageView)
Yes, I agree with rgv. Use an image handling library, preferably Picasso. It can reduce a lot of hardwork and also, the result is better than what you would have got by scaling image manually.
I am using the AppIntro https://github.com/apl-devs/AppIntro
library with the default slides builder.
It works great but I am having trouble passing gifs as the drawable for the default builder.
addSlide(AppIntroFragment.newInstance(title, description, image, backgroundColor));
I read that android has issues displaying gif by default and I have to use GifImageLoader or Glide to load the gif.
Glide
.with(context)
.load("imageUrl")
.asGif()
.placeholder(R.drawable.gifImage)
.crossFade()
.into(imageView)
I could try this but I don't have an imageView where I can pass into the argument if I use the default builder.
I also tried GifDrawable gifFromResource = new GifDrawable( getResources(), R.drawable.anim ); from Display Animated GIF but it gives an error.
My next closest option is to create a custom fragment to use with AppIntro and I really don't want to do that.
Is there any way to pass the gif into the default slide builder and have it play?
You can use Simple Target from Glide library. Override onResourceReady() and load this as image in new slide. Please note I have not tried this with gif and have not access to my dev machine now.
Simple Target docs
I'm using this library for loading Images. What I want to know is if it is possible to get a Ken burns effect going using that library? Maybe an easy and straightforward way to do it?
Update
how about creating a ken burns effect gif and loading as gif, do you think thats a good idea?
I know how to do this using some other libraries, like KenBurnsView etc, what I wanted to know was if its possible with Glide and if using Gif with glide is better or worse than creating my own custom animation and adding it as the animator to glide
I am using Glide for displaying images in a listview.
How can I use LruBitmapPool to reduce GC (Garbage Collection)?
There is no sample around.
Glide Page :
https://github.com/bumptech/glide
Glide uses the LruBitmapPool automatically so you don't normally need to worry about it. It looks like you posted an issue on Glide's Github page, so let's follow up there: https://github.com/bumptech/glide/issues/326.
I need some advice about animation. I have an animated GIF, but how to put in Android app to be animation. When I put it doesn't move at all. I read something about animation in Android and I need to have pictures for animation. Is there any solution for this ?
Android does not support animated GIFs much. You can use an AnimationDrawable, perhaps defined from frames using a drawable XML file.
you can do it by using GIF image in your app as Splash screen.
Android does not support animated GIFs. so extract gif to png pictures with gif2png and it works with XML.
And Other Option Adding gif image in an ImageView in android
Adding gif image in an ImageView in android
100 % Work...
1) Add Glide library dependency...
compile 'com.github.bumptech.glide:glide:4.2.0'
2)
imageView = findViewById(R.id.gifImage);
3)
Glide.with(getApplicationContext())
.asGif()
.load(R.drawable.gifImage)
.into(imageView);
just use .asGif() before .load()