Android Question Help with animation

apty

Active Member
Licensed User
Longtime User
i am trying to animate panels added to a scrollview in B4A. I want to achieve animation like in the video attached. Please help.


 

LucaMs

Expert
Licensed User
Longtime User
I tried a quick test, without thinking a lot.

The idea is to create a class for each panel-row to animate.

In the example, the Main is passed to the class but you can pass the panel that will contain the various panels-rows.

The problem is that when you resize the width you will have to add also the animation of the internal views (in the tick event of the timer).
 

Attachments

  • Panel Anim.zip
    7.3 KB · Views: 305
Upvote 0

apty

Active Member
Licensed User
Longtime User
Thanks a lot for the help. In my case, i load the panels as in the code below
B4X:
For i=0 To 9
        Dim Panel1 As Panel
        Dim pnlAllTrips As Panel
        Dim lblMonth As Label
        Dim lblYear As Label
        Dim lblReturn As Label
        Dim lblAmnt As Label
        Panel1.Initialize("")
        Panel1.LoadLayout("alltrips")
        Panel1.Color = Colors.Transparent
    ScrollView1.Panel.AddView(Panel1,10dip,px,100%x-20dip,60dip)
       If i=0 Then
            Panel1.Width=90%x 
        Else If i=1 Then
....

Using your approach i have been unable to get the panel width so that i can modify it accordingly. How can i add the width property?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Using your approach i have been unable to get the panel width so that i can modify it accordingly. How can i add the width property?
Mine was just an example, to say that you can create a class in which you can handle the animation, with SetLayoutAnimated, timers and events like those I wrote in the example.

You could pass the item panel you created by code (Panel1 in your code above) to the Inititialize routine of the class (without the need to create a panel inside the class, then).
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Mine was just an example, to say that you can create a class in which you can handle the animation, with SetLayoutAnimated, timers and events like those I wrote in the example.

You could pass the item panel you created by code (Panel1 in your code above) to the Inititialize routine of the class (without the need to create a panel inside the class, then).
Something like this one:
 

Attachments

  • Panel Anim 2.zip
    8.6 KB · Views: 314
Upvote 0
Top