Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates 2015 07 27 #2136

Merged
merged 40 commits into from
Jul 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
aefb3d3
[ReactNative] Use new animation library for 2048 game demo
andreicoman11 Jul 23, 2015
3fa3963
[MovieApp] Add key to image components inside of MovieCell.
christopherdro Jul 23, 2015
10ffe17
[StatusBar] Add ability to toggle the network activity indicator in t…
negativetwelve Jul 23, 2015
9e4af68
[react-native] enable react devtools from JavascriptCore
Jul 23, 2015
710d29e
[ReactNative] Update React to 0.14-beta1
sophiebits Jul 24, 2015
e01f907
[ReactNative] Update core RN modules to work with React 0.14-beta1
sophiebits Jul 24, 2015
accf6f1
Make the scrollResponderScrollNativeHandleToKeyboard works on Android
Jul 24, 2015
1b06e41
fix examaple TabBarIOSExample bug; show click num when user click sec…
Jul 24, 2015
7c87952
[ReactNative] Image docs
Jul 24, 2015
ef5cec4
Text highlighting on iOS
nicklockwood Jul 24, 2015
4499f28
[ReactNative] Remove wrong lock from RCTProfile
tadeuzagallo Jul 24, 2015
81dd9c2
Optimized property setting and conversion
nicklockwood Jul 24, 2015
000ab11
[ReactNative] Adding clear function to the react native TextInput com…
Jul 24, 2015
a1612a7
[ReactNative] Delete AnimationExperimental and AnimationUtils
Jul 24, 2015
d10e4db
[ReactNative] Use ASCII double quotes
Jul 24, 2015
bf7e2a8
[Navigator] Vertically hide disabled scenes and use pointerEvents="none"
ide Jul 24, 2015
c8373d2
[Chrome Debugger] Update ws dependency to 0.7.2
ide Jul 24, 2015
ea5276e
[Navigator] Port navigation APIs from Navigator to NavigationContext
Jul 24, 2015
5f03172
Switched to OSS <Text> implementation for internal apps
nicklockwood Jul 25, 2015
53222f0
[Packager] Include Content-Type headers with bundle and source maps
ide Jul 25, 2015
f1bd1cb
[ReactNative] cleanup native components
sahrens Jul 25, 2015
aca76c7
Fix gzip on iOS 9
nicklockwood Jul 27, 2015
f69e33e
[ReactNative] Text docs
Jul 27, 2015
c3d194d
[ReactNative] TextInput docs
Jul 27, 2015
0e5422f
Fixed text highlight alignment when text has nonzero padding.
nicklockwood Jul 27, 2015
f9abb5a
Fixed missing redbox at startup
nicklockwood Jul 27, 2015
d178e27
Fix UIExplorer freezing / persistence
Jul 27, 2015
2c52909
Converted RCTImageLoader to be a bridge module
nicklockwood Jul 27, 2015
7996c32
Unregistered modules will now only error when called, not on bridge init
nicklockwood Jul 27, 2015
2eb401a
Updates from 2015-07-27
frantic Jul 27, 2015
09bb761
Fixed RCTDownloadTaskWrapper crash on iOS7
nicklockwood Jul 27, 2015
b7253dc
[ReactNative] PixelRatio docs
Jul 27, 2015
33e62f7
[ReactNative] CameraRoll docs
Jul 27, 2015
18e6094
[ReactNative] Add overflow to the whitelisted Image props
vjeux Jul 27, 2015
58a403d
[ReactNative] Pin babel version
frantic Jul 27, 2015
9649e7c
More updates
frantic Jul 27, 2015
842ce51
[Treehouse RN] Make smoothScrollTo works by not calling it twice
Jul 27, 2015
3b83853
[ReactNative] fix onMoveShouldSetPanResponderCapture
Jul 27, 2015
3cff9be
[ReactNative] Update project template .flowconfig
sophiebits Jul 27, 2015
62b7920
More updates
frantic Jul 27, 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
12 changes: 7 additions & 5 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

# Ignore react-tools where there are overlaps, but don't ignore anything that
# react-native relies on
.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js
.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js
.*/node_modules/react-tools/src/browser/ui/React.js
.*/node_modules/react-tools/src/core/ReactInstanceHandles.js
.*/node_modules/react-tools/src/event/EventPropagators.js
.*/node_modules/react-tools/src/React.js
.*/node_modules/react-tools/src/renderers/shared/reconciler/ReactInstanceHandles.js
.*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js
.*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js

# Ignore commoner tests
.*/node_modules/commoner/test/.*
Expand Down
70 changes: 35 additions & 35 deletions Examples/2048/Game2048.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var {
View,
} = React;

var AnimationExperimental = require('AnimationExperimental');
var Animated = require('Animated');
var GameBoard = require('GameBoard');
var TouchableBounce = require('TouchableBounce');

Expand Down Expand Up @@ -53,58 +53,58 @@ class Board extends React.Component {
}

class Tile extends React.Component {
calculateOffset(): {top: number; left: number; opacity: number} {
static _getPosition(index): number {
return BOARD_PADDING + (index * (CELL_SIZE + CELL_MARGIN * 2) + CELL_MARGIN);
}

constructor(props: {}) {
super(props);

var tile = this.props.tile;

var pos = (i) => {
return BOARD_PADDING + (i * (CELL_SIZE + CELL_MARGIN * 2) + CELL_MARGIN);
this.state = {
opacity: new Animated.Value(0),
top: new Animated.Value(Tile._getPosition(tile.toRow())),
left: new Animated.Value(Tile._getPosition(tile.toColumn())),
};
}

var animationPosition = (i) => {
return pos(i) + (CELL_SIZE / 2);
};
calculateOffset(): {top: number; left: number; opacity: number} {
var tile = this.props.tile;

var offset = {
top: pos(tile.toRow()),
left: pos(tile.toColumn()),
opacity: 1,
top: this.state.top,
left: this.state.left,
opacity: this.state.opacity,
};

if (tile.isNew()) {
offset.opacity = 0;
} else {
var point = {
x: animationPosition(tile.toColumn()),
y: animationPosition(tile.toRow()),
};
AnimationExperimental.startAnimation({
node: this.refs['this'],
Animated.timing(this.state.opacity, {
duration: 100,
easing: 'easeInOutQuad',
property: 'position',
toValue: point,
});
toValue: 1,
}).start();
} else {
Animated.parallel([
Animated.timing(offset.top, {
duration: 100,
toValue: Tile._getPosition(tile.toRow()),
}),
Animated.timing(offset.left, {
duration: 100,
toValue: Tile._getPosition(tile.toColumn()),
}),
]).start();
}
return offset;
}

componentDidMount() {
AnimationExperimental.startAnimation({
node: this.refs['this'],
duration: 100,
easing: 'easeInOutQuad',
property: 'opacity',
toValue: 1,
});
}

render() {
var tile = this.props.tile;

var tileStyles = [
styles.tile,
styles['tile' + tile.value],
this.calculateOffset()
this.calculateOffset(),
];

var textStyles = [
Expand All @@ -115,9 +115,9 @@ class Tile extends React.Component {
];

return (
<View ref="this" style={tileStyles}>
<Animated.View style={tileStyles}>
<Text style={textStyles}>{tile.value}</Text>
</View>
</Animated.View>
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Examples/Movies/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ var SearchScreen = React.createClass({
) {
return (
<MovieCell
key={movie.id}
onSelect={() => this.selectMovie(movie)}
onHighlight={() => highlightRowFunc(sectionID, rowID)}
onUnhighlight={() => highlightRowFunc(null, null)}
Expand Down Expand Up @@ -307,7 +308,7 @@ var NoMovies = React.createClass({
render: function() {
var text = '';
if (this.props.filter) {
text = `No results for ${this.props.filter}`;
text = `No results for "${this.props.filter}"`;
} else if (!this.props.isLoading) {
// If we're looking at the latest movies, aren't currently loading, and
// still have no results, show a message
Expand Down
13 changes: 8 additions & 5 deletions Examples/SampleApp/_flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

# Ignore react-tools where there are overlaps, but don't ignore anything that
# react-native relies on
.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js
.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js
.*/node_modules/react-tools/src/browser/ui/React.js
.*/node_modules/react-tools/src/core/ReactInstanceHandles.js
.*/node_modules/react-tools/src/event/EventPropagators.js
.*/node_modules/react-tools/src/React.js
.*/node_modules/react-tools/src/renderers/shared/reconciler/ReactInstanceHandles.js
.*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js
.*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js


# Ignore commoner tests
.*/node_modules/commoner/test/.*
Expand Down
20 changes: 20 additions & 0 deletions Examples/UIExplorer/StatusBarIOSExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ exports.examples = [{
</View>
);
},
}, {
title: 'Status Bar Network Activity Indicator',
render() {
return (
<View>
<TouchableHighlight style={styles.wrapper}
onPress={() => StatusBarIOS.setNetworkActivityIndicatorVisible(true)}>
<View style={styles.button}>
<Text>setNetworkActivityIndicatorVisible(true)</Text>
</View>
</TouchableHighlight>
<TouchableHighlight style={styles.wrapper}
onPress={() => StatusBarIOS.setNetworkActivityIndicatorVisible(false)}>
<View style={styles.button}>
<Text>setNetworkActivityIndicatorVisible(false)</Text>
</View>
</TouchableHighlight>
</View>
);
},
}];

var styles = StyleSheet.create({
Expand Down
12 changes: 6 additions & 6 deletions Examples/UIExplorer/TabBarIOSExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ var TabBarExample = React.createClass({
};
},

_renderContent: function(color: string, pageText: string) {
_renderContent: function(color: string, pageText: string, num?: number) {
return (
<View style={[styles.tabContent, {backgroundColor: color}]}>
<Text style={styles.tabText}>{pageText}</Text>
<Text style={styles.tabText}>{this.state.presses} re-renders of the More tab</Text>
<Text style={styles.tabText}>{num} re-renders of the {pageText}</Text>
</View>
);
},

render: function() {
return (
<TabBarIOS
tintColor="black"
barTintColor="#3abeff">
tintColor="white"
barTintColor="darkslateblue">
<TabBarIOS.Item
title="Blue Tab"
selected={this.state.selectedTab === 'blueTab'}
Expand All @@ -73,7 +73,7 @@ var TabBarExample = React.createClass({
notifCount: this.state.notifCount + 1,
});
}}>
{this._renderContent('#783E33', 'Red Tab')}
{this._renderContent('#783E33', 'Red Tab', this.state.notifCount)}
</TabBarIOS.Item>
<TabBarIOS.Item
systemIcon="more"
Expand All @@ -84,7 +84,7 @@ var TabBarExample = React.createClass({
presses: this.state.presses + 1
});
}}>
{this._renderContent('#21551C', 'Green Tab')}
{this._renderContent('#21551C', 'Green Tab', this.state.presses)}
</TabBarIOS.Item>
</TabBarIOS>
);
Expand Down
11 changes: 10 additions & 1 deletion Examples/UIExplorer/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ exports.examples = [
right right right right right right right right right right right right right
</Text>
<Text style={{textAlign: 'justify'}}>
justify: this text component's contents are laid out with "textAlign: justify"
justify: this text component{"'"}s contents are laid out with "textAlign: justify"
and as you can see all of the lines except the last one span the
available width of the parent container.
</Text>
Expand Down Expand Up @@ -369,6 +369,15 @@ exports.examples = [
</View>
);
},
}, {
title: 'Text highlighting (tap the link to see highlight)',
render: function() {
return (
<View>
<Text>Lorem ipsum dolor sit amet, <Text suppressHighlighting={false} style={{backgroundColor: 'white', textDecorationLine: 'underline', color: 'blue'}} onPress={() => null}>consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud</Text> exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</Text>
</View>
);
},
}];

var styles = StyleSheet.create({
Expand Down
4 changes: 2 additions & 2 deletions Examples/UIExplorer/TextInputExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ exports.examples = [
style={styles.multiline}
/>
<TextInput
placeholder="mutliline text input with font styles and placeholder"
placeholder="multiline text input with font styles and placeholder"
multiline={true}
clearTextOnFocus={true}
autoCorrect={true}
Expand All @@ -421,7 +421,7 @@ exports.examples = [
style={[styles.multiline, styles.multilineWithFontStyles]}
/>
<TextInput
placeholder="uneditable mutliline text input"
placeholder="uneditable multiline text input"
editable={false}
multiline={true}
style={styles.multiline}
Expand Down
4 changes: 4 additions & 0 deletions Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,11 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand Down Expand Up @@ -1089,9 +1091,11 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 22 additions & 15 deletions Examples/UIExplorer/UIExplorerList.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,30 @@ class UIExplorerList extends React.Component {
);
}

componentWillMount() {
this.props.navigator.navigationContext.addListener('didfocus', function(event) {
if (event.data.route.title === 'UIExplorer') {
Settings.set({visibleExample: null});
}
});
}

componentDidMount() {
var visibleExampleTitle = Settings.get('visibleExample');
if (visibleExampleTitle) {
var predicate = (example) => example.title === visibleExampleTitle;
var foundExample = APIS.find(predicate) || COMPONENTS.find(predicate);
if (foundExample) {
setTimeout(() => this._openExample(foundExample), 100);
var wasUIExplorer = false;
var didOpenExample = false;

this.props.navigator.navigationContext.addListener('didfocus', (event) => {
var isUIExplorer = event.data.route.title === 'UIExplorer';

if (!didOpenExample && isUIExplorer) {
didOpenExample = true;

var visibleExampleTitle = Settings.get('visibleExample');
if (visibleExampleTitle) {
var predicate = (example) => example.title === visibleExampleTitle;
var foundExample = APIS.find(predicate) || COMPONENTS.find(predicate);
if (foundExample) {
setTimeout(() => this._openExample(foundExample), 100);
}
} else if (!wasUIExplorer && isUIExplorer) {
Settings.set({visibleExample: null});
}
}
}

wasUIExplorer = isUIExplorer;
});
}

renderAdditionalView(renderRow: Function, renderTextInput: Function): React.Component {
Expand Down
9 changes: 0 additions & 9 deletions Examples/UIExplorer/UIExplorerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,6 @@ class UIExplorerList extends React.Component {

componentDidMount() {
this._search(this.state.searchText);

var visibleExampleTitle = Settings.get('visibleExample');
if (visibleExampleTitle) {
var predicate = (example) => example.title === visibleExampleTitle;
var foundExample = APIS.find(predicate) || COMPONENTS.find(predicate);
if (foundExample) {
setTimeout(() => this._openExample(foundExample), 100);
}
}
}

render() {
Expand Down
5 changes: 3 additions & 2 deletions Examples/UIExplorer/createExamplePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ var createExamplePage = function(title: ?string, exampleModule: ExampleModule)
};
var result = example.render(null);
if (result) {
renderedComponent = result;
result.props.navigator = this.props.navigator;
renderedComponent = React.cloneElement(result, {
navigator: this.props.navigator,
});
}
(React: Object).render = originalRender;
(React: Object).renderComponent = originalRenderComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
Expand Down Expand Up @@ -190,6 +191,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
Expand Down
Loading