Sub Animated(l1 As Long, l2 As Long, t1 As Long, t2 As Long)
Dim p As B4XView = xui.CreatePanel("")
Activity.AddView(p, Rnd(l1,l2), Rnd(t1,t2), 30dip, 30dip)
p.SendToBack 'this is optional
p.SetColorAndBorder(xui.Color_ARGB(255, Rnd(0,255), Rnd(0,255), Rnd(0,255)), 0dip, xui.Color_White, Rnd(0,20))
p.SetLayoutAnimated(1000, Rnd(l1,l2), Rnd(t1,t2), 5dip, 5dip)
p.SetVisibleAnimated(1000, False)
Sleep(1000)
p.RemoveViewFromParent
End Sub