Sub Globals
Private scvTest As ScrollView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
Private ref As Reflector
ref.Target = scvTest
ref.SetOnTouchListener("scvTouchRef")
FillScrollView
End Sub
Private Sub FillScrollView
Private i As Int
Private Height0, Height1 As Int
Height0 = 40dip
Height1 = Height0 - 2dip
For i = 0 To 50
Private lbl As Label
lbl.Initialize("Labels")
scvTest.Panel.AddView(lbl, 0, i * Height0, scvTest.Width, Height1)
lbl.Color = Colors.Blue
lbl.TextColor = Colors.Yellow
lbl.Text = "Test " & i
lbl.Tag = i
Next
scvTest.Panel.Height = i * Height0
End Sub
Private Sub scvTouchRef(Viewtag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
Select Action
Case Activity.ACTION_DOWN
Log("DOWN")
Case Activity.ACTION_MOVE
Log("MOVE")
Case Activity.ACTION_UP
Log("UP")
End Select
End Sub
Private Sub Labels_Click
Private lbl As Label
lbl = Sender
Log(lbl.Text)
End Sub