Private ASViewPager1 As ASViewPager
Private topPnl As B4XView
Private lblTime As B4XView
Private lblGreen As B4XView
In page create I have
For i = 0 To 6
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)
tmp_xpnl.LoadLayout("Test")
ASViewPager1.AddPage(tmp_xpnl,i)
Next
Sub ASViewPager1_PageChanged (index As Int)
Log("PageChanged: " & index)
B4XPages.SetTitle(Me,"ASViewPager Example | Page " & (index +1) & "/" & ASViewPager1.Size)
lblGreen.Text= "Test Page" (index +1)
End Sub