#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger: True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private MyCLV As CustomListView
Private Button1 As Button
Private InputSlider1 As InputSlider
Private Label1 As Label
Type ItemValue5 (Button1 As Button, InputSlider1 As InputSlider, Label1 As Label)
Dim xui As XUI
Dim Zash=0
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
InputSlider1.SetMaxVal(10)
For i = 1 To 10
Dim iv5 As ItemValue5
iv5.Initialize
MyCLV.Add(CreateItem5(iv5,"Test"&i,i),iv5)
Next
Zash=1
End Sub
Sub CreateItem5(iv5 As ItemValue5,Title_5 As String,ind As Int) As Panel
Dim p5 As Panel
p5.Initialize("")
Activity.AddView(p5, 0, 0, 100%x,20%y)
p5.LoadLayout("Item")
p5.RemoveView 'remove from parent
Button1.Text = Title_5
Label1.Text=ind
InputSlider1.SetValue(ind)
Return p5
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Dim index As Int = MyCLV.GetItemFromView(Sender)
Dim pnl As Panel = MyCLV.GetPanel(index)
Dim sb As InputSlider = pnl.GetView(1)
sb.SetValue(20)
End Sub
Sub InputSlider1_ValueChanged(Value As Int)
If Zash=1 Then
Dim index As Int= MyCLV.GetItemFromView(Sender)
Dim pnl As Panel = MyCLV.GetPanel(index)
Dim lbl As Label = pnl.GetView(2)
lbl.Text=Value
End If
End Sub