react-native-tvos
Version:
A framework for building native apps using React
41 lines (36 loc) • 1.33 kB
JavaScript
/**
* Methods to enable and disable listening for Apple TV remote events (menu key, pan gesture)
*
* @format
* @flow
*/
;
import NativeTVNavigationEventEmitter from '../../../src/private/specs_DEPRECATED/modules/NativeTVNavigationEventEmitter';
import Platform from '../../Utilities/Platform';
const TVEventControl = {
enableTVMenuKey: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.enableTVMenuKey();
},
disableTVMenuKey: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.disableTVMenuKey();
},
enableTVPanGesture: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.enableTVPanGesture();
},
disableTVPanGesture: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.disableTVPanGesture();
},
enableGestureHandlersCancelTouches: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.enableGestureHandlersCancelTouches();
},
disableGestureHandlersCancelTouches: () => {
Platform.isTV && NativeTVNavigationEventEmitter &&
NativeTVNavigationEventEmitter.disableGestureHandlersCancelTouches();
},
};
export default TVEventControl;