Examples of UIInterfaceOrientation


Examples of org.robovm.apple.uikit.UIInterfaceOrientation

  CGSize getBounds (UIViewController viewController) {
    // or screen size (always portrait)
    CGSize bounds = UIScreen.getMainScreen().getApplicationFrame().size();

    // determine orientation and resulting width + height
    UIInterfaceOrientation orientation;
    if (viewController != null) {
      orientation = viewController.getInterfaceOrientation();
    } else if (config.orientationLandscape == config.orientationPortrait) {
      /*
       * if the app has orientation in any side then we can only check status bar orientation
       */
      orientation = uiApp.getStatusBarOrientation();
    } else if (config.orientationLandscape) {// is landscape true and portrait false
      orientation = UIInterfaceOrientation.LandscapeRight;
    } else {// is portrait true and landscape false
      orientation = UIInterfaceOrientation.Portrait;
    }
    int width;
    int height;
    switch (orientation) {
    case LandscapeLeft:
    case LandscapeRight:
      height = (int)bounds.width();
      width = (int)bounds.height();
      break;
    default:
      // assume portrait
      width = (int)bounds.width();
      height = (int)bounds.height();
    }

    // update width/height depending on display scaling selected
    width *= displayScaleFactor;
    height *= displayScaleFactor;

    // log screen dimensions
    Gdx.app.debug("IOSApplication", "View: " + orientation.toString() + " " + width + "x" + height);

    // return resulting view size (based on orientation)
    return new CGSize(width, height);
  }
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    return false;
  }

  @Override
  public int getRotation() {
    UIInterfaceOrientation orientation = app.graphics.viewController != null
          ? app.graphics.viewController.getInterfaceOrientation()
          : UIApplication.getSharedApplication().getStatusBarOrientation();
    // we measure orientation counter clockwise, just like on Android
    if(orientation == UIInterfaceOrientation.Portrait) return 0;
    if(orientation == UIInterfaceOrientation.LandscapeLeft) return 270;
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

  CGSize getBounds (UIViewController viewController) {
    // or screen size (always portrait)
    CGSize bounds = UIScreen.getMainScreen().getApplicationFrame().size();

    // determine orientation and resulting width + height
    UIInterfaceOrientation orientation;
    if (viewController != null) {
      orientation = viewController.getInterfaceOrientation();
    } else if (config.orientationLandscape == config.orientationPortrait) {
      /*
       * if the app has orientation in any side then we can only check status bar orientation
       */
      orientation = uiApp.getStatusBarOrientation();
    } else if (config.orientationLandscape) {// is landscape true and portrait false
      orientation = UIInterfaceOrientation.LandscapeRight;
    } else {// is portrait true and landscape false
      orientation = UIInterfaceOrientation.Portrait;
    }
    int width;
    int height;
    switch (orientation) {
    case LandscapeLeft:
    case LandscapeRight:
      height = (int)bounds.width();
      width = (int)bounds.height();
      break;
    default:
      // assume portrait
      width = (int)bounds.width();
      height = (int)bounds.height();
    }

    // update width/height depending on display scaling selected
    width *= displayScaleFactor;
    height *= displayScaleFactor;

    // log screen dimensions
    Gdx.app.debug("IOSApplication", "View: " + orientation.toString() + " " + width + "x" + height);

    // return resulting view size (based on orientation)
    return new CGSize(width, height);
  }
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    return false;
  }

  @Override
  public int getRotation() {
    UIInterfaceOrientation orientation = app.graphics.viewController != null
          ? app.graphics.viewController.getInterfaceOrientation()
          : UIApplication.getSharedApplication().getStatusBarOrientation();
    // we measure orientation counter clockwise, just like on Android
    if(orientation == UIInterfaceOrientation.Portrait) return 0;
    if(orientation == UIInterfaceOrientation.LandscapeLeft) return 270;
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    // or screen size (always portrait)
// CGSize bounds = UIScreen.getMainScreen().getBounds().size();
    CGSize bounds = UIScreen.getMainScreen().getApplicationFrame().size();

    // determine orientation and resulting width + height
    UIInterfaceOrientation orientation;
    if (viewController != null) {
      orientation = viewController.getInterfaceOrientation();
    } else if (config.orientationLandscape == config.orientationPortrait) {
      /*
       * if the app has orientation in any side then we can only check status bar orientation
       */
      orientation = uiApp.getStatusBarOrientation();
    } else if (config.orientationLandscape) {// is landscape true and portrait false
      orientation = UIInterfaceOrientation.LandscapeRight;
    } else {// is portrait true and landscape false
      orientation = UIInterfaceOrientation.Portrait;
    }
    int width;
    int height;
    switch (orientation) {
    case LandscapeLeft:
    case LandscapeRight:
      height = (int)bounds.width();
      width = (int)bounds.height();
      break;
    default:
      // assume portrait
      width = (int)bounds.width();
      height = (int)bounds.height();
    }

    // update width/height depending on display scaling selected
    width *= displayScaleFactor;
    height *= displayScaleFactor;

    // log screen dimensions
    Gdx.app.debug("IOSApplication", "View: " + orientation.toString() + " " + width + "x" + height);

    // return resulting view size (based on orientation)
    return new CGSize(width, height);
  }
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    return false;
  }

  @Override
  public int getRotation() {
    UIInterfaceOrientation orientation = app.graphics.viewController != null
          ? app.graphics.viewController.getInterfaceOrientation()
          : UIApplication.getSharedApplication().getStatusBarOrientation();
    // we measure orientation counter clockwise, just like on Android
    if(orientation == UIInterfaceOrientation.Portrait) return 0;
    if(orientation == UIInterfaceOrientation.LandscapeLeft) return 270;
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    // or screen size (always portrait)
//    CGSize bounds = UIScreen.getMainScreen().getBounds().size();
    CGSize bounds = UIScreen.getMainScreen().getApplicationFrame().size();

    // determine orientation and resulting width + height
    UIInterfaceOrientation orientation;
    if (viewController != null) {
      orientation = viewController.getInterfaceOrientation();
    } else if (config.orientationLandscape == config.orientationPortrait) {
      /*
       * if the app has orientation in any side then we can only check
       * status bar orientation
       */
      orientation = uiApp.getStatusBarOrientation();
    } else if (config.orientationLandscape) {// is landscape true and portrait false
      orientation = UIInterfaceOrientation.LandscapeRight;
    } else {// is portrait true and landscape false
      orientation = UIInterfaceOrientation.Portrait;
    }
    int width;
    int height;
    switch (orientation) {
    case LandscapeLeft:
    case LandscapeRight:
      height = (int)bounds.width();
      width = (int)bounds.height();
      break;
    default:
      // assume portrait
      width = (int)bounds.width();
      height = (int)bounds.height();
    }

    // update width/height depending on display scaling selected
    width *= displayScaleFactor;
    height *= displayScaleFactor;

    // log screen dimensions
    Gdx.app.debug("IOSApplication", "View: " + orientation.toString() + " " + width + "x" + height);

    // return resulting view size (based on orientation)
    return new CGSize(width, height);
  }
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

        public void didAccelerate(UIAccelerometer accelerometer, UIAcceleration values) {
          float x = (float)values.getX() * 10;
          float y = (float)values.getY() * 10;
          float z = (float)values.getZ() * 10;

          UIInterfaceOrientation orientation = app.graphics.viewController != null
                                    ? app.graphics.viewController.getInterfaceOrientation()
                                    : UIApplication.getSharedApplication().getStatusBarOrientation();
                   
          acceleration[0] = -x;
          acceleration[1] = -y;
View Full Code Here

Examples of org.robovm.apple.uikit.UIInterfaceOrientation

    return false;
  }

  @Override
  public int getRotation() {
    UIInterfaceOrientation orientation = app.graphics.viewController != null
          ? app.graphics.viewController.getInterfaceOrientation()
          : UIApplication.getSharedApplication().getStatusBarOrientation();
    // we measure orientation counter clockwise, just like on Android
    if(orientation == UIInterfaceOrientation.Portrait) return 0;
    if(orientation == UIInterfaceOrientation.LandscapeLeft) return 270;
View Full Code Here

Examples of org.robovm.cocoatouch.uikit.UIInterfaceOrientation

        public void didAccelerate(UIAccelerometer accelerometer, UIAcceleration values) {
          float x = (float)values.getX() * 10;
          float y = (float)values.getY() * 10;
          float z = (float)values.getZ() * 10;

          UIInterfaceOrientation orientation = app.graphics.viewController != null
                                    ? app.graphics.viewController.getInterfaceOrientation()
                                    : UIApplication.getSharedApplication().getStatusBarOrientation();
                   
          acceleration[0] = -x;
          acceleration[1] = -y;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.