final CGRect screenBounds = UIScreen.getMainScreen().getBounds(); final CGRect statusBarFrame = uiApp.getStatusBarFrame(); final UIInterfaceOrientation statusBarOrientation = uiApp.getStatusBarOrientation();
float scale = (float)(getIosVersion() >= 8 ? UIScreen.getMainScreen().getNativeScale() : UIScreen.getMainScreen() .getScale()); if (scale >= 2.0f) { Gdx.app.debug("IOSApplication", "scale: " + scale); this.uiWindow = new UIWindow(UIScreen.getMainScreen().getBounds()); this.uiWindow.setRootViewController(this.graphics.viewController); this.uiWindow.makeKeyAndVisible();
/** * @since Available in iOS 5.0 and later. */ public static NSObject observeBrightnessDidChange(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(BrightnessDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } }
void setupPeripherals () { //motionManager = new CMMotionManager(); setupAccelerometer(); setupCompass(); UIDevice device = UIDevice.getCurrentDevice(); if (device.getModel().equalsIgnoreCase("iphone")) hasVibrator = true; if (app.getIosVersion() >= 9){ UIForceTouchCapability forceTouchCapability = UIScreen.getMainScreen().getTraitCollection().getForceTouchCapability(); pressureSupported = forceTouchCapability == UIForceTouchCapability.Available; } }
public RoboGraphics(RoboPlatform platform, CGRect bounds) { this.platform = platform; float deviceScale = (float)((platform.osVersion >= 8) ? UIScreen.getMainScreen().getNativeScale() : UIScreen.getMainScreen().getScale()); boolean isPad = UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad; boolean useHalfSize = isPad && platform.config.iPadLikePhone; float viewScale = (useHalfSize ? 2 : 1) * deviceScale; this.deviceScale = deviceScale; ctx = new RoboGLContext(platform, new RoboGL20(), viewScale); setSize(bounds); rootLayer = new GroupLayerGL(ctx); }
private static Scale viewScale (RoboPlatform.Config config) { float deviceScale = (float)UIScreen.getMainScreen().getScale(); boolean useHalfSize = useHalfSize(config); return new Scale((useHalfSize ? 2 : 1) * deviceScale); }
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidConnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidConnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidDisconnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidDisconnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeModeDidChange(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ModeDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
void setupPeripherals () { //motionManager = new CMMotionManager(); setupAccelerometer(); setupCompass(); UIDevice device = UIDevice.getCurrentDevice(); if (device.getModel().equalsIgnoreCase("iphone")) hasVibrator = true; if (app.getIosVersion() >= 9){ UIForceTouchCapability forceTouchCapability = UIScreen.getMainScreen().getTraitCollection().getForceTouchCapability(); pressureSupported = forceTouchCapability == UIForceTouchCapability.Available; } }
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidConnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidConnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidDisconnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidDisconnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeModeDidChange(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ModeDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
final CGRect screenBounds = UIScreen.getMainScreen().getBounds(); final CGRect statusBarFrame = uiApp.getStatusBarFrame(); final UIInterfaceOrientation statusBarOrientation = uiApp.getStatusBarOrientation();
float scale = (float)(getIosVersion() >= 8 ? UIScreen.getMainScreen().getNativeScale() : UIScreen.getMainScreen() .getScale()); if (scale >= 2.0f) { Gdx.app.debug("IOSApplication", "scale: " + scale); this.uiWindow = new UIWindow(UIScreen.getMainScreen().getBounds()); this.uiWindow.setRootViewController(this.graphics.viewController); this.uiWindow.makeKeyAndVisible();
void setupPeripherals () { //motionManager = new CMMotionManager(); setupAccelerometer(); setupCompass(); UIDevice device = UIDevice.getCurrentDevice(); if (device.getModel().equalsIgnoreCase("iphone")) hasVibrator = true; if (app.getIosVersion() >= 9){ UIForceTouchCapability forceTouchCapability = UIScreen.getMainScreen().getTraitCollection().getForceTouchCapability(); pressureSupported = forceTouchCapability == UIForceTouchCapability.Available; } }
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidConnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidConnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeDidDisconnect(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(DidDisconnectNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 3.2 and later. */ public static NSObject observeModeDidChange(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(ModeDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } /**
/** * @since Available in iOS 5.0 and later. */ public static NSObject observeBrightnessDidChange(final VoidBlock1<UIScreen> block) { return NSNotificationCenter.getDefaultCenter().addObserver(BrightnessDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.invoke((UIScreen) a.getObject()); } }); } }