Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a2db4a4
Removed redundant JSON encode/decode from RCTDataManager
nicklockwood Jun 1, 2015
49e87af
Fixed text update on OSS
nicklockwood Jun 1, 2015
57ce9fb
[package.json] Leave the protocol choice for a Github repo to npm
Jun 1, 2015
2b4daf2
Expose fontScale to JS
foghina Jun 1, 2015
d548c85
[Bridge] Add support for JS async functions to RCT_EXPORT_METHOD
ide Jun 1, 2015
d723e17
[ReactNative] Copy assets to corresponding folders on Android
frantic Jun 1, 2015
34cef28
[ReactNative] kill setInterval in ListView
sahrens Jun 1, 2015
43adb7b
[CameraRoll] support fetching videos from the camera roll
jsierles Jun 1, 2015
38f57ee
[ReactNative] improve UIExplorer keyboard interactions
sahrens Jun 1, 2015
2a6fe07
[Timers] Batch setImmediate handlers
ide Jun 1, 2015
219a7c1
[ReactNative] Navigator block touches on scene when navigating
Jun 1, 2015
e6c04df
fix bug with inspector clicking
Jun 2, 2015
1ed2542
Revert "[Bridge] Add support for JS async functions to RCT_EXPORT_MET…
Jun 2, 2015
570597c
[react-native] dispatch perf updates to main thread
jsh1 Jun 2, 2015
dc6fd82
[react-native] -mountOrUnmountSubview: should handle zero-sized clip-…
jsh1 Jun 2, 2015
777363f
[ReactNative] Use NSDictionary + NSNumber for event coalescing
tadeuzagallo Jun 2, 2015
0aa7f3f
[react_native] Implement connectivity module
andreicoman11 Jun 2, 2015
2dfa3b3
[ReactNative] Track bridge events' flow
tadeuzagallo Jun 2, 2015
0f16d15
[ReactNative] Optimize console.profile and add markers on JS entry po…
tadeuzagallo Jun 2, 2015
c094a15
[react_native] JS files from D2036695: [ReactNative] Implement ne…
astreet Jun 2, 2015
9b455c8
[react_native] JS files from D2115306: implement ExceptionsManager.re…
andreicoman11 Jun 2, 2015
4d4f2df
Revert "[ReactNative] Track bridge events' flow"
Jun 2, 2015
78f83ac
Debugger won't start due to spaces in directory path
rickyc Jun 2, 2015
d90999a
[ReactNative] Disable UIExplorer render test
Jun 3, 2015
d796584
[ReactNative] ErrorUtils.reportError shouldn't redbox
sahrens Jun 3, 2015
1c82de4
[SampleApp + UIExplorer] Typos in the tests
kayluhb Jun 3, 2015
b243236
[Cosmetic] Fixing comment typo
Jun 3, 2015
95d2843
Revert "[Timers] Batch setImmediate handlers"
astreet Jun 3, 2015
10b1351
Simplify RKDataManager
nicklockwood Jun 3, 2015
158d8b6
[ReactNative] Track bridge events' flow (timers fixed)
tadeuzagallo Jun 3, 2015
0d29a69
Updates from Wed 3 Jun
Jun 3, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/Movies/Movies/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
2 changes: 1 addition & 1 deletion Examples/SampleApp/SampleAppTests/SampleAppTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ - (void)testRendersWelcomeScreen {
}

XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
}


Expand Down
15 changes: 14 additions & 1 deletion Examples/UIExplorer/CameraRollView.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ var propTypes = {
* imagesPerRow: Number of images to be shown in each row.
*/
imagesPerRow: React.PropTypes.number,

/**
* The asset type, one of 'Photos', 'Videos' or 'All'
*/
assetType: React.PropTypes.oneOf([
'Photos',
'Videos',
'All',
]),

};

var CameraRollView = React.createClass({
Expand All @@ -69,6 +79,7 @@ var CameraRollView = React.createClass({
groupTypes: 'SavedPhotos',
batchSize: 5,
imagesPerRow: 1,
assetType: 'Photos',
renderImage: function(asset) {
var imageSize = 150;
var imageStyle = [styles.image, {width: imageSize, height: imageSize}];
Expand All @@ -89,6 +100,7 @@ var CameraRollView = React.createClass({
assets: ([]: Array<Image>),
groupTypes: this.props.groupTypes,
lastCursor: (null : ?string),
assetType: this.props.assetType,
noMore: false,
loadingMore: false,
dataSource: ds,
Expand Down Expand Up @@ -124,7 +136,8 @@ var CameraRollView = React.createClass({

var fetchParams: Object = {
first: this.props.batchSize,
groupTypes: this.props.groupTypes
groupTypes: this.props.groupTypes,
assetType: this.props.assetType,
};
if (this.state.lastCursor) {
fetchParams.after = this.state.lastCursor;
Expand Down
10 changes: 5 additions & 5 deletions Examples/UIExplorer/NetInfoExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ var ReachabilitySubscription = React.createClass({
};
},
componentDidMount: function() {
NetInfo.reachabilityIOS.addEventListener(
NetInfo.addEventListener(
'change',
this._handleReachabilityChange
);
},
componentWillUnmount: function() {
NetInfo.reachabilityIOS.removeEventListener(
NetInfo.removeEventListener(
'change',
this._handleReachabilityChange
);
Expand Down Expand Up @@ -63,16 +63,16 @@ var ReachabilityCurrent = React.createClass({
};
},
componentDidMount: function() {
NetInfo.reachabilityIOS.addEventListener(
NetInfo.addEventListener(
'change',
this._handleReachabilityChange
);
NetInfo.reachabilityIOS.fetch().done(
NetInfo.fetch().done(
(reachability) => { this.setState({reachability}); }
);
},
componentWillUnmount: function() {
NetInfo.reachabilityIOS.removeEventListener(
NetInfo.removeEventListener(
'change',
this._handleReachabilityChange
);
Expand Down
159 changes: 159 additions & 0 deletions Examples/UIExplorer/TransformExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule TransformExample
*/
'use strict';

var React = require('React');

var StyleSheet = require('StyleSheet');
var TimerMixin = require('react-timer-mixin');
var UIExplorerBlock = require('UIExplorerBlock');
var UIExplorerPage = require('UIExplorerPage');
var View = require('View');

var TransformExample = React.createClass({

mixins: [TimerMixin],

getInitialState() {
return {
interval: this.setInterval(this._update, 800),
pulse: false,
};
},

render() {
return (
<UIExplorerPage title="Transforms">
<UIExplorerBlock title="foo bar">
<View style={{height: 500}}>
<View style={styles.box1} />
<View style={styles.box2} />
<View style={styles.box3step1} />
<View style={styles.box3step2} />
<View style={styles.box3step3} />
<View style={styles.box4} />
<View style={[
styles.box5,
this.state.pulse ? styles.box5Transform : null
]} />
</View>
</UIExplorerBlock>
</UIExplorerPage>
);
},

_update() {
this.setState({
pulse: !this.state.pulse,
});
},

});

var styles = StyleSheet.create({
box1: {
left: 0,
backgroundColor: 'green',
height: 50,
position: 'absolute',
top: 0,
transform: [
{translateX: 100},
{translateY: 50},
{rotate: '30deg'},
{scaleX: 2},
{scaleY: 2},
],
width: 50,
},
box2: {
left: 0,
backgroundColor: 'purple',
height: 50,
position: 'absolute',
top: 0,
transform: [
{scaleX: 2},
{scaleY: 2},
{translateX: 100},
{translateY: 50},
{rotate: '30deg'},
],
width: 50,
},
box3step1: {
left: 0,
backgroundColor: '#ffb6c1', // lightpink
height: 50,
position: 'absolute',
top: 0,
transform: [
{rotate: '30deg'},
],
width: 50,
},
box3step2: {
left: 0,
backgroundColor: '#ff69b4', //hotpink
height: 50,
opacity: 0.5,
position: 'absolute',
top: 0,
transform: [
{rotate: '30deg'},
{scaleX: 2},
{scaleY: 2},
],
width: 50,
},
box3step3: {
left: 0,
backgroundColor: '#ff1493', // deeppink
height: 50,
opacity: 0.5,
position: 'absolute',
top: 0,
transform: [
{rotate: '30deg'},
{scaleX: 2},
{scaleY: 2},
{translateX: 100},
{translateY: 50},
],
width: 50,
},
box4: {
left: 0,
backgroundColor: '#ff8c00', // darkorange
height: 50,
position: 'absolute',
top: 0,
transform: [
{translate: [200, 350]},
{scale: 2.5},
{rotate: '-0.2rad'},
],
width: 100,
},
box5: {
backgroundColor: '#800000', // maroon
height: 50,
position: 'absolute',
right: 0,
top: 0,
width: 50,
},
box5Transform: {
transform: [
{translate: [-50, 35]},
{rotate: '50deg'},
{scale: 2},
],
},
});


module.exports = TransformExample;
4 changes: 3 additions & 1 deletion Examples/UIExplorer/UIExplorerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var {
var { TestModule } = React.addons;
var Settings = require('Settings');

import type { Example, ExampleModule } from 'ExampleTypes';
import type { ExampleModule } from 'ExampleTypes';

var createExamplePage = require('./createExamplePage');

Expand Down Expand Up @@ -154,7 +154,9 @@ class UIExplorerList extends React.Component {
dataSource={this.state.dataSource}
renderRow={this._renderRow.bind(this)}
renderSectionHeader={this._renderSectionHeader}
keyboardShouldPersistTaps={true}
automaticallyAdjustContentInsets={false}
keyboardDismissMode="onDrag"
/>
</View>
);
Expand Down
5 changes: 4 additions & 1 deletion Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
// Make sure this test runs first because the other tests will tear out the rootView
- (void)testAAA_RootViewLoadsAndRenders
{
// TODO (t7296305) Fix and Re-Enable this UIExplorer Test
return;

UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController;
RCTAssert([vc.view isKindOfClass:[RCTRootView class]], @"This test must run first.");
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
Expand All @@ -82,7 +85,7 @@ - (void)testAAA_RootViewLoadsAndRenders
}

XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Cound't find element with '<View>' text in %d seconds", TIMEOUT_SECONDS);
XCTAssertTrue(foundElement, @"Couldn't find element with '<View>' text in %d seconds", TIMEOUT_SECONDS);
}

#define RCT_SNAPSHOT_TEST(name, reRecord) \
Expand Down
15 changes: 15 additions & 0 deletions Libraries/CameraRoll/CameraRoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ var GROUP_TYPES_OPTIONS = [
'SavedPhotos', // default
];

var ASSET_TYPE_OPTIONS = [
'All',
'Videos',
'Photos', // default
];


// Flow treats Object and Array as disjoint types, currently.
deepFreezeAndThrowOnMutationInDev((GROUP_TYPES_OPTIONS: any));
deepFreezeAndThrowOnMutationInDev((ASSET_TYPE_OPTIONS: any));

/**
* Shape of the param arg for the `getPhotos` function.
Expand Down Expand Up @@ -58,6 +66,11 @@ var getPhotosParamChecker = createStrictShapeTypeChecker({
* titles.
*/
groupName: ReactPropTypes.string,

/**
* Specifies filter on asset type
*/
assetType: ReactPropTypes.oneOf(ASSET_TYPE_OPTIONS),
});

/**
Expand Down Expand Up @@ -94,6 +107,7 @@ var getPhotosReturnChecker = createStrictShapeTypeChecker({
class CameraRoll {

static GroupTypesOptions: Array<string>;
static AssetTypeOptions: Array<string>;
/**
* Saves the image with tag `tag` to the camera roll.
*
Expand Down Expand Up @@ -154,5 +168,6 @@ class CameraRoll {
}

CameraRoll.GroupTypesOptions = GROUP_TYPES_OPTIONS;
CameraRoll.AssetTypeOptions = ASSET_TYPE_OPTIONS;

module.exports = CameraRoll;
9 changes: 4 additions & 5 deletions Libraries/CustomComponents/ListView/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ var DEFAULT_INITIAL_ROWS = 10;
var DEFAULT_SCROLL_RENDER_AHEAD = 1000;
var DEFAULT_END_REACHED_THRESHOLD = 1000;
var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;
var RENDER_INTERVAL = 20;
var SCROLLVIEW_REF = 'listviewscroll';


Expand Down Expand Up @@ -258,7 +257,6 @@ var ListView = React.createClass({
// the component is laid out
this.requestAnimationFrame(() => {
this._measureAndUpdateScrollProps();
this.setInterval(this._renderMoreRowsIfNeeded, RENDER_INTERVAL);
});
},

Expand Down Expand Up @@ -329,7 +327,7 @@ var ListView = React.createClass({
totalIndex++;

if (this.props.renderSeparator &&
(rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length -1)) {
(rowIdx !== rowIDs.length - 1 || sectionIdx === allRowIDs.length - 1)) {
var adjacentRowHighlighted =
this.state.highlightedRow.sectionID === sectionID && (
this.state.highlightedRow.rowID === rowID ||
Expand Down Expand Up @@ -397,6 +395,7 @@ var ListView = React.createClass({
_setScrollVisibleHeight: function(left, top, width, height) {
this.scrollProperties.visibleHeight = height;
this._updateVisibleRows();
this._renderMoreRowsIfNeeded();
},

_renderMoreRowsIfNeeded: function() {
Expand Down Expand Up @@ -443,8 +442,8 @@ var ListView = React.createClass({
}
var updatedFrames = e && e.nativeEvent.updatedChildFrames;
if (updatedFrames) {
updatedFrames.forEach((frame) => {
this._childFrames[frame.index] = merge(frame);
updatedFrames.forEach((newFrame) => {
this._childFrames[newFrame.index] = merge(newFrame);
});
}
var dataSource = this.props.dataSource;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ var Navigator = React.createClass({
key={this.state.idStack[i]}
ref={'scene_' + i}
onStartShouldSetResponderCapture={() => {
return i !== this.state.presentedIndex;
return !!this.state.transitionFromIndex || !!this.state.activeGesture;
}}
style={[styles.baseScene, this.props.sceneStyle, disabledSceneStyle]}>
{React.cloneElement(child, {
Expand Down
Loading