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.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.
I have upload the wrong example project, sorryPlease re-check V1.6: The B4J example is displaying only an empty small window
Fixed in 1.7the DrawIndicators don't have the Height parameter in 2x calling lines.
Ok, with a few modifications like:the class is only resizing the Header
Public Sub getWidth As Int
Return mBase.Width
End Sub
Public Sub getHeight As Int
Return mBase.Height
End Sub
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
You dont need this, Because i have. .BaseView as a property.giving back the AS ViewSizes:
But the same result you have with .BackgroundImage = Loadbitmapresize...and changing the two lines in the GenImageViews-Sub:
Ahhhh i see ,this is the example Code not the code in the classPrivate 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
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
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
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:81)
at anywheresoftware.b4a.objects.B4XCanvas.Initialize(B4XCanvas.java:37)
at myapp.asonboarding._ini_views(asonboarding.java:673)
at myapp.asonboarding._base_resize(asonboarding.java:273)
at myapp.asonboarding._designercreateview(asonboarding.java:395)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:67)
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:292)
at myapp.main$ResumableSub_BuildLayout.resume(main.java:821)
at myapp.main._buildlayout(main.java:796)
at myapp.main$ResumableSub_Activity_Create.resume(main.java:500)
at myapp.main._activity_create(main.java:456)
at java.lang.reflect.Method.invoke(Method.java)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at myapp.main.afterFirstLayout(main.java:104)
at myapp.main.access$000(main.java:17)
at myapp.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Without code, idk.
Example:change text color
Dim tmp_btn as B4xview = asonboarding.getBackButton
tmp_btn.TextColor = xui.Color_Black
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.smooth swipe
Example:
B4X:Dim tmp_btn as B4xview = asonboarding.getBackButton tmp_btn.TextColor = xui.Color_Black
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.
is it possible to change color of the heading text and description ?
Thank you for update.
- V1.10
- Add getHeaderLabel
- Add getDescriptionLabel
is it possible change indicator active / passive color by code
IndicatorActiveColor
IndicatorInactiveColor
V1.11Could you calculate height of text because when i change font label can't show all text.
It's now possible on the AS Sliding Onboardingis swiping possible, too ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?