Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
B4XPages.SetTitle(Me,"ASViewPagerNative Example")
Wait For B4XPage_Resize (Width As Int, Height As Int)
Dim lst As List
lst.Initialize
#If B4A
Dim xpnl As B4XView = xui.CreatePanel("")
xpnl.Color = Rnd(xui.Color_Black,xui.Color_White)
xpnl.SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
xpnl.LoadLayout("map")
lst.Add(xpnl)
#Else If B4I
Dim page As Page
page.Initialize("page")
page.RootPanel.Color = Rnd(xui.Color_Black,xui.Color_White)
page.RootPanel.As(B4XView).SetLayoutAnimated(0,0,0,Root.Width,Root.Height)
lst.Add(page)
#End If
ASViewPagerNative1.AddPages(lst,"")