this.uiWindow = new UIWindow(UIScreen.getMainScreen().getBounds()); this.uiWindow.setRootViewController(this.graphics.viewController); this.uiWindow.makeKeyAndVisible(); Gdx.app.debug("IOSApplication", "created"); return true;
public static NSObject observeDidBecomeHidden(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidBecomeHiddenNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeDidBecomeKey(final VoidBlock1<UIWindow> block) {
NSNotificationCenter.getDefaultCenter().addObserver(UIWindow.DidBecomeKeyNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { NSNotificationCenter.getDefaultCenter().addObserver(UIWindow.DidResignKeyNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) {
public WindowAlertController(String title, String message, UIAlertControllerStyle preferredStyle) { super(title, message, preferredStyle); alertWindow = new UIWindow(UIScreen.getMainScreen().getBounds()); alertWindow.setRootViewController(new UIViewController()); alertWindow.setWindowLevel(UIWindowLevel.Alert + 1); }
/** * Creates a RoboVM platform for operation in {@code window}. * * <p>This basically just sets the root view controller of the supplied window and that view * controller manages everything else. If you wish to embed a PlayN game in a larger iOS app, or * to customize PlayN more deeply, create a {@link RoboViewController} yourself and include it in * your app wherever you like. */ public static RoboPlatform create (UIWindow window, Config config) { RoboViewController ctrl = new RoboViewController(window.getBounds(), config); window.setRootViewController(ctrl); return ctrl.plat; }
public void show() { alertWindow.makeKeyAndVisible(); alertWindow.getRootViewController().presentViewController(this, true, null); }
window.setBackgroundColor(UIColor.lightGray()); window.addSubview(button); window.makeKeyAndVisible();
public static NSObject observeKeyboardDidShow(final VoidBlock1<UIKeyboardAnimation> block) { return NSNotificationCenter.getDefaultCenter().addObserver(KeyboardDidShowNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke(new UIKeyboardAnimation(a.getUserInfo())); } }); } public static NSObject observeKeyboardWillHide(final VoidBlock1<UIKeyboardAnimation> block) {
public static NSObject observeDidResignKey(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidResignKeyNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeKeyboardWillShow(final VoidBlock1<UIKeyboardAnimation> block) {
/** * @since Available in iOS 5.0 and later. */ public static NSObject observeKeyboardDidChangeFrame(final VoidBlock1<UIKeyboardAnimation> block) { return NSNotificationCenter.getDefaultCenter().addObserver(KeyboardDidChangeFrameNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke(new UIKeyboardAnimation(a.getUserInfo())); } }); } }
public static NSObject observeDidBecomeVisible(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidBecomeVisibleNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeDidBecomeHidden(final VoidBlock1<UIWindow> block) {
public static NSObject observeDidBecomeKey(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidBecomeKeyNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeDidResignKey(final VoidBlock1<UIWindow> block) {
public static NSObject observeKeyboardDidHide(final VoidBlock1<UIKeyboardAnimation> block) { return NSNotificationCenter.getDefaultCenter().addObserver(KeyboardDidHideNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke(new UIKeyboardAnimation(a.getUserInfo())); } }); } /**
IOSProgressDialog(ProgressDialog.Builder builder) { super(UIScreen.getMainScreen().getBounds()); this.style = builder.style; setupLabels(builder); setupIndicators(); alertWindow = new UIWindow(UIScreen.getMainScreen().getBounds()); alertWindow.setRootViewController(new UIViewController()); alertWindow.setWindowLevel(UIWindowLevel.Alert + 1); setContentMode(UIViewContentMode.Center); setAutoresizingMask( UIViewAutoresizing.with(UIViewAutoresizing.FlexibleTopMargin, UIViewAutoresizing.FlexibleBottomMargin, UIViewAutoresizing.FlexibleLeftMargin, UIViewAutoresizing.FlexibleRightMargin)); // Transparent background setOpaque(false); setBackgroundColor(UIColor.clear()); setAlpha(0); }
/** * Registers the RoboVM platform for operation in {@code window}. * * <p>This basically just sets the root view controller of the supplied window and that view * controller manages everything else. If you wish to embed a PlayN game in a larger iOS app, or * to customize PlayN more deeply, create a {@link RoboViewController} yourself and include it in * your app wherever you like. */ public static RoboPlatform register (UIWindow window, Config config) { RoboViewController ctrl = new RoboViewController(window.getBounds(), config); window.setRootViewController(ctrl); return ctrl.platform(); }
@Override public void show() { alertWindow.makeKeyAndVisible(); alertWindow.getRootViewController().getView().addSubview(this); Platform.getPlatform().runOnUIThread(() -> { setTransform(CGAffineTransform.Identity().concat(CGAffineTransform.createScale(0.5, 0.5))); isShown = true; UIView.animate(0.3, () -> { setAlpha(1); setTransform(CGAffineTransform.Identity()); }); }); }
public static NSObject observeKeyboardDidShow(final VoidBlock1<UIKeyboardAnimation> block) { return NSNotificationCenter.getDefaultCenter().addObserver(KeyboardDidShowNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke(new UIKeyboardAnimation(a.getUserInfo())); } }); } public static NSObject observeKeyboardWillHide(final VoidBlock1<UIKeyboardAnimation> block) {
public static NSObject observeDidResignKey(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidResignKeyNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeKeyboardWillShow(final VoidBlock1<UIKeyboardAnimation> block) {
/** * @since Available in iOS 5.0 and later. */ public static NSObject observeKeyboardDidChangeFrame(final VoidBlock1<UIKeyboardAnimation> block) { return NSNotificationCenter.getDefaultCenter().addObserver(KeyboardDidChangeFrameNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke(new UIKeyboardAnimation(a.getUserInfo())); } }); } }
public static NSObject observeDidBecomeVisible(final VoidBlock1<UIWindow> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidBecomeVisibleNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIWindow) a.getObject()); } }); } public static NSObject observeDidBecomeHidden(final VoidBlock1<UIWindow> block) {