Your Digital Media Has Never Looked So Good

 
krh5150
Topic Author
Posts: 48
Joined: Thu Mar 07, 2013 9:36 am

Styles for Grid List Question

Tue May 14, 2013 6:42 am

Can I specify a specific style for a specific row or is it only based on the type of media displayed (movie, series, episode) when using the mixed style?
 
User avatar
RokuRobB
Posts: 85
Joined: Tue Jul 10, 2012 3:07 pm

Re: Styles for Grid List Question

Sat May 18, 2013 5:50 pm

There is an undocumented grid screen API called SetListPosterStyles that you can use for this purpose, for example:

listStyles = ["landscape", "portrait", "landscape"]
screen.SetListPosterStyles(listStyles)

I will make a point to update the docs to include this function.
 
dustinhood
Posts: 23
Joined: Wed Jun 01, 2011 7:04 pm

Re: Styles for Grid List Question

Tue Jun 11, 2013 3:14 pm

Can someone elaborate on this?

I need 4 rows, the first 3 need to be portrait and the 4th needs to be landscape. I've tried the using the code below with no luck. Any suggestions?
BTW, I also have the ContentType of each item set to movie on the first 3 rows and episode on the 4th.

listStyles = ["landscape","portrait", "portrait", "portrait"]
screen.SetGridStyle("mixed-aspect-ratio")
screen.SetListPosterStyles(listStyles)
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Styles for Grid List Question

Fri Jun 14, 2013 8:40 am

dustinhood wrote:
Can someone elaborate on this?

I need 4 rows, the first 3 need to be portrait and the 4th needs to be landscape. I've tried the using the code below with no luck. Any suggestions?
BTW, I also have the ContentType of each item set to movie on the first 3 rows and episode on the 4th.

listStyles = ["landscape","portrait", "portrait", "portrait"]
screen.SetGridStyle("mixed-aspect-ratio")
screen.SetListPosterStyles(listStyles)

I believe you need to call SetupLists prior to calling SetListPosterStyles.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
dustinhood
Posts: 23
Joined: Wed Jun 01, 2011 7:04 pm

Re: Styles for Grid List Question

Tue Jun 18, 2013 10:48 am

TheEndless wrote:
dustinhood wrote:
Can someone elaborate on this?

I need 4 rows, the first 3 need to be portrait and the 4th needs to be landscape. I've tried the using the code below with no luck. Any suggestions?
BTW, I also have the ContentType of each item set to movie on the first 3 rows and episode on the 4th.

listStyles = ["landscape","portrait", "portrait", "portrait"]
screen.SetGridStyle("mixed-aspect-ratio")
screen.SetListPosterStyles(listStyles)

I believe you need to call SetupLists prior to calling SetListPosterStyles.


You are correct, putting screen.SetListPosterStyles() after screen.setupLists() did the trick! Thanks TheEndless!!!!

So here it is again for those that are having trouble:

screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)

listStyles = ["landscape","portrait", "portrait", "portrait"]

screen.SetGridStyle("mixed-aspect-ratio")
screen.SetListPosterStyles(listStyles)
 
j.saterfiel
Posts: 3
Joined: Mon Jun 24, 2013 8:29 am

Re: Styles for Grid List Question

Mon Jun 24, 2013 8:41 am

I've tried to make this undocumented grid functionality work without avail.

I tried to use this functionality with the same code for the grid screen but nothing seems to affect it:

Sub Main()
   port = CreateObject("roMessagePort")
    grid = CreateObject("roGridScreen")
    grid.SetMessagePort(port)
    rowTitles = CreateObject("roArray", 4, true)
    for j = 0 to 3
        rowTitles.Push("[Row Title " + j.toStr() + " ] ")
    end for
    grid.SetupLists(rowTitles.Count())
    grid.SetListNames(rowTitles)
    listStyles = ["landscape","portrait", "portrait", "portrait"]

   grid.SetGridStyle("mixed-aspect-ratio")
   grid.SetListPosterStyles(listStyles)
   
    for j = 0 to 3
    list = CreateObject("roArray", 10, true)
    for i = 0 to 10
             o = CreateObject("roAssociativeArray")
             o.ContentType = "episode"
             o.Title = "[Title" + i.toStr() + "]"
             o.ShortDescriptionLine1 = "[ShortDescriptionLine1]"
             o.ShortDescriptionLine2 = "[ShortDescriptionLine2]"
             o.Description = ""
             o.Description = "[Description] "
             o.Rating = "NR"
             o.StarRating = "75"
             o.ReleaseDate = "[<mm/dd/yyyy]"
             o.Length = 5400
             o.Actors = []
             o.Actors.Push("[Actor1]")
             o.Actors.Push("[Actor2]")
             o.Actors.Push("[Actor3]")
             o.Director = "[Director]"
             list.Push(o)
         end for
         grid.SetContentList(j, list)
     end for
     grid.Show()
     while true
         msg = wait(0, port)
         if type(msg) = "roGridScreenEvent" then
             if msg.isScreenClosed() then
                 return
             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();
                 print " col: ";msg.GetData()
             endif
         endif
     end while
end Sub
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Styles for Grid List Question

Mon Jun 24, 2013 9:10 am

Try calling SetGridStyle before calling SetupLists, SetListNames, and SetListPosterStyles.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
j.saterfiel
Posts: 3
Joined: Mon Jun 24, 2013 8:29 am

Re: Styles for Grid List Question

Tue Jun 25, 2013 10:30 am

Excellent that fixed the issue thanks :D
 
MatroxRT
Posts: 27
Joined: Thu Mar 12, 2015 2:03 pm

Re: Styles for Grid List Question

Fri Apr 24, 2015 7:31 pm

Looks like ifGridScreen.SetListPosterStyles is no longer undocumented. :)

Who is online

Users browsing this forum: No registered users and 7 guests