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

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎09-07-2010
My Device: Curve 8520
My Carrier: Rogers

Extend Screen class to draw on part of screen

[ Edited ]

Hi all,

 

got a quick one for all the smart ones out there.

 

I am developing an app with a toolbar at the bottom. I would like to keep this toolbar visible on all the screens in my app.

 

I have extended the Screen class to add functionality like a screens parent screen and navigating b/w the two using the back button.

 

Now my question is:

 

Instead of redrawing/adding the toolbar component on every screen can I somehow modify my extended Screen class to only draw in a certain portion of the screen (so that the toolbar always remains visible) ? kind of like reducing the screen area just for this purpose ?

 

thanks

-ankit

 

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Extend Screen class to draw on part of screen

Welcome to the forums!

 

Since only the topmost (active) screen receives keyboard and navigation events, your toolbar has to be on it, not on some screen below that.

 

However, you may use a different approach: have only one screen and replace "content" managers as necessary. It will mean a little more work for you keeping track of your "screens" (actually, managers) stack, but your toolbar will stay the same.

 

You may draw some useful ideas from the following knowledge base entry:

 

Create tabbed view screens

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Extend Screen class to draw on part of screen

Welcome too.

 

I agree with the previous poster.

 

Just one point, in my experience, repainting part or repainting all of the screen has very little impact on perceived performance if you only do it once in a white, like when you swap from one screen to another.

 

Repainting the entire screen to move a sprite around is not such a good idea.  In my experience minimizing the area you invalidate when doing this significantly helps performance. 

 

So in this situation I would not spend a lot of time attempting to optimize the performance of the screen by only repainting the changed parts. 

Highlighted
New Contributor
Posts: 3
Registered: ‎09-07-2010
My Device: Curve 8520
My Carrier: Rogers

Re: Extend Screen class to draw on part of screen

Thank you for the helpful pointers. Going to check out the tabbed example and

see if it can be adapted for my needs.

 

Will post back soon with the results.

 

thanks again Smiley Very Happy