D Declan Well-Known Member Licensed User Longtime User Sep 10, 2016 #1 I am displaying 4 imageviews with: Code: Copy 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"
I am displaying 4 imageviews with: Code: Copy 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"
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2016 #2 You can use a timer for that. Enable the timer when IsPlugged is true and disable it when IsPlugged is false. Upvote 0
You can use a timer for that. Enable the timer when IsPlugged is true and disable it when IsPlugged is false.
D Declan Well-Known Member Licensed User Longtime User Sep 11, 2016 #3 Thanks Erel - Works great. Solution, hope others can benefit: Code: Copy 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
Thanks Erel - Works great. Solution, hope others can benefit: Code: Copy 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