koral--/android-gif-drawable

[HELP] Gif very thin using wrap content

p4ulor opened this issue · 5 comments

Hey,

I'm trying to use your widget on a dialog, but wrap_content isn't working for me. It appears very thin like this:

image

Only when I set a height or width it works, like this:

image

Here is where I open the dialog

Here is the layout where I use your widget

Can you help me on how to keep the original ratio of the image, so that it doesn't look stretch out and looks good? Thanks!

Sorry I'm a beginner

Is behavior the same if you use an ImageView instead of GifImageView?

By setting to ImageView the gif doesn't play as expected (with layout_height="300dp"):
image
With wrap content it doesnt appear (very thin) like in the first image I showed on this issue. It's all in my public repo if you wanna try it out 😔

By the same behavior, I meant measurement.
Ofc ImageView does not support animated GIFs OOTB.

If wrap_content is ignored in the same way on both views then the cause is not located in this library but somewhere else in your code.

Does it reproduce in a very minimal project? I mean an empty Activity with only dialog, which layout consists only of ImageView, without any external dependencies?

I removed the CardView and now the wrap_content works 👍
image
I'll try to use other ways to host the GifImageView and the rest of some other Views in the Dialog
thanks :]

ok, good to hear.
I'm closing this issue since it is not a bug in the library.