How to use react-native-orientation-locker - 10 common examples

To help you get started, we’ve selected a few react-native-orientation-locker 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 RocketChat / Rocket.Chat.ReactNative / app / views / RoomsListView / index.js View on Github external
componentDidMount() {
		this.getSubscriptions();
		const { navigation, closeServerDropdown } = this.props;
		navigation.setParams({
			onPressItem: this._onPressItem,
			initSearchingAndroid: this.initSearchingAndroid,
			cancelSearchingAndroid: this.cancelSearchingAndroid
		});
		if (isTablet) {
			EventEmitter.addEventListener(KEY_COMMAND, this.handleCommands);
		}
		Dimensions.addEventListener('change', this.onDimensionsChange);
		Orientation.unlockAllOrientations();
		this.willFocusListener = navigation.addListener('willFocus', () => {
			// Check if there were changes while not focused (it's set on sCU)
			if (this.shouldUpdate) {
				// animateNextTransition();
				this.forceUpdate();
				this.shouldUpdate = false;
			}
		});
		this.didFocusListener = navigation.addListener('didFocus', () => {
			this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
		});
		this.willBlurListener = navigation.addListener('willBlur', () => {
			closeServerDropdown();
			if (this.backHandler && this.backHandler.remove) {
				this.backHandler.remove();
			}
github RocketChat / Rocket.Chat.ReactNative / app / views / SetUsernameView.js View on Github external
constructor(props) {
		super(props);
		this.state = {
			username: '',
			saving: false
		};
		const { server } = this.props;
		props.navigation.setParams({ title: server });
		Orientation.lockToPortrait();
	}
github unreg / loreader / src / app.js View on Github external
componentDidMount() {
    Orientation.lockToPortrait();
  };
github RocketChat / Rocket.Chat.ReactNative / app / views / OnboardingView / index.js View on Github external
constructor(props) {
		super('OnboardingView', props);
		BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
		this.previousServer = props.navigation.getParam('previousServer');
		Orientation.lockToPortrait();
	}
github experiment322 / controlloid-client / js / AppRoot.jsx View on Github external
componentDidMount() {
    KeepAwake.deactivate();
    StatusBar.setHidden(false);
    Orientation.unlockAllOrientations();
    setTimeout(SplashScreen.hide);
  }
github RocketChat / Rocket.Chat.ReactNative / app / views / RoomsListView / index.js View on Github external
this.data = [];
		this.state = {
			searching: false,
			search: [],
			loading: true,
			chats: [],
			unread: [],
			favorites: [],
			discussions: [],
			channels: [],
			privateGroup: [],
			direct: [],
			livechat: [],
			width
		};
		Orientation.unlockAllOrientations();
		this.didFocusListener = props.navigation.addListener('didFocus', () => BackHandler.addEventListener('hardwareBackPress', this.handleBackPress));
		this.willBlurListener = props.navigation.addListener('willBlur', () => BackHandler.addEventListener('hardwareBackPress', this.handleBackPress));
	}
github experiment322 / controlloid-client / js / interface / screens / EditorScreen.jsx View on Github external
componentWillUnmount() {
    const { layout } = this.state;
    const { createLayout, navigation } = this.props;
    createLayout(navigation.getParam("editedLayout"), layout);
    Orientation.unlockAllOrientations();
    StatusBar.setHidden(false);
    KeepAwake.deactivate();
  }
github experiment322 / controlloid-client / js / interface / screens / ControllerScreen.jsx View on Github external
componentWillUnmount() {
    const { navigation } = this.props;
    navigation.getParam("socketClose")();
    Orientation.unlockAllOrientations();
    StatusBar.setHidden(false);
    KeepAwake.deactivate();
  }
github experiment322 / controlloid-client / js / interface / screens / EditorScreen.jsx View on Github external
componentDidMount() {
    const { layouts, navigation } = this.props;
    KeepAwake.activate();
    StatusBar.setHidden(true);
    Orientation.lockToLandscape();
    this.setState({ layout: _.cloneDeep(layouts[navigation.getParam("editedLayout")]) });
  }
github experiment322 / controlloid-client / js / interface / screens / ControllerScreen.jsx View on Github external
componentDidMount() {
    KeepAwake.activate();
    StatusBar.setHidden(true);
    Orientation.lockToLandscape();
  }

react-native-orientation-locker

A react-native module that can listen on orientation changing of device, get current orientation, lock to preferred orientation.

MIT
Latest version published 5 days ago

Package Health Score

80 / 100
Full package analysis