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
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Hide And Show Function

Hi.

 

is it possible to write hide and show function using blackberry api in blackberry sample application.if it is possible then please give me sample code.

 

Hiding image

 

9930.png

 

Show Image

 

9930-01.png

 

Thanks

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Hide And Show Function

You example is not clear, as I'm not sure if you really want to hide and show the home screen or not.

 

If this was an application, then the result you see could be achieved by scrolling, so by changing the size of the Manager at the Bottom which is displaying the images.  Neither is really show and hide.

 

In addition to scrolling and resizing, the other way you might implement a show and hide is by adding and removing the Fields.

 

If this is not enough, can you please give us a more detailed application example.  Thanks 

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Hide And Show Function

hi,

 

i have attached the image for hide and show function

 

2011-10-18_1222.png

 

when the user click on right arrow icon then it will show the contant. when the user click on down arrow icon then it will hide the content. it will change the icons at the same time. is this possible in blackberry.

if it is possible then pls give me sample code.

 

Thanks

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Hide And Show Function

Yes it is possible. 

 

I think it is unlikely that anyone will give you sample code - the sort of code that handles this sort of stuff will be deep in an applicatin and it wold be difficult and time consuming to extract it out into a standalone form.

 

The easiest way to d this is to just add the text to the screen when the 'expand' button is clicked, than remove the 'expanded' Field from the screen when the ;shrink' button is clicked - as a result the screen will repaint with or without the text.

 

An alternative and much more difficult approach wold be to have the Field make itself larger (expand)  or smaller (shrink) over a short period and force a relayout of the screen at intervals too.  This will will give the illusion of the text 'expanding' or 'shrinking'.  

 

For starters however I recommend that you just add the text to the screen when the button is clicked, then remove it when the 'shrink button is clicked.    

 

I say add and remove to the Screen.  You will probably have a number of managers involved here, so I mean add/remove to the parent manager. 

Please use plain text.
Contributor
rabiyabasri
Posts: 49
Registered: ‎12-21-2010
My Device: 9000 Bold Device
My Carrier: software developer

Re: Hide And Show Function

hi,

 

thanks for u r reply will u please past the code for adding and removing to the Screen for hide and show function.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Hide And Show Function

Sorry I didn't make this clear.  You use the same add() for this as you use when you create a Screen or add Fields to a Manager.  To delete, you use, as I guess you would probably expect, the delete() method.  So no need for code, have a look at the Javadocs. 

Please use plain text.