How to display a popupScreen in Blackberry Application? - blackberry

how can i call the popupScreen on top of my main screen. it functions as a user login

I'm not sure what version of the SDK you are using but I've used the following:
DialogFieldManager manager = new DialogFieldManager();
PopupScreen popup = new PopupScreen(manager);
UiApplication.getUiApplication().pushScreen(popup);
popup.doPaint();

The following link will help you to find solution for push the popup screen on the top of the main screen
Dialog box background color on Blackberry

Related

UIAlertView popup won't let me swipe up Control Center

I'm currently working on a Xamarin MvvmCross ios app. I have it set to display a UIAlertView popup to inform the user when their internet is disabled (the app requires an internet connection).
The problem is that when this popup shows, the user can't swipe up the Control Center to activate their internet...
var dlg = new UIAlertView(config.Title ?? String.Empty, config.Message, null, config.CancelText, config.OkText);
dlg.Clicked += (s, e) =>
{
var ok = (dlg.CancelButtonIndex != e.ButtonIndex);
_activeDialog.DismissAlertDialog();
config.OnConfirm(ok);
};
dlg.Show();
They then have to either click OK and race the popup reappearing, or home the app, reactivate internet, then come back to the app...
Anyone any suggestions?
It's not possible to get around this, since UIAlertView is probably being displayed above the window that handles gestures for the Control Center. This is the way Apple made it.
I would use a custom view as a UIAlertView and fade the background view's alpha. Or you could use a library that already does this:
https://github.com/alexanderjarvis/PXAlertView
https://github.com/wimagguc/ios-custom-alertview
https://github.com/ChrisXu1221/CXAlertView
Related Questions:
Can't use Control Center when UIAlertView displayed (iOS 7)
UIAlertView Strange Behaviour with Shortcut Control center

PhoneGap-iOS, how to show dialog with red button?

I am working with Phonegap on iOS, and here is the codes to show the dialog:
navigator.notification.confirm(
'Which color do you like most?'
, confirmCB
, 'Title | Confirm'
, 'Green,Red'
);
I want to show a confirmation dialog with red cancel button but I don't know how. Please helps.
That is not possible with phonegap.
navigator.notification.confirm uses the native UIAlertView, and the UIAlertView buttons are blue/gray, and the cancel button darker blue/gray
You can try to create a plugin with this library BlockAlerts And ActionSheets
Or use a javascript/css alert replacements

PhoneScreen problems with incoming call

I want to add a field to the Phone Screen when a screen is received. I successfully made this using the following code:
public void callIncoming(int callId) {
PhoneScreen ps = new PhoneScreen(Call, UiApplication.getApplication());
PhoneScreenHorizontalManager manager = new PhoneScreenHorizontalManager();
LabelField label = new LabelField("Call Received");
manager.add(label);
ps.add(manager);
ps.setScreenBackground(Color.RED);
ps.sendDataToScreen();
}
I tried this code on the following devices:
BB Mini Curve, Bold 4, Bold 2 and Curve and this works like a charm with all the functionality I want. A background colored red is appearing in the area where I can draw fields
I tried it on these phones and the label field did not appear: Torch, Bold3
On these phones, When I add data to the screen, I guess that these fields are appearing below the ringer off notification. With these devices, no Background is appearing... So this is a main issue.
How to solve this and make the fields appear on these phones too?
Thanks in advance
I don't have the answer, but have started a thread here:
http://supportforums.blackberry.com/t5/Java-Development/PhoneScreenDemo-not-displaying-information-on-os6/m-p/1450769#M184811
I've opened a RIM ticket and will share info as I get it.
As far as I can see PhoneScreen has big issues and is not consistently supported across devices.
Using isSupported() will only determine if the device screen type supports the API, (SVG is required according to RIM Jira ticket), not if it will actually work.

Set transparent window background in Titanium desktop app

I need to set the background of a window to be transparent programmatically, once the window is already created.
This creates a new window with a transparent background.
Titanium.UI.createWindow({url:location.href,transparentBackground:true}).open()
Background transparency can also be set in the tiapp.xml, but I need to set it after the window is loaded.
I also tried the following
var win = Titanium.UI.getCurrentWindow();
win.backgroundColor = 'transparent';
which does not have any effect...
Is there a way to achieve that?
Perhaps you could create 2 windows with the same components, one transparent and one not. Once you want the transparent background to show close the other window?
or win.setBackgroundColor('transparent');
I pasted your code into a click event and it worked fine for me. All i did was change the url to 'app://index.html' for testing purposes.
$('.button').click(function(){
// test
Titanium.UI.createWindow({url:'app://index.html',transparentBackground:true}).open();
});
Have you opened the web inspector to check for js errors?
If you want the initial window to be transparent, add this
<transparent-background>false</transparent-background>
to
<window />
on the tiapp.xml file.

Unable to use back button property in Popup screen in blackberry

In my application , am using popup screen, that implements FieldChangeListener.I used close() method for back button. but its not working.
Can some give sample code without using KeyListener,TrackwheelListener ?
if u want to close the popup screen on back button try this:
UiApplication.getUiApplication().
popScreen(UiApplication.getUiApplication().getActiveScreen());

Resources