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

Native Development

Posts: 407
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Modify StandardListItem, rebuild it as ListItemComponent

@SimonHain. Yes. I know that in 10.2 has this nice feature. My only concern is that given the record of OS updates by some carriers, 10.2 might not be available to some BB10 owners for a long while to come. This other solution will give those developers this ability with older OS versions.

Posts: 142
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Modify StandardListItem, rebuild it as ListItemComponent

[ Edited ]

Thanks Bluenoser, Simon_Hain and all other solution-contributors for sharing the solution for OS10 and 10.2.
Some time ago when I worked on this project I ended up not rebuilding it but use the StandardListItem - but now I know how to use it when I need it again, thanks!

Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: Modify StandardListItem, rebuild it as ListItemComponent

Using the CustomListItem approach with a StandardListItem as content:

ImageListItem::ImageListItem( Container *parent )
	: CustomListItem( HighlightAppearance::Frame, parent )
	 m_root = Container::create()
		  .left( 10 )

	 m_item = StandardListItem::create()
	  	 .imageSource( QUrl( m_imageSource = "asset:///images/image64.png" ) );

	 m_root->add( m_item );

	 setContent( m_root );
	 setDividerVisible( true );

	 connect( this, SIGNAL( creationCompleted() ), this, SLOT( onCreationCompleted() ) );

 Mostly fine but the internal StandardListItem is still being "activated" (faint blue overlay) on pressing the item and is not cleared on releasing.  (The "left padding" is NOT covered by the overlay...)


I can't even activate(false) becuase it is a private function.


Any suggestions?