Transparent display of Popup in Blackberry

Hello

I found a work around for a transparent popup on any blackberry screen. I would like to share my code here.

The PopupScreen class is as follows:

/*******************************************************************************************************/

Import net.rim.device.api.system.GIFEncodedImage;
Import net.rim.device.api.ui.Color;
Import net.rim.device.api.ui.Field;
Import net.rim.device.api.ui.Font;
Import net.rim.device.api.ui.Keypad;
Import net.rim.device.api.ui.XYEdges;
Import net.rim.device.api.ui.component.LabelField;
Import net.rim.device.api.ui.container.PopupScreen;
Import net.rim.device.api.ui.container.VerticalFieldManager;
Import net.rim.device.api.ui.decor.Background;
Import net.rim.device.api.ui.decor.BackgroundFactory;
Import net.rim.device.api.ui.decor.Border;
Import net.rim.device.api.ui.decor.BorderFactory;

SerializableAttribute public class PopupLoadingScreen extends PopupScreen {}

Font fntPlain = Font.getDefault () .derive (Font.PLAIN, 20);
private AnimatedGIFField anmtFldCycle = null;
private LabelField lblMessage = null;
Private GIFEncodedImage gifImgCycle;

public PopupLoadingScreen (String text) {}

Super (new VerticalFieldManager (VerticalFieldManager.VERTICAL_SCROLL
| VerticalFieldManager.VERTICAL_SCROLLBAR));

Background bg = BackgroundFactory.createSolidTransparentBackground)
Color.WHITE, 0);
this.setBackground (bg);

Border = BorderFactory.createRoundedBorder (new XYEdges(),
Border.STYLE_TRANSPARENT);
this.setBorder (border);

gifImgCycle = GIFEncodedImage (GIFEncodedImage)
.getEncodedImageResource("LoadingSpinner.gif");// greenloadingspinner.gif
anmtFldCycle = new AnimatedGIFField (gifImgCycle, Field.FIELD_HCENTER);
Add (anmtFldCycle);

lblMessage = new LabelField (text, Field.FIELD_HCENTER);
lblMessage.setFont (Font.getDefault () .derive (Font.PLAIN, 20));
Add (lblMessage);

}

/ / This will overwrite the DOS on a button on the PHONE
{} public boolean keyDown (keycode, int, int status)

If (Keypad.key (keycode) == Keypad.KEY_ESCAPE) {}
Returns true;
}
Return super.keyDown (keycode, status);
}

/**
* This replaces the closing functionality in the default BB menu any
* screen
*/
public boolean onClose() {}
UiApplication.getUiApplication () .requestBackground ();
Returns false;
}
}

/ * GIF ANIME FIELD class * /.

package com.test;

Import net.rim.device.api.ui.UiApplication;
Import net.rim.device.api.system.GIFEncodedImage;
Import net.rim.device.api.ui.Graphics;
Import net.rim.device.api.ui.component.BitmapField;

A field that displays an animated GIF image.

SerializableAttribute public class AnimatedGIFField extends BitmapField {}
private GIFEncodedImage _image; The image to draw.
private int _currentFrame; The current image of the animation sequence.
Private AnimatorThread _animatorThread;

public AnimatedGIFField (image GIFEncodedImage) {}
This (image, 0);
}

public AnimatedGIFField (picture of GIFEncodedImage, long style) {}
Call great to set up the field with the specified style.
The image went as well for the domain configure sound
required size.
Super (image.getBitmap (), style);

Store the image.
_image = image;

Start the animation thread.
_animatorThread = new AnimatorThread (this);
_animatorThread.start ();
}

protected void paint (Graphics graphics) {}
Call the super.paint. This will draw the first background image and
manage all necessary development of drawing.
Super.Paint (Graphics);

Do not redraw the background if it comes to the first image.
If (_currentFrame! = 0) {}
Draw the image animation.
Graphics
.drawImage (_image.getFrameLeft (_currentFrame), _image
.getFrameTop (_currentFrame), _image
.getFrameWidth (_currentFrame), _image
.getFrameHeight (_currentFrame), _image,
_currentFrame, 0, 0);
}
}

Stop the animation thread when the screen is the field is
depile display.
protected void onUndisplay() {}
_animatorThread.stop ();
super.onUndisplay ();
}

A thread to handle the animation.
private class AnimatorThread extends Thread {}
Private AnimatedGIFField _theField;
Private boolean _keepGoing = true;
private int _totalFrames. The total number of images in the image.
private int _loopCount; The number of times that the loop animation
(completed).
private int _totalLoops; The number of times that that animation should

loop (defined in the image).

public AnimatorThread (AnimatedGIFField region) {}
_theField = theDomain;
_totalFrames = _image.getFrameCount ();
_totalLoops = _image.getIterations ();

}

public synchronized void stop() {}
_keepGoing = false;
}

public void run() {}
so that {(_keepGoing)
Invalidate the field so that it is redrawn.
UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
public void run() {}
_theField.Invalidate ();
}
});

try {}
Sleep during the framework period currently before the next image
is drawn.
Sleep (_image.getFrameDelay (_currentFrame) * 10);
} catch (InterruptedException iex) {}
} / / Could not sleep.

Increment the frame.
++ _currentFrame;

If (_currentFrame, _totalFrames)) {}
Reset to 0 if we've reached the end.
_currentFrame = 0;

++ _loopCount;

Check whether the animation should continue.
If (_loopCount == _totalLoops) {}
_keepGoing = false;
}
}
}
}
}
}

/*******************************************************************************************************/

That's how I put the bottom of my main class where I show the Popup screen

Background bg = BackgroundFactory.createSolidTransparentBackground)
Color.WHEAT, 0);
getMainManager () .setBackground (bg);

For the popup and the class screen I put the background color as Color.WHITE, and the GlobalAlpha is set to '0 '.

I press the PopupScreen class at the simple button click. In fact, it's a screen of loading with a GIF image in it. The link to the GIF images is given below

http://www.Google.co.in/imgres?q=loading+spinner&hl=en&SA=X&BIW=1366&BiH=588&TBM=isch&PRMD=imvns&TBN...

You can also try with another image GIF.

Please suggest if changes or improvements are possible in this for best performance

Thank you.

I had added this complete code so that someone can be useful in development. Thanks anyway.

Good day

Tags: BlackBerry Developers

Similar Questions

  • computer will display a popup whenver restarting the computer, it says that mchd.exe is a problem

    Hello

    I have problem with my computer, when I start the computer it shows "computer will display a popup whenver restarting the computer, it says that mchd.exe is a problem" this error message and if I insert the USB the computer does not recognize the USB.

    Please let me know ASAP troubleshooting steps.

    Thank you & best regards

    Sashidara

    Hello

    I suggest that you start your computer in a clean boot state and check if the problem persists.

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See the link below for more information on the clean boot troubleshooting.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note:

    How to configure Windows to use a Normal startup state

    After you have used the boot is a way to solve your problem, you can follow these steps to configure Windows XP to start normally.

    1. Click Startand then click run.
    2. Type msconfig and click OK.
      The System Configuration utility dialog box appears.
    3. Click the general tab, click Normal Startup - load all device drivers and services, and then click OK.
    4. When you are prompted, click restart to restart the computer.
  • Display white screen in Blackberry playbook

    Hello

    IAM get blank screen when I load the page html with javascript for display ads using leadbolt blackberry playbook advertising service.

    I developed the application using adobe AIR.

    Please tell me, can I use bannar leadbolt html ads to display ads in the Blackberry playbook?

    I show the code how I used the HTML to display the ads...





    announcement




    Please, help me out of this problem.

    For all the problems with LeadBolt, you will need to contact them directly for support. For problems with AIR applications, please post to the AIR Council:
    http://supportforums.BlackBerry.com/T5/Adobe-AIR-development/BD-p/Tablet

  • Display a POPUp screen

    Hi all

    I want to display the popup with content of string for 2 to 5 dry can help them all one on this...

    The pop-up screen should last to notice either thank you 5 sec...

    Please help me how can I do this

    Concerning

    Adkins

    Doing a job? Is that what you wanted... If you please mark the post as solved.

  • BlackBerry Smartphones Blackberry Media Sync continues to display 'Please connect a Blackberry smart phone' when the Blackberry Storm is connected to the PC

    About a 2 months ago when I would like to connect my (the first storm) blackberry storm to my computer via the USB cable supplied with the phone, I was able to transfer music from my computer (itunes) to the blackberry via Blackberry Media Sync with no problems (open Blackberry Media Sync, connect blackberry to the computer via the USB port and screen Media Sync would change so that I could sync to the blackberry storm music). I didn't even have to install Blackberry Media Sync in December 2009

    But now after I connect my Blackberry Storm to my computer, the screen of Blackberry Media Sync does not change and continues to display "please connect a Blackberry smartphone. I tried these tips I found online:

    1.) several reboots my computer (windows vista)

    2.) update/reinstall Blackberry Media Sync, then by restarting my computer

    3.) reconnection from blackberry to the computer, then open Media Sync

    4.) Open Media Sync first and then connect the blackberry to the computer.

    5.) installation BlackBerry USB and Modem drivers (even if I can't find the USB driver for it under the Universal Serial Bus Controller when I check in the Device Manager when you go to control panel – system and Maintenance – Manager of devices, but I found a v2 COM4 and COM5 RIM virtual serial Port when you select "devices by connection" under display in Device Manager) or are RIM Serial Port virtual v2 COM4 and COM5 drivers I'm looking for?

    6.) go to Options (on blackberry) - memory and make sure Media Card Support, Media Transfer Protocol (MTO) and Mass Storage Mode Support are resolved on 'On', the encryption Mode is set to 'None' and mass storage Mode Auto activate when connected, it the value "Prompt" although I tried to 'Yes' as well. It says I have 785 MB of memory space of the unit out of 879 MB total memory of the device and 7.1 GB of free space on a total of 7.3 GB of Media Card Media Card.

    None of the above tips and troubleshooting tips worked. I also checked the Blackberry technical solution center but I've not found anything there that has contributed to the other. I found discussions forums online, including issues of people with 'blackberry media sync cannot connect to the device' pop up, but I have not had this pop-up. The Media Sync screen remains just the same as if I never connected the blackberry storm to my computer in the first place even if my blackberry storm recharges via the computer.

    Is there something that I miss or have not yet done? What should I do?

    Too bad. I went to a Verizon store and they me remove the battery and turn the blackberry. Worked like a charm and I can now use Media Sync.

    Also told me that I need to update the software of the phone blackberry using Blackberry Desktop software (I have version 4 and need to update to 5) and make sure to choose to back up files when you are prompted during the update or you will lose all files, the media and info saved on blackberry.

  • Whenever I have shut down my computer, it displays a popup saying to close the background image and then it stops.

    Original title:

    Whenever I have shut down my computer, it displays a popup saying to close the background image and then it stops. Should what settings I change so that does not happen?

    Hello

    1. What is the brand and model of the computer?

    2 have you made any changes to the computer, before the show?

    Method 1:

    Perform a clean boot and check.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    Note: Once you are done with the boot, follow step 7 of article to reset your computer to normal startup.

    Method 2:

    Change the wallpaper and check.

    Change your desktop background (wallpaper)

  • Display the Popup on the main screen

    Hi all

    I am developing the small gui application. I don't have any positive results in this regard.

    My Reuirement is:

    1. whenever I have luanch my application, I need to display a small popup with a label under textfield, under the ok button (just like the type of progress bar, ok button this is extra).

    2 then I need to get the OK button action and whenever I click on the ok button, I need display pop anther upward with the label "you successfully process", then press ok button. Here also I need to get the action of the Ok button and when I clilk affecting my request goes to the back ground.

    Is this possible in blackberry with blackberry gui API? Please if anyone has the idea of these gui design can share me the sample code or give suggestions.

    Kind regards

    Suresh has

    [email protected]

    If your problem is resolved, you can mark thread as resolved.

  • How to avoid the JSR 75 write alert popup with blackberry?

    Hello

    This is my first post for the blackberry developer forums and I'm trying to transfer my J2ME application to blackberry.

    In our application, we use the JSR-75, and we got the versign certificate that we use for Nokia and Sony ericsson.

    The blackberry A60_How_And_When_To_Sign_V2.pdf .i found only one way to avoid the popup is carrier signature and but I do not find any carrier specific certificate in my blackberry "BOLD" (Airtel, India).

    (1) Please help me in this area.

    (2) is thereany way to avoid this popup?

    (3) possible Willit for blackberry partners?

    I use eclipse with the component 4.6.0 Blackberry package.

    Thanks in advance.

    Kind regards

    Samir.

    I used the ApplicationPermissions class to set the permission and it works.

  • Changed display of password of blackBerry Smartphones

    I have a simple password enabled on my device. Tonight, my son was messing around and tried to enter the password.  Somehow, he changed the asterisks projection screen when the password is entered to show the alphanumeric characters.  I tried to use the alt - shift keys to get the display settings to change it back and enter the actual password, but the screen changes to asterisks and the device does not accept that the password entered as the actual characters is the same thing (I think it's similar to what Mickey55 posted on below - however, my unit is less than one year old).  Anyone have any ideas?  I am on try #9 and really don't want to have all the data wiped out by starting from scratch.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=8300&message.ID=21544&query.ID=278874...

    Hey, do me a favor and fix the wire OK?

    Thank you

  • How to display GIFs animated on Blackberry

    Hello

    Can someone knows how to display the gif file hosted on the blackberry application

    Can pass the name of the file abc.gif with the field Bitmap etc.

    The code samples for this solution?

    Thank you

    And you need to call that

    AnimatedGIFField amimg = new AnimatedGIFField (((GIFEncodedImage) GIFEncodedImage.getEncodedImageResource ("abc.gif")));

  • How do I display a popup screen bit so a user confirms?

    I have a small bar on the bottom of my application with a backup and a Cancel button. I want the user to confirm when he chooses to cancel as in "are you sure you want to exit the changes will not be saved." type of popup.

    How can I achieve this in Blackberry? Thanks for the help guys!

    If (Dialog.ask (Dialog.D_YES_NO, "DO YOU WANT TO SAVE THIS RECORD?")) Is Dialog.YES)

    {

    APPLY THE CODE OF THE HEART

    }

  • Display of e-mail blackBerry Smartphones New on screen?

    My husband has an iPhone and it has a great feature - when you receive a new email or SMS text, the text of the message is displayed on the screen of the phone when it unlocks.  Is there a similar feature for the 8300?  Call me Miss Instant Gratification, but I hate the notification and the blinking light and then go through the process of unlocking the phone, scroll to my e-mail icon, then clicking on him to get the message, only to find it's spam.  If I could just unlock the phone and BAM, there's the message on the screen, it would be great.

    I am ongoing 5.0 and if my camera is in the case and no criminal record, as soon as I get out of case it opens the most recent message to me. It is the property of BB by default should work for everyone.

    http://www.BlackBerry.com/BTSC/KB04682

  • PNG transparent display icon of question mark in iOS

    Hello

    I use a transparent png to maintain the proportion of size of a div which is defined as a percentage of the width, and a background image scaling is 100%.

    It works well, except that on the ipad and the iphone that the region shows a missing image, which means that the form is described with a grey box and there is the missing picture of a questionmark icon, even if the background image is showing behind her.

    Does anyone have any ideas why thi smight be?

    For somereason it is not the case on another site I used the same method in, but I have reviewed the code html and css constantly and anything else to date.

    Thanks if anyone can help

    Hi David and Jon,

    Forgive my late reply and thanks for responding. I would have posted the link if I would be time to reply, but was not able to post a link to the site, since it's a staging site with restricted access.

    It turns out that I had to put an absolute url on my transparent png so it can display on the page. I guess it makes sense because all my other images on the site are WP uploads or relative to the CSS document, whereas that which is hard-coded in my WP header template needs an absolute url. (Although this does not explain why it was not necessary to have an absolute URL to the site on the office, as opposed to ipad?)

    Anyway, thanks again for your two entries.

  • Why PDF with transparency displayed incorrectly?

    Hello world

    I used this script ( http://www.adobe.com/devnet/digitalpublishingsuite/articles/dps-pdf-to-indesign.html ) to create a magazine based on a PDF file, but I have a big problem.

    PDF imported with transparent elements are not properly displayed, but only in a vertical position as you can see in the pictures on the menu and horizontal display correctly.
    I don't have control of PDF files because the Publisher send it already ready.

    I used the v.22 for this publication because I can't update the application now, but I installed the latest tools DPS.

    Thanks in advance for the help.

    http://www.cityrailways.it/storage/esempi/Esempio1.jpg

    http://www.cityrailways.it/storage/esempi/Esempio2.jpg

    I know this is an old thread, but I want to answer because it'll be useful for someone looking for answers as if I was today ;-)

    This is an expected behavior for a PDF article. Articles only PDF supports transparency opacity effect and multiply, blend modes are not supported. However, the content even if it is downloaded as a PNG/JPEG article should work correctly.

    It is also documented in best practices presented here Digital Publishing Suite help | Best practices to create overlays for

  • Display dialog popup to step to the sequence type

    I have a type of step in LabVIEW with module parameters and variables of the step which must be installed to configure this step. Can I do to display the dialog box pop-up to enter the required values for the time when I drop the step to a new sequence type?

    Examples: 1. I have variable TestID of steps which must be installed. Pop-up dialog box is more convenient that is variable and by searching the TestID in the tree.

    2. I have one type of step that makes different actions depending on the parameter enum in the LabVIEW module. This is set by default in steptype. I would like the name of the step in my sequence to match the value of the enumeration. Something like RunState.Step.TS.SData.ViCall.Parms ["Update Configuration"]. ArgVal in step step Expression name by default type help and displays the text of the enum as a stage name, when I drop the type of step of the sequence. But change the Configuration parameter update during this step to another value is not followed by changing the name of the step, looks like step default step name the type Expression is evaluated once what stage is created from the step type.

    Yes, you can add code to your step type that is called whenever an instance of it is inserted into a sequence. Create a customized type of step step and name it OnNewStep. TestStand will then call this substep whenever a new instance of the step type is inserted into a sequence.

    The default expression is evaluated only when the step is inserted, that is correct. I don't know in a way that you could make the name of the step automatically updated based on the value of the parameter of the module planned for it. You could write some kind of tool that updates the names of these steps in a sequence and run that, periodically, but I don't think there's a way to have your code directly from a user action to specify a code module. You can create your own user interface to specify things on the steps by using a publishing step and this edit substep could update the name, but I'm not sure this is a practical solution for your particular use case.

    Hope this helps,

    -Doug

Maybe you are looking for