How to use the expo.ScreenOrientation.allow function in expo

To help you get started, we’ve selected a few expo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / harvard-cs50-app / screens / WeekScreen.js View on Github external
orientationChangeHandler(dims) {
    const { width, height } = dims.window;
    const isLandscape = width > height;
    this.setState({ isPortrait: !isLandscape });
    this.props.navigation.setParams({ hideHeader: isLandscape });
    // TODO: Why?
    ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
  }
github czy0729 / Bangumi / screens / home / video / index.js View on Github external
switchToPortrait() {
    ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT)
  }
github expo / harvard-cs50-app / screens / WeekScreen.js View on Github external
componentDidMount() {
    ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
    Dimensions.addEventListener(
      'change',
      this.orientationChangeHandler.bind(this)
    );
    Analytics.track(Analytics.events.USER_WATCHED_VIDEO);
  }
github NervJS / taro / packages / taro-components-rn / backupcode / Video / index.js View on Github external
orientationChangeHandler(dims) {
    const { width, height } = dims.window
    const isLandscape = width > height
    this.setState({ isPortrait: !isLandscape })
    this.props.onFullscreenchange({ detail: { fullScreen: !!isLandscape, direction: isLandscape ? 'horizontal' : 'vertical' } })
    ScreenOrientation.allow(ScreenOrientation.Orientation.ALL)
  }