I have items (panels) within a scrollview that I'd like to have fade out and, then, remove from the scrollview. For example:
B4X:
Dim anim As Animation
anim.InitializeAlpha("itemAnim", 1, 0)
p.Tag = anim 'p is the panel
anim.Duration = 1000
anim.Start(p)
And, then, on the AnimationEnd event:
B4X:
Private Sub itemAnim_AnimationEnd
Dim s As Animation = Sender
Dim removePanel As Panel = ???
removePanel.RemoveView
End Sub
My thinking was to use the Sender ("s" in the above code) to get the panel and remove it. Is there a way to get the panel that the Animation is associated with? Or, maybe there's a better way to get the same effect of fading to removal?
Sub Process_Globals
Public csu As CallSubUtils
End Sub
Sub Service_Create
csu.Initialize
End Sub
Main activity:
B4X:
Sub Globals
Dim panel1 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub Panel1_Click
panel1.SetVisibleAnimated(1000, False)
Starter.csu.CallSubDelayedPlus2(Me, "Remove_Panel", 1000, Array(panel1))
End Sub
Sub Remove_Panel(args() As Object)
Dim p As Panel = args(0)
p.RemoveView
End Sub