Android Question How to know the current frame of animated gif ?

semar

Active Member
Licensed User
Longtime User
Dear all,
I'm using the B4XGifView view to show animated gif, and it works flawlessy.

However, I need to change the gif when the last frame is reached.

Sadly I don't see any method inside the B4XGifView that allow me to monitor the frames of the gif.

Any help would be very appreciated

Regards,
Sergio
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
For Each f As String In Array("giphy-downsized.gif", "loading_large.gif", "progress.gif")
    B4XGifView1.SetGif(File.DirAssets, f)
    Dim jo As JavaObject = B4XGifView1.GifDrawable
    jo.RunMethod("setLoopCount", Array(1))
    Dim duration As Int = jo.RunMethod("getDuration", Null)
    Sleep(duration)
Next
 
Upvote 0

semar

Active Member
Licensed User
Longtime User
Many thanks Erel !

This JavaObject-thingy is really powerful. This is reflection, right ?

Is there any documentation out there, where I can look at, in order to find the available methods for an object, in this example, B4XGifView.Drawable ?
And how can I find out that I should use the B4XGifView.Drawable object, and not another one ?

Best regards
Sergio
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is reflection, right ?
Yes.

Is there any documentation out there, where I can look at, in order to find the available methods for an object, in this example, B4XGifView.Drawable ?

And how can I find out that I should use the B4XGifView.Drawable object, and not another one ?
Check the library source code. It is inside the b4xlib file (zip file).
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…