B4A Library [B4X] [XUI] AS Sliding Onboarding (based on ASViewPager)

asales

Expert
Licensed User
Longtime User
Great work!

2 questions:

1 - Is possible to use BCTextEngine to create a page?
I want to add a button in description text to raise an action (get permission from the user) in a simple way.

2 - How can a load a custom layout to one page and use texts in the others?

Thanks!
 

asales

Expert
Licensed User
Longtime User
2 - How can a load a custom layout to one page and use texts in the others?
Add a blank page and after load the layout. Correct?
B4X:
ASSlidingOnboarding1.AddPage("", "", 0, GenImageViews("1.png"), "")
ASSlidingOnboarding1.getPageBackgroundPanel(0).LoadLayout("page1")
 

asales

Expert
Licensed User
Longtime User
I put an app in Play Store and - in some devices - I get the error below in Crashlytics.
What could be the problem?
Thanks for your support!
B4X:
asslidingonboarding._ini_views
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1113)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1080)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1030)
at android.graphics.Bitmap.createBitmap(Bitmap.java:991)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:81)
at anywheresoftware.b4a.objects.B4XCanvas.Initialize(B4XCanvas.java:54)
at br.com.myprofiles.asslidingonboarding._ini_views(asslidingonboarding.java:508)
at br.com.myprofiles.asslidingonboarding._designercreateview(asslidingonboarding.java:284)
B4X:
    ASSlidingOnboarding1.AddPage("Check the new options","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis fermentum nunc, et egestas tellus.", 0xFF27A3DF, GenImageViews("premium.png"),"")
   
    ASSlidingOnboarding1.AddPage("", "", 0, GenImageViews("logo.png"), "")
    ASSlidingOnboarding1.getPageBackgroundPanel(2).LoadLayout("page3")
    Dim bmp As B4XBitmap = xui.LoadBitmap(File.DirAssets, "logo_600.png")
    FitImageToView(bmp, ivPage3)
    cs.Initialize.Bold.Size(22).Append("Turn on the notification !").Pop.Pop.Append(CRLF).Append(CRLF).Append("Do you want to receive NOTICES and REMINDERS ?")
    cs.Append(CRLF).Append("Click in ACTIVATE ").Size(18).Typeface(Typeface.FONTAWESOME).Append(Chr(0xF0F3)).Pop.Pop.Append(CRLF).Append(CRLF)
    cs.PopAll
    lbInfo33.Text = cs
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
1 - Is possible to use BCTextEngine to create a page?
No it is not possible.
2 - How can a load a custom layout to one page and use texts in the others?
Something like this:
B4X:
ASSlidingOnboarding1.ViewPager.GetPanel(0).LoadLayout("")
I put an app in Play Store and - in some devices - I get the error below in Crashlytics.
What could be the problem?
I don't know, in the sub where this occurs I have already specified 1dip as minimum for the panel that works with canvas.
 

asales

Expert
Licensed User
Longtime User
Something like this:
B4X:
ASSlidingOnboarding1.ViewPager.GetPanel(0).LoadLayout("")
This?
B4X:
ASSlidingOnboarding1.AddPage("", "", 0, GenImageViews2("1.png"), "")
ASSlidingOnboarding1.ViewPager.GetPanel(0).LoadLayout("page1")

Instead this?
B4X:
ASSlidingOnboarding1.AddPage("", "", 0, GenImageViews2("1.png"), "")
ASSlidingOnboarding1.getPageBackgroundPanel(0).LoadLayout("onpage1")

Or could use both?

How can I pass a null value in the parameter (headerlayout) - GenImageViews2("1.png"):
B4X:
ASSlidingOnboarding1.AddPage("", "", 0, GenImageViews2("1.png"), "")
 

Alexander Stolte

Expert
Licensed User
Longtime User
Or could use both?
Use what works.
How can I pass a null value in the parameter (headerlayout) - GenImageViews2("1.png"):
B4X:
ASSlidingOnboarding1.AddPage("Test","Description",xui.Color_Red,xui.CreatePanel(""),"")
Depends on what you want to do. It would also be super easy with AS_ViewPager to just develop your own onboarding screen, there you have 100% control.
 

asales

Expert
Licensed User
Longtime User

I don't know, in the sub where this occurs I have already specified 1dip as minimum for the panel that works with canvas.
I found this thread:
Could be related to the problem that I mentioned about this crashlytics error?
 

asales

Expert
Licensed User
Longtime User
Maybe, found it out. I have changed all the lines with Max(2dip,
I updated an app with the new version, but the errors remains in Crashlytics.
I checked this behaviour and it seems that occurs in a few devices (OnePlus8Pro - Android 11, Nexus 5X - Android 6.0.1).

I think this devices is using by Google to test the app before publish in Play Store.
It's because I published the app and the crashlytics report me this error before the version released in the store (the update is still pending).
I don't know what this devices has to cause this errors .
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 2.00
    • Complete lib. rewrite with new name
Breaking changes
Version 2 is not compatible with version 1, which means you have to add the view in the designer again, because the name has changed. Best is to delete the old lib. from the lib. folder.
 

Mattiaf

Active Member
Licensed User
I might be dumb, but i don't understand how to close the entire view once the user clicks on Get started button...
 

asales

Expert
Licensed User
Longtime User
I might be dumb, but i don't understand how to close the entire view once the user clicks on Get started button...
B4X:
Sub ASSlidingOnboarding1_GetStartedButtonClick
    B4XPages.ClosePage(Me)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…