Sub JobDone(Job As HttpJob)
If Job.Success = False Then
Log("Error: " & Job.ErrorMessage)
Else
If Job.JobName = "DBRequest" Then
'ScrollView1.Panel.RemoveAllViews
ActivityIndicator1.Visible = True
Dim result As DBResult = reqManager.HandleJob(Job)
'reqManager.PrintTable(result)
If Job.Tag = "select_animal" Then
For i = 0 To result.Rows.Size-1
Dim items() As Object = result.Rows.Get(i)
Dim panel1 As Panel
Dim label1 As Label
Dim baslik As Label
Dim pic1 As ImageView
panel1.Initialize("panel1")
panel1.Color = Colors.White
panel1.SetBorder(0,0,5)
pic1.Initialize("pic1")
label1.Initialize("label1")
label1.AdjustFontSizeToFit = False
baslik.Initialize("baslik")
baslik.Font = Lbl.Font
label1.Font = lbl2.Font
pic1.Bitmap = reqManager.BytesToImage(items(0))
baslik.Text = yk & "-" &items(1)
label1.Text = items(2) & "-" &yk
If sol < sag Then
ScrollView1.Panel.AddView(panel1,(5),(sol),(ScrollView1.Width/2-10),((pic1.bitmap.Height/pic1.bitmap.Width*ScrollView1.Width/2)+200))
panel1.AddView(pic1,0,0,panel1.Width,(pic1.bitmap.Height/pic1.bitmap.Width*panel1.Width))
sol = panel1.Top+panel1.Height + 10
Else
ScrollView1.Panel.AddView(panel1,(ScrollView1.Width/2 +5),(sag),(ScrollView1.Width/2-10),((pic1.bitmap.Height/pic1.bitmap.Width*ScrollView1.Width/2)+200))
panel1.AddView(pic1,0,0,panel1.Width,(pic1.bitmap.Height/pic1.bitmap.Width*panel1.Width))
sag = panel1.Top+panel1.Height +10
End If
baslik.Text = yk & "-" &items(1) & "-" & ScrollView1.Panel.NumberOfViews
label1.Multiline = True
pic1.ContentMode = pic1.MODE_FILL
panel1.AddView(baslik,2,pic1.Height,panel1.Width,20)
panel1.AddView(label1,2,pic1.Height+20,panel1.Width,(panel1.Height-pic1.Height-40))
label1.TextAlignment = label1.ALIGNMENT_LEFT
Dim cnv As Canvas
cnv.Initialize(panel1)
cnv.DrawLine(0,baslik.Top+20,panel1.Width,baslik.Top+20,Colors.red,1)
cnv.DrawLine(0,panel1.Height - 25,panel1.Width,panel1.Height - 25,Colors.LightGray,1)
cnv.Refresh
yk = yk + 1
Next
End If
End If
End If
ActivityIndicator1.Visible = False
ykb = False
If sol > sag Then
ScrollView1.ContentHeight = sol + 10
Else
ScrollView1.ContentHeight = sag + 10
End If
Job.Release
End Sub