Bug? SetLayoutAnimated

LucaMs

Expert
Licensed User
I wanted to move an ImageView and at the same time resize its height to zero.
B4X:
    ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 0)
That line hides (sets height to 0) immediately the ImageView, instead of take 1 second.

Changing the height to just 1dip:
B4X:
    ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip)
it works.
 

LucaMs

Expert
Licensed User
This is related to the way the animation works.
This is related to the way the animation badly works :)

Well, I can use a simple workaround, of course:

B4X:
ImageView1.SetLayoutAnimated(1000, ImageView1.Left, ImageView1.Top + ImageView1.Height, ImageView1.Width, 1dip)
Slee(1000)
ImageView1.Height = 0
 
Top