I need to show a text like the final credits of a movie. I put the text in a label and with the animation library move the label from down to up the screen. This is the code:
The text is shown as well, like I want. But when I have tested the app in differents resolutions devices, the duration of animation changes. In some cases the duration is shorter and in other cases is longer. I'm not be able to check when the animation finishes. Until I discovered that I used a Timer with the same duration as the animation.
Is there any way to get the finish of the animation? Or is there any way to get the same duration of the animation independently of the resolution?
B4X:
dim a as animation
dim lbl2 as label
lbl2="Large large large text...." // the real text is really large, many lines
Activity.AddView(lbl2, 5%x, 0, 90%x, 100%y)
a.InitializeTranslate("",0,100%y,0%x,-200%y)
a.Duration=128000
lbl2.Visible= True
a.start(lbl2)
The text is shown as well, like I want. But when I have tested the app in differents resolutions devices, the duration of animation changes. In some cases the duration is shorter and in other cases is longer. I'm not be able to check when the animation finishes. Until I discovered that I used a Timer with the same duration as the animation.
Is there any way to get the finish of the animation? Or is there any way to get the same duration of the animation independently of the resolution?