How to use the expo.ScreenOrientation.Orientation 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 jgcmarins / react-native-cryptocurrency / App.js View on Github external
/* @flow */

import React from 'react';
import { ScreenOrientation } from 'expo';

ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT);

import { View } from 'react-native';
import { StackNavigator } from 'react-navigation';

import StacksInTabs from './src/components/StacksInTab';

class MainScreen extends React.Component<*> {
  render() {
    return (
      
    );
  }
}
github expo / expo / apps / native-component-list / src / screens / ScreenOrientationScreen.tsx View on Github external
lockPlatformExample = async () => {
    if (Platform.OS === 'web') {
      // most web browsers require fullscreen in order to change screen orientation
      await document.documentElement.requestFullscreen();
    }

    await ScreenOrientation.lockPlatformAsync({
      screenOrientationLockWeb: ScreenOrientation.WebOrientationLock.LANDSCAPE,
      screenOrientationArrayIOS: [
        ScreenOrientation.Orientation.PORTRAIT_DOWN,
        ScreenOrientation.Orientation.LANDSCAPE_RIGHT,
      ],
      screenOrientationConstantAndroid: 8, // reverse landscape
    }).catch(e => alert(e)); // on iPhoneX PortraitUpsideDown would be rejected

    if (Platform.OS === 'web') {
      await document.exitFullscreen();
    }
  }
github DefinitelyTyped / DefinitelyTyped / types / expo / v24 / expo-tests.tsx View on Github external
Permissions.CONTACTS === 'contacts';
Permissions.NOTIFICATIONS === 'remoteNotifications';
Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
async () => {
    const result = await Permissions.askAsync(Permissions.CAMERA);

    result.status === 'granted';
    result.status === 'denied';
    result.status === 'undetermined';

    result.expires === 'never';
};

ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);

class __TestEntry__ extends React.Component {
    render() {
        return(
            
        );
    }
}
registerRootComponent(__TestEntry__);
github DefinitelyTyped / DefinitelyTyped / types / expo / v31 / expo-tests.tsx View on Github external
Permissions.NOTIFICATIONS === 'notifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
Permissions.USER_FACING_NOTIFICATIONS === 'userFacingNotifications';
Permissions.REMINDERS === 'reminders';
async () => {
    const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS);

    result.status === 'granted';
    result.status === 'denied';
    result.status === 'undetermined';

    result.expires === 'never';
};

ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);

class __TestEntry__ extends React.Component {
    render() {
        return(
            
        );
    }
}
registerRootComponent(__TestEntry__);

Calendar.EntityTypes.EVENT === 'event';
Calendar.EntityTypes.REMINDER === 'reminder';

Calendar.CalendarType.LOCAL === 'local';
Calendar.CalendarType.CALDAV === 'caldav';
Calendar.CalendarType.EXCHANGE === 'exchange';
github expo / three-ar-test / App.js View on Github external
async componentWillMount() {
    ThreeAR.suppressWarnings(true);
    THREE.suppressExpoWarnings(true);
    ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
  }
github expo / videoplayer / examples / expo-videoplayer-examples / navigation / RootNavigation.js View on Github external
switchToPortrait() {
    ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT);
  }
}
github NervJS / taro / packages / taro-components-rn / backupcode / Video / index.js View on Github external
componentDidMount () {
    ScreenOrientation.allow(ScreenOrientation.Orientation.ALL)
    Dimensions.addEventListener(
      'change',
      this.orientationChangeHandler.bind(this)
    )
  }
github NervJS / taro / packages / taro-components-rn / backupcode / Video / index.js View on Github external
switchToPortrait = () => {
    ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT)
  }
github czy0729 / Bangumi / screens / home / video / index.js View on Github external
componentWillUnmount() {
    ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT)
    Dimensions.removeEventListener('change', this.orientationChangeHandler)
  }
github itsezc / CycloneIO / packages / server / mobile / source / App.js View on Github external
componentDidMount() {
		ScreenOrientation.allowAsync(ScreenOrientation.Orientation.LANDSCAPE)
 	}