Skip to content

Commit

Permalink
Updates from Wed Mar 4
Browse files Browse the repository at this point in the history
- [react-packager] Start converting options to query params | Amjad Masad
- [ReactNative] Replace js long constants with strings | Tadeu Zagallo
- React Native: Remove Unnecessary `document.body` Shim | Tim Yung
- [ReactNative] Use spread operator and .propTypes for ScrollView/ListView | Christopher Chedeau
  • Loading branch information
vjeux committed Mar 5, 2015
1 parent b9ab607 commit b87ba87
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 221 deletions.
2 changes: 1 addition & 1 deletion Examples/Movies/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ var SearchBar = React.createClass({
return (
<View style={styles.searchBar}>
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.none}
autoCapitalize="none"
autoCorrect={false}
onChange={this.props.onSearchChange}
placeholder="Search a movie..."
Expand Down
12 changes: 6 additions & 6 deletions Examples/UIExplorer/ActivityIndicatorExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var ToggleAnimatingActivityIndicator = React.createClass({
<ActivityIndicatorIOS
animating={this.state.animating}
style={[styles.centering, {height: 80}]}
size={ActivityIndicatorIOS.size.large}
size="large"
/>
);
}
Expand Down Expand Up @@ -98,7 +98,7 @@ exports.examples = [
<ActivityIndicatorIOS
style={[styles.centering, styles.gray, {height: 80}]}
color="white"
size={ActivityIndicatorIOS.size.large}
size="large"
/>
);
}
Expand All @@ -109,19 +109,19 @@ exports.examples = [
return (
<View style={styles.horizontal}>
<ActivityIndicatorIOS
size={ActivityIndicatorIOS.size.large}
size="large"
color="#0000ff"
/>
<ActivityIndicatorIOS
size={ActivityIndicatorIOS.size.large}
size="large"
color="#aa00aa"
/>
<ActivityIndicatorIOS
size={ActivityIndicatorIOS.size.large}
size="large"
color="#aa3300"
/>
<ActivityIndicatorIOS
size={ActivityIndicatorIOS.size.large}
size="large"
color="#00aa00"
/>
</View>
Expand Down
28 changes: 14 additions & 14 deletions Examples/UIExplorer/PointerEventsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var NoneExample = React.createClass({
A: unspecified
</DemoText>
<View
pointerEvents={View.pointerEvents.none}
pointerEvents="none"
onTouchStart={() => this.props.onLog('B none touched')}
style={[styles.box, styles.boxPassedThrough]}>
<DemoText style={[styles.text, styles.textPassedThrough]}>
Expand All @@ -87,7 +87,7 @@ var NoneExample = React.createClass({
var DemoText = React.createClass({
render: function() {
return (
<View pointerEvents={View.pointerEvents.none}>
<View pointerEvents="none">
<Text
style={this.props.style}>
{this.props.children}
Expand All @@ -107,11 +107,11 @@ var BoxNoneExample = React.createClass({
A: unspecified
</DemoText>
<View
pointerEvents={View.pointerEvents.boxNone}
onTouchStart={() => this.props.onLog('B boxNone touched')}
pointerEvents="box-none"
onTouchStart={() => this.props.onLog('B box-none touched')}
style={[styles.box, styles.boxPassedThrough]}>
<DemoText style={[styles.text, styles.textPassedThrough]}>
B: boxNone
B: box-none
</DemoText>
<View
onTouchStart={() => this.props.onLog('C unspecified touched')}
Expand All @@ -121,7 +121,7 @@ var BoxNoneExample = React.createClass({
</DemoText>
</View>
<View
pointerEvents={View.pointerEvents.unspecified}
pointerEvents="auto"
onTouchStart={() => this.props.onLog('C explicitly unspecified touched')}
style={[styles.box]}>
<DemoText style={[styles.text]}>
Expand All @@ -144,11 +144,11 @@ var BoxOnlyExample = React.createClass({
A: unspecified
</DemoText>
<View
pointerEvents={View.pointerEvents.boxOnly}
onTouchStart={() => this.props.onLog('B boxOnly touched')}
pointerEvents="box-only"
onTouchStart={() => this.props.onLog('B box-only touched')}
style={styles.box}>
<DemoText style={styles.text}>
B: boxOnly
B: box-only
</DemoText>
<View
onTouchStart={() => this.props.onLog('C unspecified touched')}
Expand All @@ -158,7 +158,7 @@ var BoxOnlyExample = React.createClass({
</DemoText>
</View>
<View
pointerEvents={View.pointerEvents.unspecified}
pointerEvents="auto"
onTouchStart={() => this.props.onLog('C explicitly unspecified touched')}
style={[styles.box, styles.boxPassedThrough]}>
<DemoText style={[styles.text, styles.textPassedThrough]}>
Expand All @@ -179,13 +179,13 @@ var exampleClasses = [
},
{
Component: BoxNoneExample,
title: '`boxNone`',
description: '`boxNone` causes touch events on the container to pass through and will only detect touch events on its child components.',
title: '`box-none`',
description: '`box-none` causes touch events on the container to pass through and will only detect touch events on its child components.',
},
{
Component: BoxOnlyExample,
title: '`boxOnly`',
description: '`boxOnly` causes touch events on the container\'s child components to pass through and will only detect touch events on the container itself.',
title: '`box-only`',
description: '`box-only` causes touch events on the container\'s child components to pass through and will only detect touch events on the container itself.',
}
];

Expand Down
18 changes: 9 additions & 9 deletions Examples/UIExplorer/TextInputExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var TextEventsExample = React.createClass({
return (
<View>
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.none}
autoCapitalize="none"
placeholder="Enter text to see events"
autoCorrect={false}
onFocus={() => this.updateText('onFocus')}
Expand Down Expand Up @@ -123,25 +123,25 @@ exports.examples = [
<View>
<WithLabel label="none">
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.none}
autoCapitalize="none"
style={styles.default}
/>
</WithLabel>
<WithLabel label="sentences">
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.sentences}
autoCapitalize="sentences"
style={styles.default}
/>
</WithLabel>
<WithLabel label="words">
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.words}
autoCapitalize="words"
style={styles.default}
/>
</WithLabel>
<WithLabel label="characters">
<TextInput
autoCapitalize={TextInput.autoCapitalizeMode.characters}
autoCapitalize="characters"
style={styles.default}
/>
</WithLabel>
Expand Down Expand Up @@ -193,25 +193,25 @@ exports.examples = [
<WithLabel label="never">
<TextInput
style={styles.default}
clearButtonMode={TextInput.clearButtonModeTypes.never}
clearButtonMode="never"
/>
</WithLabel>
<WithLabel label="while editing">
<TextInput
style={styles.default}
clearButtonMode={TextInput.clearButtonModeTypes.whileEditing}
clearButtonMode="while-editing"
/>
</WithLabel>
<WithLabel label="unless editing">
<TextInput
style={styles.default}
clearButtonMode={TextInput.clearButtonModeTypes.unlessEditing}
clearButtonMode="unless-editing"
/>
</WithLabel>
<WithLabel label="always">
<TextInput
style={styles.default}
clearButtonMode={TextInput.clearButtonModeTypes.always}
clearButtonMode="always"
/>
</WithLabel>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModulesDeprecated = require('NativeModulesDeprecated');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes');
var React = require('React');
var ReactIOSViewAttributes = require('ReactIOSViewAttributes');
Expand Down Expand Up @@ -37,12 +37,11 @@ var ActivityIndicatorIOS = React.createClass({
* The foreground color of the spinner (default is gray).
*/
color: PropTypes.string,
/**
* The size of the spinner, must be one of:
* - ActivityIndicatorIOS.size.large
* - ActivityIndicatorIOS.size.small (default)
*/
size: PropTypes.oneOf([SpinnerSize.large, SpinnerSize.small]),

size: PropTypes.oneOf([
'small', // default
'large',
]),
},

getDefaultProps: function() {
Expand All @@ -53,15 +52,11 @@ var ActivityIndicatorIOS = React.createClass({
};
},

statics: {
size: SpinnerSize,
},

render: function() {
var style = styles.sizeSmall;
var NativeConstants = NativeModulesDeprecated.RKUIManager.UIActivityIndicatorView.Constants;
var NativeConstants = NativeModules.RKUIManager.UIActivityIndicatorView.Constants;
var activityIndicatorViewStyle = NativeConstants.StyleWhite;
if (this.props.size == SpinnerSize.large) {
if (this.props.size === 'large') {
style = styles.sizeLarge;
activityIndicatorViewStyle = NativeConstants.StyleWhiteLarge;
}
Expand Down
Loading

0 comments on commit b87ba87

Please sign in to comment.