Android Question SetVisibleAnimated - Repeat

Declan

Well-Known Member
Licensed User
Longtime User
I am displaying 4 imageviews with:
B4X:
imgCharge1.SetVisibleAnimated(3000, True)
    imgCharge2.SetVisibleAnimated(5000, True)
    imgCharge3.SetVisibleAnimated(5000, True)
    imgCharge4.SetVisibleAnimated(5000, True)
I have a variable "IsPlugged" that I set from PhoneEvents.
How can I repeat the above while "IsPlugged = True"
 

Declan

Well-Known Member
Licensed User
Longtime User
Thanks Erel - Works great.
Solution, hope others can benefit:
B4X:
Sub tmrBatt_tick
    showtime
End Sub

Sub showtime
    ImageIndex = ImageIndex + 1
    If ImageIndex > 4 Then
        ImageIndex = 1
    End If
   
    Dim bd As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "Charge" & ImageIndex & ".png"))
    bd.Gravity = Gravity.FILL
    imgCharge1.Background = bd
    imgCharge1.visible = True
End Sub
 
Upvote 0
Top