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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Trusted Contributor
mdd
Posts: 197
Registered: ‎01-17-2012
My Carrier: ATT

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,

Please use plain text.
Developer
jtegen
Posts: 6,149
Registered: ‎10-27-2010
My Carrier: AT&T

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?
Please use plain text.
Trusted Contributor
mdd
Posts: 197
Registered: ‎01-17-2012
My Carrier: ATT

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,

Please use plain text.
Developer
jtegen
Posts: 6,149
Registered: ‎10-27-2010
My Carrier: AT&T

Re: BB10 List/CellRenderer

How about inherit from a base renderer class and then just tweak what might be unique in each list?
Please use plain text.
BlackBerry Development Advisor
dmalik
Posts: 339
Registered: ‎02-22-2012
My Carrier: Bell

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/
Please use plain text.
Trusted Contributor
mdd
Posts: 197
Registered: ‎01-17-2012
My Carrier: ATT

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,

Please use plain text.
Trusted Contributor
mdd
Posts: 197
Registered: ‎01-17-2012
My Carrier: ATT

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,

Please use plain text.