This is a DesignerCustomView control which is based on the native android movie view and will allow you to display animated gifs (tranparent ones as well).
1. Extract the AnimatedGifView jar + xml to the B4A libraries folder.
2. Open the IDE and check the AnimatedGifView library in the list of libraries.
3. Open the designer, drop a CustomView control, and in the CustomType choose AnimatedGifView.
You can load files by using the Load method:
B4X:
'Set the 3rd parameter to true to automatically start it
AnimatedGif.Load(File.DirAssets, "1.gif", False)
Properties: Visible, Stopped, Paused, Frame, Frames, EventsDisabled
Methods: Load
Events: Load, Pause, Stop, Frame, Play
Note: If you are just using it for ajax loaders, then set the Tag property to 1 in order to disable events and save some some serious CPU cycles.
In the samples folder, there is a ready-to-play sample project.
Enjoy!
Added: Visible, Frame, Frames, EventsDisabled propertiesRemoved: Resume eventAdded: Load, Pause, Stop, Frame, Play events
Removed: Pause, Resume methodsAdded: Paused, Stopped property. Stopped = true will reset the animation frame.
Initial version
Attachments
Last edited: