mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Move color processing to JS
Reviewed By: @vjeux Differential Revision: D2346353
This commit is contained in:
committed by
facebook-github-bot-7
parent
6078a4f865
commit
9a2d05d9b2
@@ -40,30 +40,7 @@ var notMultiline = {
|
||||
onSubmitEditing: true,
|
||||
};
|
||||
|
||||
var AndroidTextInputAttributes = {
|
||||
autoCapitalize: true,
|
||||
autoCorrect: true,
|
||||
autoFocus: true,
|
||||
textAlign: true,
|
||||
textAlignVertical: true,
|
||||
keyboardType: true,
|
||||
mostRecentEventCount: true,
|
||||
multiline: true,
|
||||
numberOfLines: true,
|
||||
password: true,
|
||||
placeholder: true,
|
||||
placeholderTextColor: true,
|
||||
text: true,
|
||||
testID: true,
|
||||
underlineColorAndroid: true,
|
||||
editable : true,
|
||||
};
|
||||
|
||||
var viewConfigAndroid = {
|
||||
uiViewClassName: 'AndroidTextInput',
|
||||
validAttributes: AndroidTextInputAttributes,
|
||||
};
|
||||
|
||||
var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);
|
||||
var RCTTextView = requireNativeComponent('RCTTextView', null);
|
||||
var RCTTextField = requireNativeComponent('RCTTextField', null);
|
||||
|
||||
@@ -317,7 +294,7 @@ var TextInput = React.createClass({
|
||||
mixins: [NativeMethodsMixin, TimerMixin],
|
||||
|
||||
viewConfig: ((Platform.OS === 'ios' ? RCTTextField.viewConfig :
|
||||
(Platform.OS === 'android' ? viewConfigAndroid : {})) : Object),
|
||||
(Platform.OS === 'android' ? AndroidTextInput.viewConfig : {})) : Object),
|
||||
|
||||
isFocused: function(): boolean {
|
||||
return TextInputState.currentlyFocusedField() ===
|
||||
@@ -578,9 +555,4 @@ var styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
var AndroidTextInput = createReactNativeComponentClass({
|
||||
validAttributes: AndroidTextInputAttributes,
|
||||
uiViewClassName: 'AndroidTextInput',
|
||||
});
|
||||
|
||||
module.exports = TextInput;
|
||||
|
||||
@@ -17,7 +17,7 @@ var React = require('React');
|
||||
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var createReactNativeComponentClass = require('createReactNativeComponentClass');
|
||||
var requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
/**
|
||||
* React component that wraps the Android-only [`Toolbar` widget][0]. A Toolbar can display a logo,
|
||||
@@ -166,9 +166,6 @@ var toolbarAttributes = {
|
||||
titleColor: true,
|
||||
};
|
||||
|
||||
var NativeToolbar = createReactNativeComponentClass({
|
||||
validAttributes: toolbarAttributes,
|
||||
uiViewClassName: 'ToolbarAndroid',
|
||||
});
|
||||
var NativeToolbar = requireNativeComponent('ToolbarAndroid', null);
|
||||
|
||||
module.exports = ToolbarAndroid;
|
||||
|
||||
@@ -21,6 +21,7 @@ var createReactNativeComponentClass = require('createReactNativeComponentClass')
|
||||
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
|
||||
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||
var onlyChild = require('onlyChild');
|
||||
var processColor = require('processColor');
|
||||
|
||||
var rippleBackgroundPropType = createStrictShapeTypeChecker({
|
||||
type: React.PropTypes.oneOf(['RippleAndroid']),
|
||||
@@ -112,7 +113,7 @@ var TouchableNativeFeedback = React.createClass({
|
||||
return {type: 'ThemeAttrAndroid', attribute: 'selectableItemBackgroundBorderless'};
|
||||
},
|
||||
Ripple: function(color, borderless) {
|
||||
return {type: 'RippleAndroid', color: color, borderless: borderless};
|
||||
return {type: 'RippleAndroid', color: processColor(color), borderless: borderless};
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user