B4A Class [B4X] [XUI] AS Onboarding

Alexander Stolte

Expert
Licensed User
Longtime User
Thanks. It would be great if you add also a setting to keep the ratio of the add picture instead of stretch it to the size of the header. Sure that pic should be centred than.
The Header is not a image, you can put a image in the header, but the header is a B4xView it can also be a panel with parents. So you have the controll over the header, not the Class, the class is only resizing the Header if the width or height of the view is changed.
 

Gunther

Active Member
Licensed User
Longtime User
Please re-check V1.6: The B4J example is displaying only an empty small window

the DrawIndicators don't have the Height parameter in 2x calling lines.

As requested by the 'Private Sub DrawIndicators(Height As Float)'
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Please re-check V1.6: The B4J example is displaying only an empty small window
I have upload the wrong example project, sorry

the DrawIndicators don't have the Height parameter in 2x calling lines.
Fixed in 1.7

-V1.7
  • Add BackgroundImage
  • Add TagOfPage Set or Get the Tag on a Index
Background Image
 

Gunther

Active Member
Licensed User
Longtime User
the class is only resizing the Header
Ok, with a few modifications like:

  • giving back the AS ViewSizes:
B4X:
Public Sub getWidth As Int
   
    Return mBase.Width
   
End Sub
Public Sub getHeight As Int
   
    Return mBase.Height
   
End Sub

  • and changing the two lines in the GenImageViews-Sub:
B4X:
Private Sub GenImageViews(ImageName As String) As ImageView
   
    Private ImageView1 As ImageView
    ImageView1.Initialize("")
    ImageView1.SetLayoutAnimated(0,0,0, Activity.Width, Activity.Height*ASOnboarding1.Header_Size/100)
    ImageView1.Bitmap = xui.LoadBitmapResize(File.DirAssets,ImageName, ASOnboarding1.Width, ImageView1.Height, True)
    Return ImageView1
   
End Sub

The result is like I would like to have it. Thanks again.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Ahhhh i see ,this is the example Code not the code in the class
 

Alexander Stolte

Expert
Licensed User
Longtime User
B4X:
Private Sub GenImageViews(ImageName As String) As ImageView
  
    Private ImageView1 As ImageView
    ImageView1.Initialize("")
    ImageView1.SetLayoutAnimated(0,0,0, MainForm.RootPane.Width, MainForm.RootPane.Height*ASOnboarding1.Header_Size/100)
    #If B4J
    ImageView1.SetImage(xui.LoadBitmapResize(File.DirAssets,ImageName, ASOnboarding1.BaseView.Width, ImageView1.Height, True))
    #Else
    
     ImageView1.Bitmap = xui.LoadBitmapResize(File.DirAssets,ImageName, ASOnboarding1.BaseView.Width, ImageView1.Height, True)
    #End If
  
    Return ImageView1
  
End Sub
 

fredo

Well-Known Member
Licensed User
Longtime User
Nice solution!

Unfortunately I get this error message:


Which lead to:

Any ideas what I can do?
 

Alexander Stolte

Expert
Licensed User
Longtime User
change text color
Example:
B4X:
Dim tmp_btn as B4xview = asonboarding.getBackButton
tmp_btn.TextColor = xui.Color_Black

smooth swipe
No, because this is not based on a listview or tabstrip, but maybe i have the motivation in the next days, to make a 2.0 Version based on the xCustomListview, now i have some experience with that, like in my AS ColorChooser, this is based on the xCustomListview.
 

ykucuk

Well-Known Member
Licensed User
Longtime User

Thank you for reply.

is it possible to change color of the heading text and description ?
 

ykucuk

Well-Known Member
Licensed User
Longtime User
  • V1.10
    • Add getHeaderLabel
    • Add getDescriptionLabel
Thank you for update.

-Could you calculate height of text because when i change font label can't show all text.
-is it possible change indicator active / passive color by code

thank you
 

Alexander Stolte

Expert
Licensed User
Longtime User
is it possible change indicator active / passive color by code
B4X:
IndicatorActiveColor
IndicatorInactiveColor

Could you calculate height of text because when i change font label can't show all text.
V1.11
  • Removed a unusded Variable
  • Add AutomaticCalculateDescriptionTextHeight Property, set it to true and the description text height adapts automatically to the text
But i dont have test it, i used the same code as in my B4X AutoTextSizeLabel
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…