I wanted to animate a panel, from its initial width to zero.
If you set:
the panel disappears immediately, instead of do it in 500ms.
I noticed that a panel added by Designer has its border width set to 2dip.
Then you must set the minimum new width to the border width + 1dip to get the correct animation,
but if you set the new width to zero, the animation will not happen even if you set the border width to zero.
Also, even if you get the right animation, at least on my tablet with Android 4.4.2 - 1280x800 - scale 1, traces of the previous "image" remain:
They are not so visible in the animated gif, maybe:
Finally, if during the animation you increase the width of the panel, its content remains visible (it too will be animated), while in the opposite direction, decreasing the width, it disappears (as you can see in the animated gif above).
P.S. no traces on another device, Android 7 - 1920x1080 - scale 2.5
If you set:
B4X:
Panel1.SetLayoutAnimated(500, Panel1.Left, Panel1.Top, 0, Panel1.Height)
I noticed that a panel added by Designer has its border width set to 2dip.
Then you must set the minimum new width to the border width + 1dip to get the correct animation,
but if you set the new width to zero, the animation will not happen even if you set the border width to zero.
Also, even if you get the right animation, at least on my tablet with Android 4.4.2 - 1280x800 - scale 1, traces of the previous "image" remain:
They are not so visible in the animated gif, maybe:
Finally, if during the animation you increase the width of the panel, its content remains visible (it too will be animated), while in the opposite direction, decreasing the width, it disappears (as you can see in the animated gif above).
P.S. no traces on another device, Android 7 - 1920x1080 - scale 2.5
Attachments
Last edited: