Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent Background with gif. #40

Closed
sjkaris opened this issue Mar 16, 2014 · 5 comments
Closed

Transparent Background with gif. #40

sjkaris opened this issue Mar 16, 2014 · 5 comments
Assignees
Labels

Comments

@sjkaris
Copy link

sjkaris commented Mar 16, 2014

I am not entirely sure, but I have tried for a while and never successfully gotten a gif with a transparent background to have a transparent background while playing. For gifs with transparent backgrounds, the GifImageView seems to take the most common color in the gif and use that as a background for the View. Additionally, the background flickers every loop of the gif as the background changes from transparent to filled at the start of each loop.

@koral-- koral-- self-assigned this Mar 16, 2014
@koral--
Copy link
Owner

koral-- commented Mar 16, 2014

I could not reproduce any of mentioned issues. I've tried using this animated gif with transparent background: http://www.animatedgif.net/animals/bears/bear1_e0.gif
Could you provide an example of GIF file which is not displayed correctly?

@sjkaris
Copy link
Author

sjkaris commented Mar 16, 2014

A gif that does not work for me is: http://imgur.com/q3pP1Gq
just to make sure I am using everything correctly:
in my xml file I have:

<pl.droidsonroids.gif.GifImageView
android:id="@+id/rand_poke"
android:layout_margin="@dimen/login_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>

and then in my activity I load the gif image resource:

GifImageView gifView = (GifImageView) dialog.findViewById(R.id.rand_poke);
String uri = PokemonData.randPoke();
int imageResource = getResources().getIdentifier(uri, "drawable", getPackageName());
gifView.setImageResource(imageResource);

@koral--
Copy link
Owner

koral-- commented Mar 16, 2014

OK, your gif is not displayed correctly. I will investigate this.

koral-- added a commit that referenced this issue Mar 16, 2014
@koral--
Copy link
Owner

koral-- commented Mar 16, 2014

Background color should be correct now.

@koral-- koral-- closed this as completed Mar 16, 2014
@sjkaris
Copy link
Author

sjkaris commented Mar 17, 2014

Awesome thanks!

@niplus niplus mentioned this issue Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants