Hi,
I have a ScrollView which contains ImageViews based on a mySQL database... the ScrollView can vary in length for different SQL queries.
My ScrollView is setup like this:
Once its populated the ScrollView with blank images it goes online and downloads the images. Then within my JobDone code I think I need to assign the downloaded images via the .tag.
My code for this looks like:
It all works as I want except that I can't populate the images with the ones I've just downloaded
Anyone able to point me in the right direction.
Thanks
Ben
I have a ScrollView which contains ImageViews based on a mySQL database... the ScrollView can vary in length for different SQL queries.
My ScrollView is setup like this:
B4X:
fanartPosterAllScrollView.Initialize(100%y)
Dim parser As JSONParser
Dim res As String
res = Response.GetString("UTF8")
parser.Initialize(res)
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.CallbackUrlDoneSub = "UrlDone"
detailedMediafanartPosterAllJob.Initialize
Log("All Fanart Result: " & res)
posterList = parser.NextArray
Log("Poster List Size: " & posterList.Size)
For i = 0 To posterList.Size - 1
Dim fanartPosterFullPath As String
Dim fanartFolder As String
Dim urlPath As String
Dim posterAll As Map
posterAll = posterList.Get(i)
fanartFolder = posterAll.Get("fanart_folder_name")
urlPath = posterAll.Get("url_path")
fanartPosterFullPath = "http://**.**.**.**/Fanart/" & fanartFolder & "/Poster/small" & urlPath
fanartPosterFullPath=fanartPosterFullPath.Replace(" ","%20")
Log("Fanart Poster Full Path: " & fanartPosterFullPath)
detailedMediafanartPosterAllJob.AddAll(Array As String(fanartPosterFullPath))
fanartPosterAllScrollView.Panel.LoadLayout("media_Detailed_Panel_Fanart_Layout")
media_Detailed_Fanart_All_Panel.Top = (media_Detailed_Fanart_All_Panel.Height+1)*i
media_Detailed_Fanart_All_Panel.Width=100%x
media_Detailed_Fanart_All_Panel.Tag = i
'The ImageView I need to populate
image_Fanart_Poster_All.Tag = i
Next
Activity.AddView(fanartPosterAllScrollView, 0, title_Panel.Height + message_Panel.Height, 100%x, 100%y)
fanartPosterAllScrollView.Panel.Height = (i*media_Detailed_Fanart_All_Panel.Height) + (i*1) + title_Panel.Height + message_Panel.Height
HttpUtils.DownloadList("detailedMediafanartPosterAllJob", detailedMediafanartPosterAllJob)
Response.Release
Once its populated the ScrollView with blank images it goes online and downloads the images. Then within my JobDone code I think I need to assign the downloaded images via the .tag.
My code for this looks like:
B4X:
Select Job
Case "detailedMediafanartPosterAllJob"
For i = 0 To HttpUtils.Tasks.Size - 1
link = HttpUtils.Tasks.Get(i)
Log(link & ": success=" & HttpUtils.IsSuccess(link))
'This is where I think I need to set each image using the .tag setup in the previous
'code but I'm not sure how to do it?
Next
End Select
HttpUtils.Complete = False
It all works as I want except that I can't populate the images with the ones I've just downloaded
Anyone able to point me in the right direction.
Thanks
Ben