BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-08-2008, 10:43 PM   #1
qt_chenchen
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: Carrier
Posts: 18
Default Adjusting Screen Size

Please Login to Remove!

Hi guys,

I want to create an application but i don't want it in full screen i just want it to be more or less 3/4 of the screen. And, for the remaining 1/4 of the screen, it
should show the screen of the phone.

This is the picture of what i am saying, i can only post the link, i need to post 10 before i can post an image.. woot! :P

here's the link:
img503.imageshack.us/my.php?image=8120ay1.png


Is there any possibility that i could adjust the screen size?

Hope you'll help me with this. Thank you guys!
Offline  
Old 10-09-2008, 02:42 AM   #2
myraddin
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 8900
OS: 4.3-4.6.1
Carrier: t-mobile
Posts: 39
Wink

Yes. you can do that.

Override sublayout(init,int) of your screen class:
PHP Code:
    public void sublayout(int widthint height)
    {
        
super.sublayout(widthheight);
        
setExtent(100200);
        
setPosition(1020);
    } 
Now play with the numbers a little bit to achieve what you need.

( Remember that you can use Display.getWidth() and Display.getHeight(); )
Offline  
Old 10-09-2008, 03:07 AM   #3
qt_chenchen
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: Carrier
Posts: 18
Default

Thank you for your help. ^^

I understand the concept that i just need to override my screen class unfortunately i'm new in BB development and i don't know how to implement it or in what part should i place this one.

Can you give me a sample code for this one? A simple one would do.

Thanks again.
Offline  
Old 10-09-2008, 03:23 AM   #4
myraddin
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 8900
OS: 4.3-4.6.1
Carrier: t-mobile
Posts: 39
Wink Certanly :)

Main class (entry point)
PHP Code:
public class Test_01 extends UiApplication
{
    static private 
Test_01 theApp;
    private 
Screen_01 fScreen null;

    public 
Test_01()
    {
      
fScreen = new Screen_01();
    }

    public static 
void main(Stringxxx91;xxx93; args)
    {
        
theApp = new Test_01();
        
theApp.displayScreen();
        
theApp.enterEventDispatcher();
    }
  
// ... add any other code you might need here

  
public void displayScreen()
  {
    
System.out.println("!> showInfo");
    
// push the screen on top of screen stack:
    
Ui.getUiEngine().pushGlobalScreen(fScreen4UiEngine.GLOBAL_SHOW_LOWER);
  }

And now the screen class:

PHP Code:
// you could extend any other Scrren type but i prefer the popup one :)
// feel free to experiment with other types
final public class Screen_01 extends PopupScreen
{
  public 
Screen_01()
  {
    
super(new VerticalFieldManager());

    
// add other screen fields here.
  
}

  public 
void sublayout(int widthint height
  { 
      
super.sublayout(widthheight); 
      
setExtent(100200); 
      
setPosition(1020); 
  }

  
// and I always prefer to 'disable' theme:

  
protected void applyTheme()
  {
  }

You need to pop the screen at some time, of course, but you can try to guess that one yourself

Hope I didn't miss anything
Offline  
Old 10-09-2008, 10:39 PM   #5
qt_chenchen
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: Carrier
Posts: 18
Default

Thanks..

But the problem is whenever i load the application the background is still colored white, the transparent popup screen is shown only when i press the end call key(the red color phone key) and also it never exits.


Thanks again. Hope you can help me again with this one.
Offline  
Old 10-10-2008, 12:43 AM   #6
qt_chenchen
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: Carrier
Posts: 18
Default

I have already got it working now. I just changed my main class into "Application" only not "UiApplication".


But one last question. How do i exit the application? Thanks!
Offline  
Old 10-10-2008, 01:21 AM   #7
myraddin
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 8900
OS: 4.3-4.6.1
Carrier: t-mobile
Posts: 39
Default

System.exit(0) is a sure way to get out

(yes, the Application class enables a non-full screen screen, my mistake. You can also play with MainScreen instead of PopupScreen - it will automagically add a 'close' item to the menu - if I remember correctly)
Offline  
Old 02-11-2009, 10:27 PM   #8
rogu
New Member
 
Join Date: Feb 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 2
Default

myraddin I LOVE YOU I know this is an old post but this information was gold for me and I had to let them know!
Offline  
Old 02-13-2009, 12:51 AM   #9
rogu
New Member
 
Join Date: Feb 2009
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 2
Default

Is there anyway to handle if someone holds down the Menu button for a long time it calls for the Switch application but using

Ui.getUiEngine().pushGlobalScreen(fScreen, 4, iEngine.GLOBAL_SHOW_LOWER);

Causes the screen to stay ontop of everything, I want to pop the screen but I can't figure out a way to see when switching is called.


Edit -
Ui.getUiEngine().pushModalScreen(screennamegoesher e); seemed to work all the same.

Last edited by rogu; 02-13-2009 at 01:22 AM..
Offline  
Closed Thread



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

Forum Jump


Tnt Rescue Equipment Hydraulic Ram R-30   724 picture

Tnt Rescue Equipment Hydraulic Ram R-30 724

$240.00



RAM MODULE (COMES WITH WIRING HARDNESS) picture

RAM MODULE (COMES WITH WIRING HARDNESS)

$200.00



37061 - IMPERIAL RAM MODULE -  picture

37061 - IMPERIAL RAM MODULE -

$205.00



NCR 7616-1301 NCR 72XRT 15

NCR 7616-1301 NCR 72XRT 15" Retail POS Terminal with i3, 8GB Ram 250GB HD No OS

$299.00



RAM-H4M1-03 -  IGNITION MODULE -  picture

RAM-H4M1-03 - IGNITION MODULE -

$160.00



Thermo Electron Corporation Data Ram 4 picture

Thermo Electron Corporation Data Ram 4

$299.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.