Android Question Custom transitions between B4XPages

asales

Well-Known Member
Licensed User
I use this code to create an animation transition (left/right or right/left) between activities:
Is possible to make this with B4XPages?
If yes, how?

Thanks in advance for any tip.
 

Erel

Administrator
Staff member
Licensed User
Activity transitions will not work with B4XPages as all pages are actually in the same activity.

The pages are animated from the top left corner (if TransitionAnimationDuration > 0).

You can create your own animations, though the previous page will immediately be removed.
Example:
In page 2:
B4X:
Public Sub AnimateFromBotton
    #if B4A
    Root.Top = 100%y
    Root.SetLayoutAnimated(300, 0, 0, Root.Width, Root.Height)
    #End If
End Sub
In main page:
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")
    Page2.Initialize
    B4XPages.AddPage("Page 2", Page2)
End Sub

Sub Button1_Click
    B4XPages.ShowPage("Page 2")
    Page2.AnimateFromBotton
End Sub
 
Top