' Class Example
Sub Class_Globals
'...
'...
'...
Private FadedOut As Boolean
and change the routine FadeOut_Animated:
B4X:
Private Sub FadeOut_Animated (iv As B4XView)
Dim bc As BitmapCreator
bc.Initialize(OriginalBmp.Width / OriginalBmp.Scale, OriginalBmp.Height / OriginalBmp.Scale)
bc.FillRect(xui.Color_Transparent, bc.TargetRect)
If FadedOut Then
effects.TransitionAnimated(1500, bc.Bitmap, OriginalBmp, iv)
Else
effects.TransitionAnimated(1500, OriginalBmp, bc.Bitmap, iv)
End If
FadedOut = Not(FadedOut)
End Sub