please help want to select a movie without having to wait to load all content
my code GridScreen
Sub showMoviesScreen()
dlg = CreateObject("roOneLineDialog")
dlg.setTitle("Loading Collection")
dlg.showBusyAnimation()
dlg.show()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetGridStyle("flat-portrait")
screen.SetDescriptionVisible(true)
screen.SetBreadcrumbText("Movies", "Session")
categoryList = getCategoryListMovies()
categoryCount = categoryList.count()
seriesList = CreateObject("roList")
screen.SetupLists(categoryCount)
screen.ClearMessage()
screen.show()
screen.setListNames(categoryList)
for i = 0 to categoryCount-1
print "id = "; i; " categoria = "; categoryList[i]
contentList = getMoviesByCategory(categoryList[i])
seriesList[i] = contentList
screen.SetContentList(i,contentList)
screen.ClearMessage()
end for
screen.ClearMessage()
screen.show()
dlg.close()
clock = CreateObject("roTimespan")
next_call = clock.TotalMilliseconds() + 36000
while (true)
msg = wait(250, port)
if msg <> invalid and type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
exit while
else if msg.isStatusMessage()
mensaje = msg.getMessage()
status = msg.GetIndex()
else if msg.isPlaybackPosition()
nowpos = msg.GetIndex()
print "Tiempo conectado: "; nowpos
else if msg.isListItemFocused()
print "Focused msg: ";msg.GetMessage();"row: ";msg.GetIndex();
print " col: ";msg.GetData()
else if msg.isListItemSelected()
print "Selected msg: ";msg.GetMessage();"row: ";msg.GetIndex();
'selection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]
row = msg.GetIndex()
col = msg.GetData()
list = seriesList.GetEntry(msg.GetIndex())
if list <> invalid then
selection = list[msg.GetData()]
end if
if (row=0 and col=0) then
searchMovies()
else if (row=0 and col=1) then
FavoritesMovies()
else
'showSpringboardScreenMovies(list,selection)
showSpringboardScreenMovies(list,msg.GetData())
end if
else
print "Unexpected msg type: "; msg.GetType()
print "mensaje: "; msg.getMessage()
end if
end if
if clock.TotalMilliseconds() > next_call then
next_call = clock.TotalMilliseconds() + 36000
end if
end while
End Sub
Function getCategoryListMovies() as object
http = NewHTTP(ServidorRoku()+"/categorias.json")
http.AddParam("t", "peliculas")
response= http.GetToStringWithTimeout(90)
json = ParseJSON(response)
return json
End Function
Function getMoviesByCategory(category)
http = NewHTTP(ServidorRoku()+"/movie.json")
http.AddParam("cat", category)
response= http.GetToStringWithTimeout(90)
json = ParseJSON(response)
return json.Videos
End Function