Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private btnlarger As Button
Private btnsmaller As Button
Private clvphrases As CustomListView
Private inttextsize As Int = 16 ' set the initial textsize!
End Sub
Public Sub Initialize
B4XPages.GetManager.LogEvents = True
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
For i = 0 To 4
clvphrases.AddTextItem("text item "& i,"item" & i)
Next
End Sub
Private Sub btnsmaller_Click
inttextsize = inttextsize - 2
clvphrases.DesignerLabel.TextSize = inttextsize
For i = 0 To 4
clvphrases.GetPanel(i).GetView(0).SetTextSizeAnimated(0,inttextsize)
Next
'clvphrases.Refresh 'don't work to change the text size without reload the items
End Sub
Private Sub btnlarger_Click
inttextsize = inttextsize + 2
clvphrases.DesignerLabel.TextSize = inttextsize
For i = 0 To 4
clvphrases.GetPanel(i).GetView(0).SetTextSizeAnimated(0,inttextsize)
Next
'clvphrases.Refresh 'don't work to change the text size without reload the items
End Sub
Private Sub clvphrases_ItemClick (Index As Int, Value As Object)
Dim intlarge As Int = inttextsize + 8
clvphrases.GetPanel(Index).GetView(0).SetTextSizeAnimated(0,intlarge)
clvphrases.GetPanel(Index).GetView(0).SetColorAndBorder(xui.Color_Yellow,0,0,0)
End Sub