Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private scvText As ScrollView
Private lblText As Label
' Dim Times, Lucinda As Typeface
Dim obj1 As Reflector
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("longtext")
lblText.Initialize("lblText")
lblText.Color=Colors.RGB(255,255,161)
lblText.TextColor=Colors.Black
' Times=Typeface.LoadFromAssets("times.ttf")
' Lucinda=Typeface.LoadFromAssets("LHANDW.ttf")
' lblText.Typeface=Lucinda
obj1.Target = scvText ' a ScrollView
Dim args(3) As Object
args(0) = lblText
args(1) = -1
args(2) = -2
Dim types(3) As String
types(0) = "android.view.View"
types(1) = "java.lang.int"
types(2) = "java.lang.int"
obj1.RunMethod("removeAllViews")
obj1.RunMethod4("addView", args, types)
lblText.Text=File.GetText(File.DirAssets,"longtext.txt")
' search text?
Dim position As Int = 0 ' = search text...
scvText.ScrollPosition = position
End Sub