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!
|