Skip to content

Commit ee87eee

Browse files
Merge branch 'master' into patch-3
2 parents 5a58712 + 295a015 commit ee87eee

File tree

305 files changed

+5349
-4133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+5349
-4133
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"SyntheticEvent": false,
6262
"$Either": false,
6363
"$All": false,
64+
"$ArrayBufferView": false,
6465
"$Tuple": false,
6566
"$Supertype": false,
6667
"$Subtype": false,
-223 Bytes
Loading
41.1 KB
Loading

Examples/UIExplorer/UIExplorerUnitTests/RCTShadowViewTests.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ - (void)setUp
2828
{
2929
[super setUp];
3030

31-
self.parentView = [self _shadowViewWithConfig:^(YGNodeRef node) {
32-
YGNodeStyleSetFlexDirection(node, YGFlexDirectionColumn);
33-
YGNodeStyleSetWidth(node, 440);
34-
YGNodeStyleSetHeight(node, 440);
35-
}];
31+
self.parentView = [RCTRootShadowView new];
32+
YGNodeStyleSetFlexDirection(self.parentView.cssNode, YGFlexDirectionColumn);
33+
YGNodeStyleSetWidth(self.parentView.cssNode, 440);
34+
YGNodeStyleSetHeight(self.parentView.cssNode, 440);
3635
self.parentView.reactTag = @1; // must be valid rootView tag
3736
}
3837

@@ -132,6 +131,7 @@ - (void)testAncestorCheck
132131
- (void)testAssignsSuggestedWidthDimension
133132
{
134133
[self _withShadowViewWithStyle:^(YGNodeRef node) {
134+
YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);
135135
YGNodeStyleSetPosition(node, YGEdgeLeft, 0);
136136
YGNodeStyleSetPosition(node, YGEdgeTop, 0);
137137
YGNodeStyleSetHeight(node, 10);
@@ -143,6 +143,7 @@ - (void)testAssignsSuggestedWidthDimension
143143
- (void)testAssignsSuggestedHeightDimension
144144
{
145145
[self _withShadowViewWithStyle:^(YGNodeRef node) {
146+
YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);
146147
YGNodeStyleSetPosition(node, YGEdgeLeft, 0);
147148
YGNodeStyleSetPosition(node, YGEdgeTop, 0);
148149
YGNodeStyleSetWidth(node, 10);
@@ -154,6 +155,7 @@ - (void)testAssignsSuggestedHeightDimension
154155
- (void)testDoesNotOverrideDimensionStyleWithSuggestedDimensions
155156
{
156157
[self _withShadowViewWithStyle:^(YGNodeRef node) {
158+
YGNodeStyleSetPositionType(node, YGPositionTypeAbsolute);
157159
YGNodeStyleSetPosition(node, YGEdgeLeft, 0);
158160
YGNodeStyleSetPosition(node, YGEdgeTop, 0);
159161
YGNodeStyleSetWidth(node, 10);
@@ -189,11 +191,12 @@ - (void)_withShadowViewWithStyle:(void(^)(YGNodeRef node))configBlock
189191
NSStringFromCGRect(actualRect));
190192
}
191193

192-
- (RCTRootShadowView *)_shadowViewWithConfig:(void(^)(YGNodeRef node))configBlock
194+
- (RCTShadowView *)_shadowViewWithConfig:(void(^)(YGNodeRef node))configBlock
193195
{
194-
RCTRootShadowView *shadowView = [RCTRootShadowView new];
196+
RCTShadowView *shadowView = [RCTShadowView new];
195197
configBlock(shadowView.cssNode);
196198
return shadowView;
197199
}
198200

201+
199202
@end

Examples/UIExplorer/js/ActionSheetIOSExample.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ class ShareActionSheetExample extends React.Component {
131131
]
132132
},
133133
(error) => alert(error),
134-
(success, method) => {
134+
(completed, method) => {
135135
var text;
136-
if (success) {
136+
if (completed) {
137137
text = `Shared via ${method}`;
138138
} else {
139139
text = 'You didn\'t share';
@@ -172,9 +172,9 @@ class ShareScreenshotExample extends React.Component {
172172
]
173173
},
174174
(error) => alert(error),
175-
(success, method) => {
175+
(completed, method) => {
176176
var text;
177-
if (success) {
177+
if (completed) {
178178
text = `Shared via ${method}`;
179179
} else {
180180
text = 'You didn\'t share';

Examples/UIExplorer/js/AnimatedGratuitousApp/AnExScroll.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,27 @@ class AnExScroll extends React.Component {
6969
<Animated.Image
7070
pointerEvents="none"
7171
style={[styles.bunny, {transform: [
72-
{translateX: this.state.scrollX.interpolate({
73-
inputRange: [0, width, 2 * width],
74-
outputRange: [0, 0, width / 3]}), // multi-part ranges
75-
extrapolate: 'clamp'}, // default is 'extend'
76-
{translateY: this.state.scrollX.interpolate({
77-
inputRange: [0, width, 2 * width],
78-
outputRange: [0, -200, -260]}),
79-
extrapolate: 'clamp'},
80-
{scale: this.state.scrollX.interpolate({
81-
inputRange: [0, width, 2 * width],
82-
outputRange: [0.5, 0.5, 2]}),
83-
extrapolate: 'clamp'},
72+
{
73+
translateX: this.state.scrollX.interpolate({
74+
inputRange: [0, width, 2 * width],
75+
outputRange: [0, 0, width / 3],
76+
extrapolate: 'clamp',
77+
}),
78+
},
79+
{
80+
translateY: this.state.scrollX.interpolate({
81+
inputRange: [0, width, 2 * width],
82+
outputRange: [0, -200, -260],
83+
extrapolate: 'clamp',
84+
}),
85+
},
86+
{
87+
scale: this.state.scrollX.interpolate({
88+
inputRange: [0, width, 2 * width],
89+
outputRange: [0.5, 0.5, 2],
90+
extrapolate: 'clamp',
91+
}),
92+
},
8493
]}]}
8594
source={BUNNY_PIC}
8695
/>

Examples/UIExplorer/js/ListViewExample.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var {
2929
ListView,
3030
TouchableHighlight,
3131
StyleSheet,
32-
RecyclerViewBackedScrollView,
3332
Text,
3433
View,
3534
} = ReactNative;
@@ -64,7 +63,6 @@ var ListViewSimpleExample = React.createClass({
6463
<ListView
6564
dataSource={this.state.dataSource}
6665
renderRow={this._renderRow}
67-
renderScrollComponent={props => <RecyclerViewBackedScrollView {...props} />}
6866
renderSeparator={this._renderSeparator}
6967
/>
7068
</UIExplorerPage>

Examples/UIExplorer/js/NativeAnimationsExample.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ const {
3030
Animated,
3131
StyleSheet,
3232
TouchableWithoutFeedback,
33+
Slider,
3334
} = ReactNative;
3435

36+
var AnimatedSlider = Animated.createAnimatedComponent(Slider);
37+
3538
class Tester extends React.Component {
3639
state = {
3740
native: new Animated.Value(0),
@@ -228,7 +231,6 @@ exports.description = 'Test out Native Animations';
228231
exports.examples = [
229232
{
230233
title: 'Multistage With Multiply and rotation',
231-
description: 'description',
232234
render: function() {
233235
return (
234236
<Tester
@@ -278,7 +280,6 @@ exports.examples = [
278280
},
279281
{
280282
title: 'Multistage With Multiply',
281-
description: 'description',
282283
render: function() {
283284
return (
284285
<Tester
@@ -322,7 +323,6 @@ exports.examples = [
322323
},
323324
{
324325
title: 'Scale interpolation with clamping',
325-
description: 'description',
326326
render: function() {
327327
return (
328328
<Tester
@@ -352,7 +352,6 @@ exports.examples = [
352352
},
353353
{
354354
title: 'Opacity without interpolation',
355-
description: 'description',
356355
render: function() {
357356
return (
358357
<Tester
@@ -374,7 +373,6 @@ exports.examples = [
374373
},
375374
{
376375
title: 'Rotate interpolation',
377-
description: 'description',
378376
render: function() {
379377
return (
380378
<Tester
@@ -403,7 +401,6 @@ exports.examples = [
403401
},
404402
{
405403
title: 'translateX => Animated.spring',
406-
description: 'description',
407404
render: function() {
408405
return (
409406
<Tester
@@ -454,6 +451,19 @@ exports.examples = [
454451
</Tester>
455452
);
456453
},
454+
},{
455+
title: 'Drive custom property',
456+
render: function() {
457+
return (
458+
<Tester
459+
type="timing"
460+
config={{ duration: 1000 }}>
461+
{anim => (
462+
<AnimatedSlider style={{}} value={anim} />
463+
)}
464+
</Tester>
465+
);
466+
},
457467
},
458468
{
459469
title: 'Animated value listener',

Examples/UIExplorer/js/ScrollViewExample.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ exports.examples = [
5757
onPress={() => { _scrollView.scrollTo({y: 0}); }}>
5858
<Text>Scroll to top</Text>
5959
</TouchableOpacity>
60+
<TouchableOpacity
61+
style={styles.button}
62+
onPress={() => { _scrollView.scrollToEnd({animated: true}); }}>
63+
<Text>Scroll to bottom</Text>
64+
</TouchableOpacity>
6065
</View>
6166
);
6267
}
@@ -79,6 +84,11 @@ exports.examples = [
7984
onPress={() => { _scrollView.scrollTo({x: 0}); }}>
8085
<Text>Scroll to start</Text>
8186
</TouchableOpacity>
87+
<TouchableOpacity
88+
style={styles.button}
89+
onPress={() => { _scrollView.scrollToEnd({animated: true}); }}>
90+
<Text>Scroll to end</Text>
91+
</TouchableOpacity>
8292
</View>
8393
);
8494
}

Examples/UIExplorer/js/SliderExample.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,23 @@ exports.examples = [
132132
},
133133
{
134134
title: 'Custom min/max track tint color',
135-
platform: 'ios',
136135
render(): React.Element<any> {
137136
return (
138137
<SliderExample
139-
minimumTrackTintColor={'red'}
140-
maximumTrackTintColor={'green'}
138+
minimumTrackTintColor={'blue'}
139+
maximumTrackTintColor={'red'}
140+
value={0.5}
141141
/>
142142
);
143143
}
144144
},
145+
{
146+
title: 'Custom thumb color',
147+
platform: 'android',
148+
render(): React.Element<any> {
149+
return <SliderExample thumbTintColor={'blue'} />;
150+
}
151+
},
145152
{
146153
title: 'Custom thumb image',
147154
platform: 'ios',

0 commit comments

Comments
 (0)