Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private BBCodeView1 As BBCodeView
Private TextEngine As BCTextEngine
Private BBLabel1 As BBLabel
Private Base As B4XView
Private PanelFileNameStr As String = "PrivacyIntro.txt"
Private PanelNameStr As String = "Introductie"
End Sub
Public Sub Show (Parent As B4XView)
Base = Parent
If Root.IsInitialized = False Then
InitView
End If
Root.RemoveViewFromParent
Parent.AddView(Root, 0dip, 40dip, B4XPages.MainPage.LayoutWidth, B4XPages.MainPage.LayoutHeight)
' Parent.AddView(mBase, 0, 0, 100%x, 100%y)
' TextEngine.Initialize(Root)
TextEngine.Initialize(B4XPages.MainPage.Drawer.CenterPanel)
BBCodeView1.TextEngine = TextEngine
BBCodeView1.mBase.Height = Base.Height - 110dip
BBCodeView1.mBase.Width = Base.Width -25dip
BBCodeView1.mBase.Top = Base.Top + 95dip
Log($"BBCodeView1.mBase.Width = ${BBCodeView1.mBase.Width}"$)
BBLabel1.mBase.Top = Base.Top + 45dip
Dim btn As Button
#if B4i
btn.Initialize("btn", btn.STYLE_SYSTEM)
#Else If B4J or B4A
btn.Initialize("btn")
#End If
Dim xbtn As B4XView = btn
If xui.IsB4i Then xbtn.SetColorAndBorder(xui.Color_Transparent, 1dip, xui.Color_Black, 2dip)
xbtn.Text = "Click!"
xbtn.SetLayoutAnimated(0, 0, 0, 100dip, 40dip)
Dim pnl As B4XView = xui.CreatePanel("")
pnl.SetLayoutAnimated(0, 0, 0, 200dip, 120dip)
BBCodeView1.Views.Put("btn", btn)
Dim Msg As String = File.ReadString(File.DirAssets, PanelFileNameStr)
' Log(BBCodeView1.Text)
' Log(Msg)
BBCodeView1.Text = Msg
B4XPages.MainPage.lblDashboardTitle.Text = "App - " & CallSub(Me,"GetName")
BBLabel1.Text = $"[FontAwesome=0xF17B size=30/] This is a [b]BB[color=0xff006688]Label[/color][/b] [img FileName="logo.png" height=30 vertical=8/]"$
End Sub
Private Sub InitView
Root = xui.CreatePanel("")
' Root.LoadLayout("Introduction")
B4XPages.MainPage.Drawer.CenterPanel.loadLayout("Introduction")
TextEngine.Initialize(B4XPages.MainPage.Drawer.CenterPanel)
BBCodeView1.TextEngine = TextEngine
End Sub