Your Digital Media Has Never Looked So Good

 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Mon Jun 27, 2016 5:23 am

I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

m.homeScreenRowList = m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID)
m.homeScreenRowList.id = componentsName.SG_HOMESCREEN
m.homeScreenRowList.rowHeights = getRowDimensions(m.response, false , sgConfig.ROW_MENU_ITEM_SIZE[1])
m.homeScreenRowList.rowItemSize = rowItemSize

RowItemSize is a variable that holds the values for the rowItemSize
Here is the output :
printing row item size from variable
item size is <Component: roArray> =
[
     264
     110
]
item size is <Component: roArray> =
[
     264
     149
]
item size is <Component: roArray> =
[
     165
     247
]
item size is <Component: roArray> =
[
     264
     149
]
item size is <Component: roArray> =
[
     264
     149
]
item size is <Component: roArray> =
[
     264
     149
]
item size is <Component: roArray> =
[
     165
     247
]
item size is <Component: roArray> =
[
     165
     247
]
item size is <Component: roArray> =
[
     165
     247
]
item size is <Component: roArray> =
[
     264
     149
]   


But if I try to print what's in m.homeScreenRowList.rowItemSize I will get only the values that were set when init function of the component ran.This method of changing the rowItemSize attribute worked fine before 7.2.

output:
printing rowList rowItemSize attribute 
 <Component: roArray> =
[
     264
     149
]
Last edited by dacian_roman23 on Tue Jul 05, 2016 3:09 am, edited 1 time in total.
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Beta Scene Graph Components

Mon Jun 27, 2016 5:42 pm

dacian_roman23 wrote:
I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

I am having really hard time trying to understand your example. Case might be something i am interested in but IDK.
Can you give very specific example "when i do this - it works" vs "when i do that - it doesn't" - and also put them in [ code] [/code] brackets?
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Mon Jun 27, 2016 11:18 pm

EnTerr wrote:
dacian_roman23 wrote:
I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

I am having really hard time trying to understand your example. Case might be something i am interested in but IDK.
Can you give very specific example "when i do this - it works" vs "when i do that - it doesn't" - and also put them in [ code] [/code] brackets?



I have one component called rowListGrid that extends the rowList component and has the rowListGrid.brs script for it.If I try to set the rowItemSize attribute in the init function of the script ..everything works as expected (m.rowGridConfig is just an associative array holding some constants).. for example
   function init()
    componentsName =                     getComponentsNameConstants()
    m.rowGridConfig =                       getRowGridConfig()
    m.top.visible =                               false

   m.top.itemComponentName =       componentsName.SG_ROW_LIST_ITEM
    m.top.translation =                         m.rowGridConfig.TRANSLATION
   
    m.top.itemSize =                            m.rowGridConfig.ITEM_SIZE
    m.top.itemSpacing =                      m.rowGridConfig.ITEM_SPACING
   
    m.top.showRowLabel =               true
    m.top.rowLabelFont =                 getFontForRowHeader()
    m.top.rowLabelColor =                m.rowGridConfig.WHITE_COLOR
    m.top.rowLabelOffset =               m.rowGridConfig.ROW_LABEL_OFFSET

    m.top.rowHeights =                      m.rowGridConfig.ROW_HEIGHTS
    m.top.rowItemSize =                     m.rowGridConfig.ROW_ITEM_SIZE
    m.top.rowSpacings =                    m.rowGridConfig.ROW_SPACINGS
    m.top.rowItemSpacing =               m.rowGridConfig.ROW_ITEM_SPACING
    m.top.rowFocusAnimationStyle =  "fixedFocusWrap"
    m.top.focusXOffset =                     [0.0]'
end function



But if i'm trying to do this for example in main.brs script or in any other script file that runs under the main brightscript thread, it will not overwrite the value for the rowItemSize that was set in the init function of the rowListGrid.brs...although I have used this approach and worked fine before 7.2

 
    m.homeScreenRowList =                            m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID)      ' this is my component that extends the row list component, and please      note that this triggers the init function mentioned above

    m.homeScreenRowList.id =                        componentsName.SG_HOMESCREEN
    m.homeScreenRowList.rowItemSize =        getRowDimensions(m.response, true , sgConfig.ROW_MENU_ITEM_SIZE)  'this function returns an array with arrays with the dimensions needed 
    m.homeScreenRowList.showRowLabel =   [false, true]
    m.homeScreenRowList.rowSpacings =      [sgConfig.ROW_MENU_MARGIN_BOTTOM] 'just a constant value
    m.homeScreenRowList.rowHeights =         getRowDimensions(m.response, false , sgConfig.ROW_MENU_ITEM_SIZE[1]) 'returning an array with heights for the rowHeights attribute
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Tue Jun 28, 2016 12:30 am

Here is another output for this code
    sgConfig =                            getRowGridConfig()

    rowItemSize =                       getRowDimensions(m.response, true , sgConfig.ROW_MENU_ITEM_SIZE)
    componentsName =             getComponentsNameConstants()
    m.homeScreenRowList =     m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID)
   
    print "printing rowItemSize variable"
    print rowItemSize

    print "-----------------------------"

    print "printing rowItemSize values"
   
    for each itemSize in rowItemSize
        print itemSize
    end for

    stop
    m.homeScreenRowList.rowItemSize =   []
    m.homeScreenRowList.rowItemSize =   rowItemSize
    stop


And here is some output from the debugger
==================================
printing rowItemSize variable
<Component: roArray> =
[
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
     264
     110
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.


Current Function:
070:      print "-----------------------------"
071: 
072:      print "printing rowItemSize values"
073:     
074:      for each itemSize in rowItemSize
075:          print itemSize
076:      end for
077: 
078:*     stop
079:      m.homeScreenRowList.rowItemSize =   []
080:      m.homeScreenRowList.rowItemSize =   rowItemSize
081:      stop
082:     
STOP (runtime error &hf7) in pkg:/source/appHome.brs(78)
078:     stop
Backtrace:
#5  Function homescreen_handlefetchsuccess() As Dynamic
   file/line: pkg:/source/appHome.brs(79)
#4  Function homescreen_populatescreen() As Dynamic
   file/line: pkg:/source/appHome.brs(47)
#3  Function homescreen_show() As Dynamic
   file/line: pkg:/source/appHome.brs(36)
#2  Function app_showhomescreen() As Dynamic
   file/line: pkg:/source/app.brs(95)
#1  Function app_show(startingpage As Object) As Void
   file/line: pkg:/source/app.brs(87)
#0  Function runuserinterface(ecp As Dynamic) As Dynamic
   file/line: pkg:/source/main.brs(22)
Local Variables:
global           rotINTERFACE:ifGlobal
m                roAssociativeArray refcnt=7 count:16
sgconfig         roAssociativeArray refcnt=1 count:37
rowitemsize      roArray refcnt=1 count:10
componentsname   roAssociativeArray refcnt=1 count:17
itemsize         roArray refcnt=6 count:2

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
    <Component: roArray>
]

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize[0]  --- this is the default value that was set in the init function
<Component: roArray> =
[
     264
     149
]

BrightScript Debugger> s
079:     m.homeScreenRowList.rowItemSize =   []

BrightScript Debugger> ? m.homescreenrowlist.rowItemSize  -- so far, so good  .. i have changed the rowItemSize attribute to an empty array
<Component: roArray> =
[
]

BrightScript Debugger> ? rowItemSize   -- checking my rowItemSize variable again
<Component: roArray> =
[
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
]

BrightScript Debugger> s
080:     m.homeScreenRowList.rowItemSize =   rowItemSize     --  setting the rowItemSize attribute again

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize   
<Component: roArray> =
[
]                                           ---- i should see the values printed above, right ?  :(  :(

Here is the different output - using 7.1 firmware - but the same code
===================================================
printing rowItemSize variable
<Component: roArray> =
[
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
     264
     110
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.


Current Function:
072:     
073:      print "printing rowItemSize values"
074:     
075:      for each itemSize in rowItemSize
076:          print itemSize
077:      end for
078: 
079:     
080:*     stop
081:      m.homeScreenRowList.rowItemSize =   []
082:      m.homeScreenRowList.rowItemSize =   rowItemSize
083:      stop
084:     
STOP (runtime error &hf7) in pkg:/source/appHome.brs(80)
080:     stop
Backtrace:
#5  Function homescreen_handlefetchsuccess() As Dynamic
   file/line: pkg:/source/appHome.brs(81)
#4  Function homescreen_populatescreen() As Dynamic
   file/line: pkg:/source/appHome.brs(47)
#3  Function homescreen_show() As Dynamic
   file/line: pkg:/source/appHome.brs(36)
#2  Function app_showhomescreen() As Dynamic
   file/line: pkg:/source/app.brs(95)
#1  Function app_show(startingpage As Object) As Void
   file/line: pkg:/source/app.brs(87)
#0  Function runuserinterface(ecp As Dynamic) As Dynamic
   file/line: pkg:/source/main.brs(22)
Local Variables:
global           rotINTERFACE:ifGlobal
m                roAssociativeArray refcnt=7 count:16
sgconfig         roAssociativeArray refcnt=1 count:37
rowitemsize      roArray refcnt=1 count:11
componentsname   roAssociativeArray refcnt=1 count:17
itemsize         roArray refcnt=7 count:2

BrightScript Debugger> s
081:     m.homeScreenRowList.rowItemSize =   []

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
]

BrightScript Debugger> s
082:     m.homeScreenRowList.rowItemSize =   rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
]

BrightScript Debugger>

Last edited by dacian_roman23 on Tue Jul 05, 2016 3:10 am, edited 1 time in total.
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Tue Jun 28, 2016 2:10 am

In 7.2 .0 - build 4091-04 it looks like I am not able to set a rowItemSize to an array that has more than 3 other arrays in it . I have limited the function mentioned in previous post that creates the rowItemSize values to return only 3 items and everything worked, but if the returned items number is bigger than 3, then setting the rowitemSize attribute fails .I'll have a deeper look

Here's the debugger output

printing rowItemSize variable
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
264
110
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]

Current Function:
072:
073: print "printing rowItemSize values"
074:
075: for each itemSize in rowItemSize
076: print itemSize
077: end for
078:
079:
080:* stop
081: m.homeScreenRowList.rowItemSize = rowItemSize
082: stop
083:
084: m.homeScreenRowList.id = componentsName.SG_HOMESCREEN
STOP (runtime error &hf7) in pkg:/source/appHome.brs(80)
080: stop
Backtrace:
#5 Function homescreen_handlefetchsuccess() As Dynamic
file/line: pkg:/source/appHome.brs(81)
#4 Function homescreen_populatescreen() As Dynamic
file/line: pkg:/source/appHome.brs(47)
#3 Function homescreen_show() As Dynamic
file/line: pkg:/source/appHome.brs(36)
#2 Function app_showhomescreen() As Dynamic
file/line: pkg:/source/app.brs(95)
#1 Function app_show(startingpage As Object) As Void
file/line: pkg:/source/app.brs(87)
#0 Function runuserinterface(ecp As Dynamic) As Dynamic
file/line: pkg:/source/main.brs(22)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=7 count:16
sgconfig roAssociativeArray refcnt=1 count:37
rowitemsize roArray refcnt=1 count:4
componentsname roAssociativeArray refcnt=1 count:17
itemsize roArray refcnt=3 count:2

BrightScript Debugger> ? rowItemSize
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger> s
081: m.homeScreenRowList.rowItemSize = rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
]

BrightScript Debugger> rowItemSize.pop()

BrightScript Debugger> ? rowItemSIze
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger> m.homeScreenRowList.rowItemSize = rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger>
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Thu Jun 30, 2016 2:17 am

Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Beta Scene Graph Components

Thu Jun 30, 2016 11:14 am

dacian_roman23 wrote:
Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?

Somebody from the small hired army of "evangelists" should be able to help you (where are they when you need one?!).

In the mean time, do these two help?
viewtopic.php?f=34&t=95504
viewtopic.php?f=34&t=95416
 
adamkaz
Posts: 116
Joined: Sun Jan 11, 2009 2:23 pm

Re: Beta Scene Graph Components

Thu Jun 30, 2016 7:38 pm

This will likely get lost in the noise here, but I wanted to give everyone a heads up that in previous builds of my channel "m.top.observeField("visible", "onVisibleChange")" was only firing on, well, a visible change. As of 7.2, this appears to fire during init as well.

Caused a bug in my app, since I wasn't checking the visible state. My bad in the end, but these types of changes in behavior from firmware to firmware can cause issues in apps.
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Thu Jun 30, 2016 10:38 pm

EnTerr wrote:
dacian_roman23 wrote:
Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?

Somebody from the small hired army of "evangelists" should be able to help you (where are they when you need one?!).

In the mean time, do these two help?
viewtopic.php?f=34&t=95504
viewtopic.php?f=34&t=95416


Thanks EnTerr for the links. I'll have a look to see if somehow they can solve my problem. My biggest concern now with this 7.2 release is that I can't be sure if the bugs are from my code, from the firmware or both and it's even harder to test such problems :(
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Thu Jun 30, 2016 10:51 pm

Here's another strange issue . Trying to set the rowItemSize attribute for the rowListComponent.Below is the printed array that i'm trying to set on the rowItemSize . According to their documentation -
rowItemSize is an array of vector2d (i suppose that a vector2d array is an array containing other arrays .. each array having 2 values, one for item with and one for item height) but as you can see i get a type mismatch error. What is wrong here ? Is this a bug in the firmare ? The documentation has not been updated ?
<Component: roArray> =
[
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
    <Component: roArray>
]
roArray
<Component: roArray> =
[
     264
     110
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     264
     149
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     165
     247
]
<Component: roArray> =
[
     264
     149
]
----------------------------------
=================================================================
Warning occurred while setting a field of an RoSGNode
-- Type mismatch occurred when setting the "rowitemsize" field of a "RowList" node
   at line 75 of file pkg:/components/RowList/RowList.brs
=================================================================

 
User avatar
RokuJoel
Posts: 1758
Joined: Mon Nov 14, 2011 5:22 pm

Re: Beta Scene Graph Components

Fri Jul 01, 2016 2:22 pm

Here is what I've got:

roSGEng wrote:
There is a bug in RowList that I've found and fixed. The problem was that setting the rowHeights field was not causing the clipping rectangles for each row to be recomputed.

I'll check the fix in <for the future> In the meantime, in the example, in main.brs, if they move the line that sets rowList.data after the line that sets the rowHeights, things should work. Specifically, move this:

rowList.data =
{ grid: buildRowGrid() numRows: 10 }

after this line:

rowList.rowHeights = rowHeights

In general, it's best to not set any list or grid's content field until all of the sizing/positioning fields (e.g. itemSize, itemSpacing, rowHeights, rowItemSize, etc.) have been set. That minimizes the amount of recomputation that needs to be done.


Hope that helps.

- Joel
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Mon Jul 04, 2016 1:56 am

RokuJoel wrote:
Here is what I've got:

roSGEng wrote:
There is a bug in RowList that I've found and fixed. The problem was that setting the rowHeights field was not causing the clipping rectangles for each row to be recomputed.

I'll check the fix in <for the future> In the meantime, in the example, in main.brs, if they move the line that sets rowList.data after the line that sets the rowHeights, things should work. Specifically, move this:

rowList.data =
{ grid: buildRowGrid() numRows: 10 }

after this line:

rowList.rowHeights = rowHeights

In general, it's best to not set any list or grid's content field until all of the sizing/positioning fields (e.g. itemSize, itemSpacing, rowHeights, rowItemSize, etc.) have been set. That minimizes the amount of recomputation that needs to be done.


Hope that helps.

- Joel



Maybe there was a bug with the rowHeight attribute, but I still can't understand what is wrong with the rowItemSize attribute. Regarding the previous post , why do I get a type mismatch error when trying to set the rowItemSize with the printed values ? Trying to set the values of the rowItemSize like this : homeScreenRowList.rowItemSize = getRowItemSizeDimensions() it works fine and i don't get the type mismatch error.


function getRowItemSizeDimension()
   return [ [264,110], [264,149], [165,247], [264,149], [264,149], [264,149], [165,247], [165,247], [165,247], [264,149] ]
end function



But if my function is based on a json response passed as parameter and some conditions, even if the returned values are the ones listed in the line above I get the type mismatch error.What could be a possible cause/solution to this ?
 
menghao
Posts: 15
Joined: Mon Jul 11, 2016 6:32 am

Re: Beta Scene Graph Components

Mon Jul 11, 2016 6:39 am

dacian_roman23 wrote:
RokuJoel wrote:
Here is what I've got:

roSGEng wrote:
There is a bug in RowList that I've found and fixed. The problem was that setting the rowHeights field was not causing the clipping rectangles for each row to be recomputed.

I'll check the fix in <for the future> In the meantime, in the example, in main.brs, if they move the line that sets rowList.data after the line that sets the rowHeights, things should work. Specifically, move this:

rowList.data =
{ grid: buildRowGrid() numRows: 10 }

after this line:

rowList.rowHeights = rowHeights

In general, it's best to not set any list or grid's content field until all of the sizing/positioning fields (e.g. itemSize, itemSpacing, rowHeights, rowItemSize, etc.) have been set. That minimizes the amount of recomputation that needs to be done.


Hope that helps.

- Joel



Maybe there was a bug with the rowHeight attribute, but I still can't understand what is wrong with the rowItemSize attribute. Regarding the previous post , why do I get a type mismatch error when trying to set the rowItemSize with the printed values ? Trying to set the values of the rowItemSize like this : homeScreenRowList.rowItemSize = getRowItemSizeDimensions() it works fine and i don't get the type mismatch error.


function getRowItemSizeDimension()
   return [ [264,110], [264,149], [165,247], [264,149], [264,149], [264,149], [165,247], [165,247], [165,247], [264,149] ]
end function



But if my function is based on a json response passed as parameter and some conditions, even if the returned values are the ones listed in the line above I get the type mismatch error.What could be a possible cause/solution to this ?


Dude I have the exact same problem with you. And I found out that beside the predefined array, it actually accept the calculated array with less than 3 items. I guess the only possible solution is to let people in Roku fix this ASAP?
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Mon Jul 11, 2016 11:27 pm

menghao wrote:
dacian_roman23 wrote:
RokuJoel wrote:
Here is what I've got:

roSGEng wrote:
There is a bug in RowList that I've found and fixed. The problem was that setting the rowHeights field was not causing the clipping rectangles for each row to be recomputed.

I'll check the fix in <for the future> In the meantime, in the example, in main.brs, if they move the line that sets rowList.data after the line that sets the rowHeights, things should work. Specifically, move this:

rowList.data =
{ grid: buildRowGrid() numRows: 10 }

after this line:

rowList.rowHeights = rowHeights

In general, it's best to not set any list or grid's content field until all of the sizing/positioning fields (e.g. itemSize, itemSpacing, rowHeights, rowItemSize, etc.) have been set. That minimizes the amount of recomputation that needs to be done.


Hope that helps.

- Joel



Maybe there was a bug with the rowHeight attribute, but I still can't understand what is wrong with the rowItemSize attribute. Regarding the previous post , why do I get a type mismatch error when trying to set the rowItemSize with the printed values ? Trying to set the values of the rowItemSize like this : homeScreenRowList.rowItemSize = getRowItemSizeDimensions() it works fine and i don't get the type mismatch error.


function getRowItemSizeDimension()
   return [ [264,110], [264,149], [165,247], [264,149], [264,149], [264,149], [165,247], [165,247], [165,247], [264,149] ]
end function



But if my function is based on a json response passed as parameter and some conditions, even if the returned values are the ones listed in the line above I get the type mismatch error.What could be a possible cause/solution to this ?


Dude I have the exact same problem with you. And I found out that beside the predefined array, it actually accept the calculated array with less than 3 items. I guess the only possible solution is to let people in Roku fix this ASAP?


Hello menghao,
Add your code here, maybe I can give you some directions .
 
menghao
Posts: 15
Joined: Mon Jul 11, 2016 6:32 am

Re: Beta Scene Graph Components

Tue Jul 12, 2016 6:26 am

Sub onContentChange()
        m.containers.rowItemSize = getContainerSize()
        m.containers.content = m.top.containerContent
End Sub

Function getContainerSize() as Object
        ' containerSize = [[180,270],[180,180],[270,270],[270,180],[180,270],[180,180],[270,270],[270,180]]
        containerSize = []
        For i = 0 To m.top.containerContent.getChildCount() - 1
            containerType = m.top.containerContent.getChild(i).templateId
            if containerType = m.constants.LANDSCAPE_SHELF
                containerSize.push(m.constants.CONTAINER_SIZE.LANDSCAPE_SHELF)
            else if containerType = m.constants.PORTRAIT_SHELF
                containerSize.push(m.constants.CONTAINER_SIZE.PORTRAIT_SHELF)
            else
            containerSize.push(m.constants.CONTAINER_SIZE.CAROUSEL)
        end if
    End For
    return containerSize
End function


I try to set the rowItemSize based on the data I got from some server, then I got type mismatch runtime error.
However, I did some experiment on it and got some interesting result. Firstly, if I use this predefined value [[180,270],[180,180],[270,270],[270,180],[180,270],[180,180],[270,270],[270,180]] as containerSize, it will pass. Same as you mentioned.
Secondly, If I change "m.top.containerContent.getChildCount() - 1" in the loop to 2, it will work, no mismatch error, if I change to 3 or higher than it will complain about the mismatch error. By the way, the size of the array I tried here is 11.

Who is online

Users browsing this forum: No registered users and 5 guests