asales Expert Licensed User Longtime User Jun 25, 2020 #1 I use this code to create an animation transition (left/right or right/left) between activities: Custom transitions between activities This short tutorial will explain how to create custom transitions between activities. The transitions must be declared in an XML file as described here: Animation Resources | Android Developers 1. Declare the transition You should put the animation files under Objects\Res\anim folder. The... www.b4x.com Is possible to make this with B4XPages? If yes, how? Thanks in advance for any tip.
I use this code to create an animation transition (left/right or right/left) between activities: Custom transitions between activities This short tutorial will explain how to create custom transitions between activities. The transitions must be declared in an XML file as described here: Animation Resources | Android Developers 1. Declare the transition You should put the animation files under Objects\Res\anim folder. The... www.b4x.com Is possible to make this with B4XPages? If yes, how? Thanks in advance for any tip.
Erel B4X founder Staff member Licensed User Longtime User Jun 25, 2020 #2 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: Code: 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: Code: 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 Upvote 0
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: Code: 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: Code: 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
LucaMs Expert Licensed User Longtime User Jan 1, 2021 #3 Before finding this thread I had tried something similar to this (different animation and unique public routine, written in the B4XMainPage, to which pass the Root of the page to open). Unfortunately, both with my routine placed there and with Erel's routine, inside the page itself, there is a problem: how to run the animation when you come back to the page? The call to the routine should be written in the B4XPage_Appear event but also by setting Root.Visible = False it appears before the animation. Can it be solved? The page (Root) with the hand still appears, for a moment, before the animation, despite the setting: Root.Visible = False. Last edited: Jan 1, 2021 Upvote 0
Before finding this thread I had tried something similar to this (different animation and unique public routine, written in the B4XMainPage, to which pass the Root of the page to open). Unfortunately, both with my routine placed there and with Erel's routine, inside the page itself, there is a problem: how to run the animation when you come back to the page? The call to the routine should be written in the B4XPage_Appear event but also by setting Root.Visible = False it appears before the animation. Can it be solved? The page (Root) with the hand still appears, for a moment, before the animation, despite the setting: Root.Visible = False.
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2021 #4 Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page. Upvote 0
Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page.
LucaMs Expert Licensed User Longtime User Jan 3, 2021 #5 Erel said: Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page. Click to expand... I will try, thank you. Upvote 0
Erel said: Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page. Click to expand... I will try, thank you.
LucaMs Expert Licensed User Longtime User Jan 3, 2021 #6 Erel said: Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page. Click to expand... LucaMs said: I will try, thank you. Click to expand... It works, Erel, thank you. Obviously I will not be able to use this class Upvote 0
Erel said: Don't go back. Show the next page with ShowPageAndClosePrevious and keep the stack with a single page. Click to expand... LucaMs said: I will try, thank you. Click to expand... It works, Erel, thank you. Obviously I will not be able to use this class