B4A Library [B4X] [XUI] AS ViewPager based on xCustomListView

asales

Expert
Licensed User
Longtime User
Very nice. Thanks.
I have a doubt:
Can I use this lib as a carousel?
Like this: if I have 100 pages, when I get to the last page and move foward, I return to the first page?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can I use this lib as a carousel?
maybe with a few tricks, the following approaches come to mind:
  • Dummy Item on the last
    • if i swipe to this dummy then jump2 first item
but I don't think that works reliably.
 

omarruben

Active Member
Licensed User
Longtime User
nice!!! god job, question... can you add a layout done on the designer?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can I use this lib as a carousel?
your'e lucky, i found a way on B4A and B4J. in B4I I still have to look for a workaround.

can you add a layout done on the designer?
what do you mean?
you can easily load a layout with AddPage, just load the layout to the panel you want to add with AddPage.
B4X:
Dim xpnl as B4XView
xpnl.LoadLayout("mylayout")
asv.AddPage(xpnl,"")
 

omarruben

Active Member
Licensed User
Longtime User
excellent !!! thank you
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can I use this lib as a carousel?
Update
1.12

  • [BETA] Add DesignerProperty Carousel - infinite swipe
    • On B4I Bounce Effect is disabled
  • B4I ScrollView Paging is now activated, this can improve the handling
In B4J, you simply jump to the 1st or last page, since there is no touch option there.
B4A Carousel and B4I Carousel
 

Rubsanpe

Active Member
Licensed User
Hi. I just update the library and now the app hang. The log is
B4X:
Error occurred on line: 109 (ASViewPager)
java.lang.RuntimeException: Cannot parse: null as boolean
    at anywheresoftware.b4a.BA.parseBoolean(BA.java:629)
    at anywheresoftware.b4a.BA.ObjectToBoolean(BA.java:699)
    at com.clarionero.boletinesoficiales.asviewpager._designercreateview(asviewpager.java:378)
    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:144)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
    at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:312)
    at com.clarionero.boletinesoficiales.b4xpage_dashboard$ResumableSub_B4XPage_Created.resume(b4xpage_dashboard.java:651)
    at com.clarionero.boletinesoficiales.b4xpage_dashboard._b4xpage_created(b4xpage_dashboard.java:593)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
    at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1055)
    at com.clarionero.boletinesoficiales.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1076)
    at com.clarionero.boletinesoficiales.b4xpagesmanager._showpageandremovepreviouspages(b4xpagesmanager.java:562)
    at com.clarionero.boletinesoficiales.b4xpages._showpageandremovepreviouspages(b4xpages.java:136)
    at com.clarionero.boletinesoficiales.b4xmainpage$ResumableSub_B4XPage_Created.resume(b4xmainpage.java:507)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
    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:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1764)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)

Rubén
 

Rubsanpe

Active Member
Licensed User
Hi. Yes, i open the layout and save it. Error again. Later i opened it again, activated Carousel option, deactivate it again and save the layout. Same result.

Rubén
 

Alexander Stolte

Expert
Licensed User
Longtime User
In all layouts where the view is used, this must be done. Unfortunately I can not change this, so the designer works with properties.
it must be because in the example project the error does not occur and according to your error message the error comes from it.
 

Rubsanpe

Active Member
Licensed User
Ok, it is working now. I was using the control also in another page, but the error wasn't pointing there.

Thank you for your fantastic work.

Rubén
 
Last edited:

angel_

Well-Known Member
Licensed User
Longtime User
Maybe you can do this:
 

hl88

Member
Hi, I'm planning in making a visual novel style app using this library
user must take a choice and use button to jump to another page, no swiping.
set Enable = false didn't do anything
 
Last edited:

fbritop

Active Member
Licensed User
Longtime User
thanks, but I always update the number there only when I also update the properties there, that I do not always because it is work. ^^
I see!!!. The thing it that leads to confusion now than you can click on the Libs tab on the IDE



Yo see 1.13 and you arrive at the post and the first thing you see is 1.12 until you scroll down.. it´s just a detail

cheers
FBP
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…