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
Highlighted
Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone
Accepted Solution

Custom PopupScreen sublayout problem

Hi guys,

I'm developing a custom PopupScreen and I'm having a weird behaviour.

I'm setting it at position 0,0 and trying to make it use the full screen. 

In order to do that I'm setting the sublayout to Display.getWidth() and Display.getHeight(); Then doing the same with extent.

 

I'm using the 9800 simulator and the thing is that even if I see in the screen that the Display.getWidth() is 360 px, in the screen it only uses about 320 px. It's cutting the right part of the things I add to it.

 

I've got to say that it only happens with the things I add, because the bakcground is using the full screen.

 

I've toyed with all the innherited metods and overrided them, but with no luck.

 

The last thing I've discovered is that if I don't customize the class, it shows as usual in the middle of the screen, leaving about 20 px at every side...

Could it be that there's a predefined margin with a total of about 40px in the class?

I've tried to setMargin(0,0,0,0) but it doesn't solve it.

 

Thanks for your help.

Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Custom PopupScreen sublayout problem

[ Edited ]

Ok, I've confirmed that the space that the layout is cutting is exactly 36px, that means the PopupScreen is using 1/10 of the screen for Margin purposes or some other unknown to me.


Right now if I want to set the subLayout() to match Display.getWidth() I need to do it like this:
protected void subLayout(int w, int h){
super.subLayout(Display.getWidth()+Display.getWidth()/10, Display.getHeight());
}

Developer
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: Custom PopupScreen sublayout problem

First of all why you want to do this with popup screen when you have main screen that can do the same?
warm regards
Mohammed Aziz
Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Custom PopupScreen sublayout problem

Because I've reverse-engineered the navigationbar from FaceBook, with different style, but similar usability.
New Developer
Posts: 60
Registered: ‎09-23-2011
My Device: Blackberry
My Carrier: Blackberry Developer

Re: Custom PopupScreen sublayout problem

Hello,

 

I think you can make chage only make show in code.

 

Please if work out reply me.

 

protected void subLayout(int w, int h){


super.subLayout((Display.getWidth()+Display.getWidth())/10, Display.getHeight());


}

Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Custom PopupScreen sublayout problem

Yes Aniruddha, it works, but I think there should be another way to do this.
New Developer
Posts: 60
Registered: ‎09-23-2011
My Device: Blackberry
My Carrier: Blackberry Developer

Re: Custom PopupScreen sublayout problem

Hello,

 

Please , If your issue is solve then please click on like.

 

 

Thanks!!

 

Aniruddha

 

Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Custom PopupScreen sublayout problem

Sorry, what you proposed is the same I said I did on my second post.
And that's a workaround, what I want is to know if that's the only way or if I can solve it with a better one.
New Developer
Posts: 60
Registered: ‎09-23-2011
My Device: Blackberry
My Carrier: Blackberry Developer

Re: Custom PopupScreen sublayout problem

Hello,

 

Please read my post properly because i am do some minor changes in your code .

 

Please tell me your issue is solve or not.

 

Thanks!!

Aniruddha

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Custom PopupScreen sublayout problem

@Aniruddha

 

Your code was:

super.subLayout((Display.getWidth()+Display.getWidth())/10, Display.getHeight());

 

But Kshmire's code from the second post was the same:

super.subLayout(Display.getWidth()+Display.getWidth()/10, Display.getHeight());

 

So you can understand that your suggestion has not solved the question?