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: 6
Registered: ‎12-26-2011
My Device: BB Torch-9810
My Carrier: Vodafone
Accepted Solution

createSolidTransparentBackground not working on OS 7

I intend to create a transparent login screen(the complete code is posted below). the code runs fine on OS5 and OS 6 devices, but on BB Torch-9810 (OS 7), the transparency is lost and replaced with white background. Does anybody have idea of how to create transparent screen in OS7??

 

The code is as follows:

public class LoginPopupTestCopy extends MainScreen{
    
    protected void applyTheme() {
        
    }

    public LoginPopupTestCopy(){
        this.setBackground(BackgroundFactory.createSolidTransparentBackground(0x00000000, 0x99));
        
        LabelField title=new LabelField("Login", LabelField.NON_FOCUSABLE|Field.FIELD_HCENTER);
        Font font1=getFont().derive(Font.BOLD,9,Ui.UNITS_pt);
        title.setFont(font1);
        
        title.setMargin(100, 0, 0, 0);
        add(title);

        
    }
}

 

Following code is used to display this screen:

UiApplication.getUiApplication().pushScreen(new LoginPopupTestCopy());

 

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: createSolidTransparentBackground not working on OS 7

Hi @iqbaldeep

 

 

I'm actually surprised that it's working on OS 5 or 6...

 

Try pushing your screen as a global screen.

 

E.

New Contributor
Posts: 6
Registered: ‎12-26-2011
My Device: BB Torch-9810
My Carrier: Vodafone

Re: createSolidTransparentBackground not working on OS 7

Thanks @maadani for your reply.

I tried pushglobalscreen(with all 3 possible flags) but there is no difference

 

UiApplication.getUiApplication().pushGlobalScreen(new LoginPopupTestCopy(),1,UiEngine.GLOBAL_SHOW_LOWER);

Contributor
Posts: 22
Registered: ‎03-29-2010
My Device: 8130
My Carrier: T1

Re: createSolidTransparentBackground not working on OS 7

I want to customize very first MainScreen of my Blackberry application as like small ticker screen. My aim is that the first MainScreen should be of size 320width,100height so when user launches the application then he will just see screen of size 320width and 100height (0,200,320,100) while remaining screen will be transparent and user will see other applications through transparent screen.

i want something like BreakNews app ,very well-know blackberry app.
http://appworld.blackberry.com/webstore/content/41242?lang=en

New Contributor
Posts: 6
Registered: ‎12-26-2011
My Device: BB Torch-9810
My Carrier: Vodafone

Re: createSolidTransparentBackground not working on OS 7

Peter can you please help in this regard? I'll be very thankful.

Contributor
Posts: 22
Registered: ‎03-29-2010
My Device: 8130
My Carrier: T1

Re: createSolidTransparentBackground not working on OS 7

yes please help me out. i really need to sort it out quickly Smiley Sad
Contributor
Posts: 22
Registered: ‎03-29-2010
My Device: 8130
My Carrier: T1

Re: createSolidTransparentBackground not working on OS 7

no body can help me out Smiley Sad
Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: createSolidTransparentBackground not working on OS 7

I suggest you would take one step back.

 

Try displaying a popup screen (not MainScreen) as a global screen and see if it is displayed with or without the background.

 

If it works, try implementing your screen as a popup rather than a MainScreen.

 

If not, post the results/errors that you get and we'll how to continue from there.

 

E.

 

 

 

 

Contributor
Posts: 22
Registered: ‎03-29-2010
My Device: 8130
My Carrier: T1

Re: createSolidTransparentBackground not working on OS 7

perfect, i will get back after checking with popupscreen Smiley Happy
New Contributor
Posts: 6
Registered: ‎12-26-2011
My Device: BB Torch-9810
My Carrier: Vodafone

Re: createSolidTransparentBackground not working on OS 7

Maadani:

actually i want a translucent popup which overlaps on my under-lying screen. the center area of the screen should show me a popup while rest of the area should be translucent(which should show me a faded underlying screen). In that case, i fear popup screen cannot be of much help. Smiley Indifferent