I have a label that I am attempting to fade out, change the label text and then fade the label back in. I declared FadeInOut as an Animation. Here is the releveant code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Timer1.Initialize("Timer1", 5000)
FadeInOut.InitializeAlpha("anim",1,0)
FadeInOut.Duration = 2000
lblValue.text = "Testing"
Timer1.Enabled = True
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
FadeInOut.Start(lblValue)
End Sub
Sub anim_AnimationEnd
lblValue.Text = "Testing2"
FadeInOut.RepeatMode = FadeInOut.REPEAT_REVERSE
Timer1.Enabled = True
End Sub
My problem is that if I break on the first line of the AnimationEnd code, the label has popped back into view with 100% alpha and the text assigned in the Activity_Create code.
Yes that is the annoying thing about animations that they revert to the starting state at the end.
You have to set what state you want it to end at in animation end.
And the fade works great. I also noticed that FadeInOut.RepeatMode = FadeInOut.REPEAT_REVERSE wasn't working, so I just created a second FadeIn animation to handle that part. Everything works great now. Thanks.