Sub Globals
Dim clv As CustomListView
Dim Label1 As Label
Dim ImageView1 As ImageView
Dim ImageViews As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
CallSubDelayed(DownloadListService, "StartDownload")
End If
ImageViews.Initialize
clv.Initialize(Me, "clv")
Activity.AddView(clv.AsView, 0, 0, 100%x, 100%y)
End Sub
Sub Activity_Resume
CallSubDelayed(DownloadListService, "AfterActivityResume")
End Sub
Sub ShowImage(Image As Bitmap, Index As Int)
If ImageViews.Size > Index Then
Dim iv As ImageView = ImageViews.Get(Index)
iv.SetBackgroundImage(Image)
End If
End Sub
Sub CreateItems(links As List)
If clv.GetSize > 0 Then Return
For Each link As String In links
Dim p As Panel
p.Initialize("")
clv.Add(p, 50dip, link)
p.LoadLayout("ListItem")
Label1.Text = link
ImageViews.Add(ImageView1)
Next
End Sub
Sub clv_ItemClick (Index As Int, Value As Object)
Activity.Title = Value
Dim IV As ImageView = Sender
Activity.SetBackgroundImage(IV.Bitmap)
End Sub