Closed Bug 989617 Opened 11 years ago Closed 4 years ago

Home panels don't animate animated gifs in image_url.

Categories

(Firefox for Android Graveyard :: Awesomescreen, enhancement)

All
Android
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bwinton, Unassigned)

References

()

Details

Attachments

(1 file)

One of the features I've added to Whimsy for Android is a "Whimsy!" panel in the AwesomeScreen, but the animated gifs I set as the image_urls of the items don't animate. Currently I've set the url to the same image, so people can at least tap on the image to see the animation, but it would be way nicer if they images could animate on the panel. (I understand from http://droid-blog.net/2011/10/14/tutorial-how-to-use-animated-gifs-in-android-part-1/ (and parts 2 and 3) that this is probably a really hard feature to add, but figured it would be worth a bug, if only to give you all the chance to resolve it wontfix. ;) Thanks, Blake.
We use the Picasso image loading library to load these images. On quick glance, it doesn't look like Picasso supports animated gifs, so we would need to extend that somehow if we were to do this. I know this is a fun whimsy feature, but unfortunately this is probably a WONTFIX :/
Blocks: lists
If it helps, I did a little poking around again yesterday morning, and ended up on http://stackoverflow.com/questions/3660209/display-animated-gif which has a link to https://github.com/frapontillo/ImageViewEx (and http://androidosbeginning.blogspot.ca/2010/09/gif-animation-in-android.html, but the first link seems more useful…) So, perhaps it could be as simple as switching out Picasso for ImageViewEx (or hooking them together). (I agree that it's likely a WONTFIX, but perhaps it would be worth leaving open in case some community member wants to take a stab at it.)
(In reply to Blake Winton (:bwinton) from comment #2) > If it helps, I did a little poking around again yesterday morning, and ended > up on http://stackoverflow.com/questions/3660209/display-animated-gif which > has a link to https://github.com/frapontillo/ImageViewEx (and > http://androidosbeginning.blogspot.ca/2010/09/gif-animation-in-android.html, > but the first link seems more useful…) > > So, perhaps it could be as simple as switching out Picasso for ImageViewEx > (or hooking them together). > > (I agree that it's likely a WONTFIX, but perhaps it would be worth leaving > open in case some community member wants to take a stab at it.) Had a quick look. ImageViewEx (the widget) would actually be pretty simple to adapt (I'd probably write our version of it though). The tricky part would be to change Picasso to decode the input streams into Movie instances instead of Bitmaps. Picasso is very Bitmap-oriented under the hood. Let's leave this open. I might have a more thorough look at this bug in the future.
(In reply to Lucas Rocha (:lucasr) from comment #3) > Had a quick look. ImageViewEx (the widget) would actually be pretty simple > to adapt (I'd probably write our version of it though). The tricky part > would be to change Picasso to decode the input streams into Movie instances > instead of Bitmaps. Picasso is very Bitmap-oriented under the hood. Let's > leave this open. I might have a more thorough look at this bug in the future. You mention Movie class because it directly supports animated GIFs, right? https://code.google.com/p/apidemos/source/browse/trunk/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.java#103 I see that ImageViewEx is deprecated, suggesting we use Picasso. I also see that ImageViewEx just uses a Movie like the sample code. Another thing we wanted to support in Home panels was videos. Does picasso support any type of media?
I was curious about this. Looks like we can grab the raw byte array here [1] (for network requests, other requests have their own hunters). We'd have to wrap it into some sort of fake bitmap class that could hold a reference and let us get the original raw undecoded data as well. From there, Picasso supports throwing a Target [2] object in instead of an ImageView anywhere. We can do whatever we want with our fake "Bitmap" there. Or maybe we'd be better to grab the raw stream at [1] and feed it to the Movie/VideoView instead. I'm sure none of that would make Picasso's caching happy. Ideally we'd probably only cache the "bitmap"/"poster frame" anyway... [1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/thirdparty/com/squareup/picasso/NetworkBitmapHunter.java#75 [2] http://mxr.mozilla.org/mozilla-central/source/mobile/android/thirdparty/com/squareup/picasso/Target.java
Attached patch WIPSplinter Review
This doesn't work for me, but I got curious and wanted to try. This sends out a stream from Picasso to the Target. Then I try to make that a Movie. All of that works, just nothing appears. We'd also won't get a stream if something is in the in memory cache... I won't work on this anymore probably, but thought I'd at least save my place.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: