@Override public int getVersion () { return Integer.parseInt(UIDevice.getCurrentDevice().getSystemVersion().split("\\.")[0]); }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeBatteryLevelDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(BatteryLevelDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeBatteryStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(BatteryStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**
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; } }
Gdx.app.debug("IOSApplication", "iOS version: " + UIDevice.getCurrentDevice().getSystemVersion()); if (scale >= 2.0f) { Gdx.app.debug("IOSApplication", "scale: " + scale); if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) { if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) {
private static boolean useHalfSize (RoboPlatform.Config config) { boolean isPad = UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad; return isPad && config.iPadLikePhone; } private static Scale viewScale (RoboPlatform.Config config) {
void boundsChanged(CGRect bounds) { viewportChanged(scale().scaledCeil((float)bounds.getWidth()), scale().scaledCeil((float)bounds.getHeight())); orientDetailM.update(toOrientationDetail(UIDevice.getCurrentDevice().getOrientation())); }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeProximityStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(ProximityStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } }
public static NSObject observeOrientationDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(OrientationDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**
Gdx.app.debug("IOSApplication", "iOS version: " + UIDevice.getCurrentDevice().getSystemVersion()); if (scale >= 2.0f) { Gdx.app.debug("IOSApplication", "scale: " + scale); if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) { if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) {
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); }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeProximityStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(ProximityStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } }
public static NSObject observeOrientationDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(OrientationDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**
int getIosVersion () { String systemVersion = UIDevice.getCurrentDevice().getSystemVersion(); int version = Integer.parseInt(systemVersion.split("\\.")[0]); return version; }
Gdx.app.debug("IOSApplication", "iOS version: " + UIDevice.getCurrentDevice().getSystemVersion()); if (scale >= 2.0f) { Gdx.app.debug("IOSApplication", "scale: " + scale); if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) { if (UIDevice.getCurrentDevice().getUserInterfaceIdiom() == UIUserInterfaceIdiom.Pad) {
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.0 and later. */ public static NSObject observeProximityStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(ProximityStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } }
/** * @since Available in iOS 3.0 and later. */ public static NSObject observeBatteryStateDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(BatteryStateDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**
public static NSObject observeOrientationDidChange(final Runnable block) { return NSNotificationCenter.getDefaultCenter().addObserver(OrientationDidChangeNotification(), null, NSOperationQueue.getMainQueue(), new VoidBlock1<NSNotification>() { @Override public void invoke(NSNotification a) { block.run(); } }); } /**