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

Sandman

Expert
Licensed User
Longtime User
The xCustomListview was not good enough for desktop use, it often gave me a stomach ache. So I decided to develop a custom pager for the AS_ViewPager for B4J.
I'm just curious, is there a reason for why you don't use jPager for B4A and B4i also?

I mean, so you could somewhat simplify your codebase and only interact with a single pager.
 

Alexander Stolte

Expert
Licensed User
Longtime User
I'm just curious, is there a reason for why you don't use jPager for B4A and B4i also?
Because jPager are simply panels that are made visible or made invisible. If I would also use this in B4A or B4I, then you lose the possibility to change the page with a slide animation with your finger. This only makes sense on desktop devices that do not have touch.

I mean, so you could somewhat simplify your codebase and only interact with a single pager.
I created the jPager because the xCustomListView in B4J is not so well suited for a ViewPager. e.g. whenever I changed the page with the arrow keys, the list was moved briefly and only then changed, this could not be turned off and was not a nice behavior. There were a few other things that made me create a jPager for the B4J version.
 

Sandman

Expert
Licensed User
Longtime User
Ah, understood. And I imagine it's just too much work adding swipe-functionality to jPager to make sense. Thanks for explaining.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.08
    • B4I - PageChange event is now triggered as soon as you lift your finger when changing pages, just like in B4A
    • B4J - You need jPager V1.03
    • Add AllowNext
      • Default: True
      • If False: Prevents the user from moving to the next page
        • The NextPage function will not work
        • The CurrentIndex property can be used without restrictions
    • Add AllowBack
      • Default: True
      • If False: Prevents the user from moving to the previous page
        • The PreviousPage function will not work
        • The CurrentIndex property can be used without restrictions
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
Don't use autoscale in the layouts that are added to the viewpager.

Just noticed this warning in the first page: I'm not sure it was there when I first started using the viewpagers, as all my layouts use AutoScaleAll in the designer script without noticing anything.
What is the issue? Does it affect some platforms/views specifically?
 

Alexander Stolte

Expert
Licensed User
Longtime User
What is the issue? Does it affect some platforms/views specifically?
The problem has always been that you should not use AutoScale if you use the xCustomLisView, since the ViewPager is based on it, it can lead to strange behavior of the layout if you leave it in. Since someone in the forum recently had a problem that caused AutoScale, I have included it in the description.

Next time create a new thread for questions, thanks.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…