Sub initialiseView
If dashScroll.IsInitialized = False Then
dashboard.RootPanel.Color = Colors.LightGray
dashScroll.Initialize("dashScroll",100%x,45%y*currentContests.Size-1)
dashboard.RootPanel.AddView(dashScroll,0,0,100%x,100%y)
AddRefresh(dashScroll)
downlaoder.Initialize
Log("first"&45%y&" width"&dashboard.RootPanel.Height)
Else
dashScroll.Panel.RemoveAllViews
dashScroll.ContentHeight = 45%y*currentContests.Size-1
dashScroll.ContentWidth = 100%x
Log("secon"&45%y&" width"&dashboard.RootPanel.Height)
End If
For i=0 To currentContests.Size-1
Dim p As Panel
Dim iv As ImageView
Dim heading As Label
Dim description As Label
Dim photoNum As Label
Dim photoNumIcon As ImageView
Dim headingShadow As ImageView
Dim uploadPicIcon As ImageView
Dim m As Map
m=currentContests.Get(i)
p.Initialize("panel")
heading.Initialize("")
description.Initialize("")
photoNum.Initialize("")
photoNumIcon.Initialize("")
headingShadow.Initialize("")
uploadPicIcon.Initialize("uploadPicIcon")
p.Color=Colors.White
iv.Initialize("")
Main.downloadLinks.Put(iv,m.Get("cover_photo"))
heading.Text = m.Get("contest_name")
heading.Text = heading.Text.ToUpperCase
heading.TextColor=Colors.White
description.Text = m.Get("description")
description.TextColor=Colors.White
photoNum.Text = m.Get("photo_count")
photoNum.TextColor=Colors.White
photoNumIcon.Bitmap = LoadBitmap(File.DirAssets,"image_holder.png")
headingShadow.Bitmap = LoadBitmap(File.DirAssets,"shadow.png")
uploadPicIcon.Bitmap = LoadBitmap(File.DirAssets,"picture-add.png")
p.AddView(iv,0,0,100%x,45%y)
p.AddView(headingShadow,0,33%y,100%x,12%y)
p.AddView(heading,2%x,34%y,100%x,10%y)
p.AddView(description,2%x,40%y,100%x,4%y)
p.AddView(photoNum,10%x,3%y,10%x,5%y)
p.AddView(photoNumIcon,2%x,2%y,8%x,8%x)
p.AddView(uploadPicIcon,85%x,2%y,13%x,11%x)
uploadPicIcon.Tag=i
p.Tag=i
dashScroll.Panel.AddView(p,0,i*45%y,100%x,45%y)
Next
downlaoder.Download(Main.downloadLinks)
End Sub