Skip to content

Commit 548aad4

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Delete Apple TV Props
Summary: With tvOS (Apple TV) now residing in a separately maintained fork, this removes the residual props from React Native. This only includes the JavaScript changes. The Objective-C changes will come later. Specifically, the following props have been removed: - `isTVSelectable` - `tvParallaxProperties` - `tvParallaxShiftDistanceX` - `tvParallaxShiftDistanceY` - `tvParallaxTiltAngle` - `tvParallaxMagnification` Note that `hasTVPreferredFocus` is still being used by Android TV, so it remains. Changelog: [Removed] Apple TV View Props Reviewed By: TheSavior Differential Revision: D18266278 fbshipit-source-id: 9d1448bf2f434a74e6eb23c70d3a37971e406768
1 parent 5a4d68f commit 548aad4

14 files changed

+8
-190
lines changed

Libraries/Components/AppleTV/TVViewPropTypes.js

-108
This file was deleted.

Libraries/Components/Touchable/TouchableHighlight.js

-19
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import type {PressEvent} from '../../Types/CoreEventTypes';
2929
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
3030
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
3131
import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
32-
import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes';
3332

3433
const DEFAULT_PROPS = {
3534
activeOpacity: 0.85,
@@ -41,7 +40,6 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
4140

4241
type IOSProps = $ReadOnly<{|
4342
hasTVPreferredFocus?: ?boolean,
44-
tvParallaxProperties?: ?TVParallaxPropertiesType,
4543
|}>;
4644

4745
type AndroidProps = $ReadOnly<{|
@@ -228,21 +226,6 @@ const TouchableHighlight = ((createReactClass({
228226
* @platform android
229227
*/
230228
nextFocusUp: PropTypes.number,
231-
/**
232-
* *(Apple TV only)* Object with properties to control Apple TV parallax effects.
233-
*
234-
* enabled: If true, parallax effects are enabled. Defaults to true.
235-
* shiftDistanceX: Defaults to 2.0.
236-
* shiftDistanceY: Defaults to 2.0.
237-
* tiltAngle: Defaults to 0.05.
238-
* magnification: Defaults to 1.0.
239-
* pressMagnification: Defaults to 1.0.
240-
* pressDuration: Defaults to 0.3.
241-
* pressDelay: Defaults to 0.0.
242-
*
243-
* @platform ios
244-
*/
245-
tvParallaxProperties: PropTypes.object,
246229
/**
247230
* Handy for snapshot tests.
248231
*/
@@ -418,8 +401,6 @@ const TouchableHighlight = ((createReactClass({
418401
)}
419402
onLayout={this.props.onLayout}
420403
hitSlop={this.props.hitSlop}
421-
isTVSelectable={true}
422-
tvParallaxProperties={this.props.tvParallaxProperties}
423404
hasTVPreferredFocus={this.props.hasTVPreferredFocus}
424405
nextFocusDown={this.props.nextFocusDown}
425406
nextFocusForward={this.props.nextFocusForward}

Libraries/Components/Touchable/TouchableNativeFeedback.android.js

-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ const TouchableNativeFeedback = createReactClass({
321321
testID: this.props.testID,
322322
onLayout: this.props.onLayout,
323323
hitSlop: this.props.hitSlop,
324-
isTVSelectable: true,
325324
nextFocusDown: this.props.nextFocusDown,
326325
nextFocusForward: this.props.nextFocusForward,
327326
nextFocusLeft: this.props.nextFocusLeft,

Libraries/Components/Touchable/TouchableOpacity.js

-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const flattenStyle = require('../../StyleSheet/flattenStyle');
2525

2626
import type {Props as TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
2727
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
28-
import type {TVParallaxPropertiesType} from '../AppleTV/TVViewPropTypes';
2928
import type {PressEvent} from '../../Types/CoreEventTypes';
3029

3130
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
@@ -37,7 +36,6 @@ type TVProps = $ReadOnly<{|
3736
nextFocusLeft?: ?number,
3837
nextFocusRight?: ?number,
3938
nextFocusUp?: ?number,
40-
tvParallaxProperties?: ?TVParallaxPropertiesType,
4139
|}>;
4240

4341
export type Props = $ReadOnly<{|
@@ -183,10 +181,6 @@ const TouchableOpacity = ((createReactClass({
183181
* @platform android
184182
*/
185183
nextFocusUp: PropTypes.number,
186-
/**
187-
* Apple TV parallax effects
188-
*/
189-
tvParallaxProperties: PropTypes.object,
190184
},
191185

192186
getDefaultProps: function() {
@@ -318,14 +312,12 @@ const TouchableOpacity = ((createReactClass({
318312
nativeID={this.props.nativeID}
319313
testID={this.props.testID}
320314
onLayout={this.props.onLayout}
321-
isTVSelectable={true}
322315
nextFocusDown={this.props.nextFocusDown}
323316
nextFocusForward={this.props.nextFocusForward}
324317
nextFocusLeft={this.props.nextFocusLeft}
325318
nextFocusRight={this.props.nextFocusRight}
326319
nextFocusUp={this.props.nextFocusUp}
327320
hasTVPreferredFocus={this.props.hasTVPreferredFocus}
328-
tvParallaxProperties={this.props.tvParallaxProperties}
329321
hitSlop={this.props.hitSlop}
330322
focusable={
331323
this.props.focusable !== false && this.props.onPress !== undefined

Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exports[`TouchableHighlight renders correctly 1`] = `
44
<View
55
accessible={true}
66
focusable={false}
7-
isTVSelectable={true}
87
onClick={[Function]}
98
onResponderGrant={[Function]}
109
onResponderMove={[Function]}

Libraries/Components/View/PlatformViewPropTypes.android.js

-14
This file was deleted.

Libraries/Components/View/PlatformViewPropTypes.ios.js

-16
This file was deleted.

Libraries/Components/View/ReactNativeViewViewConfig.js

-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ const ReactNativeViewConfig = {
172172
height: true,
173173
hitSlop: {diff: (require('../../Utilities/differ/insetsDiffer'): any)},
174174
importantForAccessibility: true,
175-
isTVSelectable: true,
176175
justifyContent: true,
177176
left: true,
178177
margin: true,
@@ -335,7 +334,6 @@ const ReactNativeViewConfig = {
335334
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
336335
translateX: true,
337336
translateY: true,
338-
tvParallaxProperties: true,
339337
width: true,
340338
zIndex: true,
341339
},

Libraries/Components/View/ViewPropTypes.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type {PressEvent, Layout, LayoutEvent} from '../../Types/CoreEventTypes';
1414
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
1515
import type {Node} from 'react';
1616
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
17-
import type {TVViewProps} from '../AppleTV/TVViewPropTypes';
1817
import type {
1918
AccessibilityRole,
2019
AccessibilityState,
@@ -275,6 +274,13 @@ type AndroidViewProps = $ReadOnly<{|
275274
*/
276275
importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'),
277276

277+
/**
278+
* Whether to force the Android TV focus engine to move focus to this view.
279+
*
280+
* @platform android
281+
*/
282+
hasTVPreferredFocus?: boolean,
283+
278284
/**
279285
* TV next focus down (see documentation for the View component).
280286
*
@@ -371,10 +377,6 @@ export type ViewProps = $ReadOnly<{|
371377
...AndroidViewProps,
372378
...IOSViewProps,
373379

374-
// There's no easy way to create a different type if (Platform.isTV):
375-
// so we must include TVViewProps
376-
...TVViewProps,
377-
378380
children?: Node,
379381
style?: ?ViewStyleProp,
380382

Libraries/DeprecatedPropTypes/DeprecatedTVViewPropTypes.js

-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
const PropTypes = require('prop-types');
1414

1515
const DeprecatedTVViewPropTypes = {
16-
isTVSelectable: PropTypes.bool,
1716
hasTVPreferredFocus: PropTypes.bool,
18-
tvParallaxProperties: PropTypes.object,
1917
tvParallaxShiftDistanceX: PropTypes.number,
2018
tvParallaxShiftDistanceY: PropTypes.number,
2119
tvParallaxTiltAngle: PropTypes.number,

Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js

-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
const DeprecatedEdgeInsetsPropType = require('./DeprecatedEdgeInsetsPropType');
1414
const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType');
1515
const DeprecatedViewStylePropTypes = require('./DeprecatedViewStylePropTypes');
16-
const PlatformViewPropTypes = require('../Components/View/PlatformViewPropTypes');
1716
const PropTypes = require('prop-types');
1817

1918
const {DeprecatedAccessibilityRoles} = require('./DeprecatedViewAccessibility');
@@ -406,9 +405,4 @@ module.exports = {
406405
* See http://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing
407406
*/
408407
needsOffscreenAlphaCompositing: PropTypes.bool,
409-
410-
/**
411-
* Any additional platform-specific view prop types, or prop type overrides.
412-
*/
413-
...PlatformViewPropTypes,
414408
};

RNTester/js/components/ListExampleShared.js

-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ class ItemComponent extends React.PureComponent<{
6969
onPress={this._onPress}
7070
onShowUnderlay={this.props.onShowUnderlay}
7171
onHideUnderlay={this.props.onHideUnderlay}
72-
tvParallaxProperties={{
73-
pressMagnification: 1.1,
74-
}}
7572
style={horizontal ? styles.horizItem : styles.item}>
7673
<View
7774
style={[

RNTester/js/examples/Touchable/TouchableExample.js

-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ class TouchableHighlightBox extends React.Component<{}, $FlowFixMeState> {
6060
style={styles.wrapper}
6161
testID="touchable_highlight_text_button"
6262
activeOpacity={1}
63-
tvParallaxProperties={{
64-
pressMagnification: 1.3,
65-
pressDuration: 0.6,
66-
}}
6763
underlayColor="rgb(210, 230, 255)"
6864
onPress={this.touchableOnPress}>
6965
<View style={styles.wrapperCustom}>

React/Views/RCTViewManager.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ - (RCTShadowView *)shadowView
115115
#pragma mark - View properties
116116

117117
#if TARGET_OS_TV
118-
// Apple TV properties
118+
// TODO: Delete props for Apple TV.
119119
RCT_EXPORT_VIEW_PROPERTY(isTVSelectable, BOOL)
120120
RCT_EXPORT_VIEW_PROPERTY(hasTVPreferredFocus, BOOL)
121121
RCT_EXPORT_VIEW_PROPERTY(tvParallaxProperties, NSDictionary)

0 commit comments

Comments
 (0)