Android Question ASViewPager how to add a custom layout to each page?

Hi all, im using the ASViewPager library and works fine.

But i need change this code

B4X:
For i = 0 To 5
        Dim tmp_xpnl As B4XView = xui.CreatePanel("")
        tmp_xpnl.Color = xui.Color_ARGB(255,Rnd(1,255),Rnd(1,255),Rnd(1,255))
        tmp_xpnl.SetLayoutAnimated(0,0,0,ASViewPager1.Base.Width,ASViewPager1.Base.Height)

        ASViewPager1.AddPage(tmp_xpnl,"Test" & i)
    Next

This shows in each page a different color. I need create a layout in the designer and add in each page but changing the inside info. Any can help me?
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Hi all, im using the ASViewPager library and works fine.

But i need change this code

B4X:
For i = 0 To 5
        Dim tmp_xpnl As B4XView = xui.CreatePanel("")
        tmp_xpnl.Color = xui.Color_ARGB(255,Rnd(1,255),Rnd(1,255),Rnd(1,255))
        tmp_xpnl.SetLayoutAnimated(0,0,0,ASViewPager1.Base.Width,ASViewPager1.Base.Height)

        ASViewPager1.AddPage(tmp_xpnl,"Test" & i)
    Next

This shows in each page a different color. I need create a layout in the designer and add in each page but changing the inside info. Any can help me?
try

B4X:
  'Welcome Page
    Private p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
    p.LoadLayout("OnboardingHowto")
    
   ASVP.AddPage(p,1)
   
    ' Add Details page
    Private p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
    p.LoadLayout("OnboardingDetails")

    ASVP.AddPage(p,3)
 
Upvote 0
Top