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

Native Development

Reply
Developer
Posts: 18
Registered: ‎01-31-2013
My Device: Dev Alpha
My Carrier: MobileTeleSystem

hub message like interface

Hi.
Now i developing client for rich internet application, and i want to add ability to send and receive messages from my application. I want that my applicaiton looks native so I have a question: how i can realize in qml or c++ list of messages like in BB Hub?
Sorry for bad English.

 

Attached picture:

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: hub message like interface

Try a regular ListView with custom ListItemComponents.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 18
Registered: ‎01-31-2013
My Device: Dev Alpha
My Carrier: MobileTeleSystem

Re: hub message like interface

Ok. But how i can make a speech bubble?

In cascades there even no basic qml like Rectangle in Qt

Developer
Posts: 291
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: hub message like interface

Use a ImagePaintDefinition to create a 9-slice image. You can make the speech bubble out of a single image and a container
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: hub message like interface

boytsov_s the Container class is very similar in purpose to a Rectangle in Qt. It can have a background (colour or image or nine-slice image as a border, as strobejb says), and can container other items. It's the appropriate thing to start with for a custom component in QML. In this case, it would be the outer element for your custom ListItemComponent, and other things could go inside.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 18
Registered: ‎01-31-2013
My Device: Dev Alpha
My Carrier: MobileTeleSystem

Re: hub message like interface

I understand that I can just put image on the background and text field, but would not that lead to lag if the list is too big?

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: hub message like interface

The ListView is designed for this sort of thing. It doesn't actually create instances of the VisualNode (i.e. the item in the ListItemComponent definition) for each item in the list, but only for each item *visible* in the list, plus a few extras to ensure smooth scrolling. It caches and reuses them when they're moved off one end of the list and later on moved back onto the other side. They're repopulated with data from the model, as appropriate.

So, go ahead and give it a shot... don't worry about optimization prematurely. ;-)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 18
Registered: ‎01-31-2013
My Device: Dev Alpha
My Carrier: MobileTeleSystem

Re: hub message like interface

offTopic:

don't worry about optimization prematurely ;-)

some time back my work was related to programming on an assembler. I do not program on an assembler for now  but habit to think in advance remained.  :smileyhappy:

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: hub message like interface

Heh heh, I know the feeling! I write a lot of hard real-time embedded system software... assembly and tightly optimized C.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!