Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Developer's Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-05-2009, 05:12 PM
CrackBerry Newbie
Device Model: 8700c
Carrier: AT&T/Cingular
 
Join Date: Mar 2009
Posts: 5
Angry Field layering within a manager

I have a display related question that I have not been able to answer. It is related item (c) below.

Scenario:
Lets say I have 5 cards in my hand.
a. I want to display the cards in a row, one next to the other, BUT, with the cards overlapping partially (just like the way you would hold a few cards in your hand while playing a game).
b. Once I have displayed the cards, I want to be able to move focus from one card to another as I scroll using the trackball
c. When any card has focus, I want that card to be layered above all the cards -- in other words, if this card was only partially displayed because it was behind another card, yet, when it gets focus, it should display itself fully above all other cards so that it can be seen completely.

I have been able to achieve (a) and (b) thanks to the API documentation and thanks to all that I have learned from the responses on crackberry's forums. To achieve (a) and (b), each of my cards is a BitmapField and I have a custom manager to help me display and scroll through cards.

However, I am JUST NOT able to achieve (c) above. It seems like the Manager (net.rim.device.api.ui.Manager) displays fields in the same order that they were added to it. So if you add field1 to the manager before you add field2, then the Manager always (yes, always) displays field1 below or under field2 in case of partial overlaps between field1 and field2. I found that the only way to get around this problem was to "delete" field1 from the manager and "add" it back to have it display above field2 on the screen. I find this workaround ridiculous since intuitively adding/deleting fields from a manager and fixing display issues of those fields seem unrelated to me. So, can someone help with a better solution?

Thanks!
Reply With Quote
  #2  
Old 05-05-2009, 08:06 PM
CrackBerry Abuser
Device Model: 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 489
Default

You may want to use a custom manager for this, so you have tighter control over how the graphics and the fields are layed out and painted. I can't think of anything specific you could try, sorry.
Reply With Quote
  #3  
Old 05-05-2009, 10:19 PM
CrackBerry Newbie
Device Model: 8700c
Carrier: AT&T/Cingular
 
Join Date: Mar 2009
Posts: 5
Default

Thanks for responding ydaraishy. I am using a custom manager already. However, there are no methods in the Manager API that allow me to control what field has to appear on top of what other field. This aspect is controlled by the order in which the fields were added to the manager and after the field has been added, there is no way to control the above aspect of "layering".
Reply With Quote
  #4  
Old 05-06-2009, 12:10 AM
CrackBerry Abuser
Device Model: 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 489
Default

Think about trying to mark rectangles on screen as dirty and then repainting them in the desired order.

I'm just pulling this off the top of my head, I'm not sure this is actually doable or not.
Reply With Quote
  #5  
Old 05-13-2009, 02:55 PM
legallyaddictive's Avatar
Legally Addictive Games
Device Model: 9000 (Bold)
Carrier: Rogers
 
Join Date: May 2009
Posts: 37
Default

If you override the paint method in your manager and call the paintChild(...) methods manually in the appropriate order you could overlap your cards. You may end up with some issues with repainting not occuring as you would expect so you might need to make sure that your invalidation is happens agains correctly when focus is changed between cards.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 Site Support | Accessory Order Support | App Store Support | Advertise | Newsletter | About Us

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

The names RIM and BlackBerry are registered Trademarks of Research in Motion Limited.
CrackBerry.com is in No Way Affiliated with Research in Motion Limited.
Copyright ©2007-2009 Smartphone Experts. Terms and Conditions. Privacy Policy. All rights reserved.