Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

BB10 List/CellRenderer

Is there a "proper" way for a List to set its CellRenderer's attributes (e.g. paddingLeft).

 

Currently, I have the CellRenderer "ask" its listOwner, but this doesn't seem right...

 

Regards,

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 List/CellRenderer

That is not a great idea. Is the padding adjustable for each item in the list? Can you not just fix it in the renderer?
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: BB10 List/CellRenderer

Different lists use the same renderer class, so wanted them to have the ability to override...

 

I can set it in the renderer, but wondering why the padding is even there if no way to set it from the outside...

Another Cascades side-effect I suppose...

 

Regards,

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 List/CellRenderer

How about inherit from a base renderer class and then just tweak what might be unique in each list?
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: BB10 List/CellRenderer

Another thing you might want to try to improve performance is this:

 

//Setting global CSS properties to opaqueBackgound improves cell renderer performance by 20FPS
			if( ThemeGlobals.currentTheme == ThemeGlobals.WHITE )
			{
				ThemeGlobals.injectCSS( "CellRenderer { opaqueBackground:#FAFAFA };" );
			}
			else
			{
				ThemeGlobals.injectCSS( "CellRenderer { opaqueBackground:#121212 };" );
			}

 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: BB10 List/CellRenderer

Dustin;

 

Thanks for the performance tip, but right now, I'd settle for an AlternatingCellRenderer that actually works on the DevAlpha

simulator:

 

Currently, it doesn't display the correct alternating light/dark background all (using a custom CellRenderer that extends AlternatingCellRenderer) and often doesn't properly reset cells to UP state.  I tried creating/setting my own Skin without any better success.

 

Regards,

Developer
Developer
mdd
Posts: 225
Registered: ‎01-17-2012
My Device: PB

Re: BB10 List/CellRenderer

Finally, some progress on this:

 

Turns out that if the List sets its opaqueBackground to the same color used by the Skin (assigned to the List's CellRenderer) for SkinStates.UP, everything works as it should, otherwise not.

 

My question:

   How can a list determine the color/skin assigned to the UP SkinState, or vice versa: how can a Skin determine the List's opaqueBackground?

 

Regards,