B4J Library [B4XPages] PagesTransition

PagesTransiiton

Author: Solutions Development
Version: 1.07
  • TransitionPage
    • Constant
      • AnimationBatMan
      • AnimationColumn
      • AnimationCircleExplode
      • AnimationCircleImplode
      • AnimationRotaded
      • AnimationSpotted
      • AnimationStrip
      • AnimationZoom
      • SlideFromLeft
      • SlideFromTop
      • SlideFromRight
      • SlideFromBottom
      • ShoveFromLeft
      • ShoveFromTop
      • ShoveFromRight
      • ShoveFromBottom
      • AnimationGuillotine
    • Functions:
      • Initialize (FromPageRoot As B4XView, ToPageRoot As B4XView)
        Initializes the object. You can add parameters to this method if needed.
      • Transition (Animation As Int, Durate As Int)

NOTE:
  1. Make sure that the base panel of each page has a color. If it's transparent it won't work properly.
  2. The root variable must be declared public
  3. Preferably the duration of the page animations is set to zero

Log update
  • (1.01) Add AnimationSpotted
  • (1.02) Add SlideFromLeft, SlideFromTop, SlideFromRight, SlideFromBottom
  • (1.03) Add AnimationLiquidUp, AnimationLiquidDown
  • (1.04) Add AnimationBatMan
  • (1.05) Add ShoveFromLeft, ShoveFromTop, ShoveFromRight, ShoveFromBottom
  • (1.06) Fix ios Bug
  • (1.07) Add AnimationGuillotine

ezgif.com-gif-maker.gif
2.gif
2.gif
 

Attachments

  • PagesTransiiton.b4xlib
    4.3 KB · Views: 136
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Any chance of a B4A sample?
 

Theera

Well-Known Member
Licensed User
Longtime User
B4X:
Private Sub Button1_Click
    Dim T As TransitionPage
    T.Initialize(Root,P2.Root)
    T.Transition(T.AnimationSpotted,1000)
    B4XPages.ShowPage("P2")
End Sub

View attachment 137680
If the pages isn't created as B4XView,how to do? I always use StartActivity(Activity As Object)
B4X:
 T.Initialize(Root,P2.Root)
 
Last edited:

Solutions Development

Member
Licensed User
Longtime User
If the pages isn't created as B4XView,how to do? I always use StartActivity(Activity As Object)
B4X:
 T.Initialize(Root,P2.Root)
this library was created for B4XPages. If you want to use it for activities, perhaps you could use them if the two panels are anchored to the same base. You can set the starting panel and then the ending panel as parameters
 

tsteward

Well-Known Member
Licensed User
Longtime User
I've taken the 3 page sample and changed to the way my app references various pages and attempted to apply this lib but I get the following error.
Hoping someone can tell me what I have missed.

Error occurred on line: 37 (TransitionPage)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:91)
at anywheresoftware.b4a.objects.B4XViewWrapper.Snapshot(B4XViewWrapper.java:345)
at b4a.example.transitionpage._initialize(transitionpage.java:77)
at b4a.example.b4xmainpage._btnlogin_click(b4xmainpage.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7881)
at android.widget.TextView.performClick(TextView.java:16201)
at android.view.View.performClickInternal(View.java:7858)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:30863)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
 

Attachments

  • B4ATransTest.zip
    14.4 KB · Views: 87

Solutions Development

Member
Licensed User
Longtime User
Error occurred on line: 37 (TransitionPage)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:91)
at anywheresoftware.b4a.objects.B4XViewWrapper.Snapshot(B4XViewWrapper.java:345)
at b4a.example.transitionpage._initialize(transitionpage.java:77)
at b4a.example.b4xmainpage._btnlogin_click(b4xmainpage.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7881)
at android.widget.TextView.performClick(TextView.java:16201)
at android.view.View.performClickInternal(View.java:7858)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:30863)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Preferably use B4XPages.AddPageAndCreate rather than B4XPages.AddPage
But if you use AddPage you have to initialize after the show method like in this example
B4X:
Dim T As TransitionPage
T.Initialize(Root,Pages.Page2.Root)
B4XPages.ShowPageAndRemovePreviousPages("Page 2")
T.Transition(T.AnimationSpotted,1000)



IMPORTANT
the background of the pages must be colored

1674062889585.png
 
Last edited:
Top