Switch to Platform.isTV to pass Android Flow

Reviewed By: sahrens

Differential Revision: D8345911

fbshipit-source-id: 9af7a25127e7c35844a6c59b267a77cf8adba535
This commit is contained in:
Eli White 2018-06-10 13:37:53 -07:00 committed by Facebook Github Bot
parent f573ea8a66
commit 160bf731e5
11 changed files with 17 additions and 17 deletions

View File

@ -1041,7 +1041,7 @@ const ScrollView = createReactClass({
return (
// $FlowFixMe Invalid prop usage
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
{Platform.isTVOS ? null : refreshControl}
{Platform.isTV ? null : refreshControl}
{contentContainer}
</ScrollViewClass>
);

View File

@ -269,7 +269,7 @@ const TouchableHighlight = ((createReactClass({
touchableHandlePress: function(e: PressEvent) {
clearTimeout(this._hideTimeout);
if (!Platform.isTVOS) {
if (!Platform.isTV) {
this._showUnderlay();
this._hideTimeout = setTimeout(
this._hideUnderlay,

View File

@ -72,7 +72,7 @@ export type ViewProps = $ReadOnly<{|
...GestureResponderEventProps,
...TouchEventProps,
// There's no easy way to create a different type if (Platform.isTVOS):
// There's no easy way to create a different type if (Platform.isTV):
// so we must include TVViewProps
...TVViewProps,

View File

@ -90,7 +90,7 @@ class Modal extends React.Component<Object> {
* See https://facebook.github.io/react-native/docs/modal.html#onrequestclose
*/
onRequestClose:
Platform.isTVOS || Platform.OS === 'android'
Platform.isTV || Platform.OS === 'android'
? PropTypes.func.isRequired
: PropTypes.func,
/**

View File

@ -53,7 +53,7 @@ function emptyFunction() {}
*/
let BackHandler;
if (Platform.isTVOS) {
if (Platform.isTV) {
const _tvEventHandler = new TVEventHandler();
const _backPressSubscriptions = new Set();

View File

@ -16,7 +16,7 @@ var {ART, Platform, View} = ReactNative;
const {Surface, Path, Group, Transform, Shape} = ART;
var scale = Platform.isTVOS ? 4 : 1;
var scale = Platform.isTV ? 4 : 1;
class ARTExample extends React.Component<{}> {
render() {

View File

@ -237,7 +237,7 @@ function pressItem(context: Object, key: string) {
}
function renderSmallSwitchOption(context: Object, key: string) {
if (Platform.isTVOS) {
if (Platform.isTV) {
return null;
}
return (

View File

@ -94,7 +94,7 @@ class ModalExample extends React.Component<{}, $FlowFixMeState> {
};
renderSwitch() {
if (Platform.isTVOS) {
if (Platform.isTV) {
return null;
}
return (
@ -191,7 +191,7 @@ class ModalExample extends React.Component<{}, $FlowFixMeState> {
);
}
renderPickers() {
if (Platform.isTVOS) {
if (Platform.isTV) {
return null;
}
return (

View File

@ -80,7 +80,7 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
* comment and run Flow. */
this.props.disableSearch ||
(filterRegex.test(example.module.title) &&
(!Platform.isTVOS || example.supportsTVOS));
(!Platform.isTV || example.supportsTVOS));
const sections = [
{

View File

@ -74,7 +74,7 @@ class TVEventHandlerView extends React.Component<
}
render() {
if (Platform.isTVOS) {
if (Platform.isTV) {
return (
<View>
<TouchableOpacity onPress={() => {}}>

View File

@ -324,12 +324,12 @@ exports.examples = [
render: function() {
return (
<View>
<Text style={{fontFamily: Platform.isTVOS ? 'Times' : 'Cochin'}}>
<Text style={{fontFamily: Platform.isTV ? 'Times' : 'Cochin'}}>
Cochin
</Text>
<Text
style={{
fontFamily: Platform.isTVOS ? 'Times' : 'Cochin',
fontFamily: Platform.isTV ? 'Times' : 'Cochin',
fontWeight: 'bold',
}}>
Cochin bold
@ -338,12 +338,12 @@ exports.examples = [
<Text style={{fontFamily: 'Helvetica', fontWeight: 'bold'}}>
Helvetica bold
</Text>
<Text style={{fontFamily: Platform.isTVOS ? 'Courier' : 'Verdana'}}>
<Text style={{fontFamily: Platform.isTV ? 'Courier' : 'Verdana'}}>
Verdana
</Text>
<Text
style={{
fontFamily: Platform.isTVOS ? 'Courier' : 'Verdana',
fontFamily: Platform.isTV ? 'Courier' : 'Verdana',
fontWeight: 'bold',
}}>
Verdana bold
@ -817,14 +817,14 @@ exports.examples = [
<Text style={{fontVariant: ['small-caps']}}>Small Caps{'\n'}</Text>
<Text
style={{
fontFamily: Platform.isTVOS ? 'Times' : 'Hoefler Text',
fontFamily: Platform.isTV ? 'Times' : 'Hoefler Text',
fontVariant: ['oldstyle-nums'],
}}>
Old Style nums 0123456789{'\n'}
</Text>
<Text
style={{
fontFamily: Platform.isTVOS ? 'Times' : 'Hoefler Text',
fontFamily: Platform.isTV ? 'Times' : 'Hoefler Text',
fontVariant: ['lining-nums'],
}}>
Lining nums 0123456789{'\n'}