Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3b24f52
[ReactNative] Add completionBlock to -[RCTBridge enqueueJSCall:args:]
tadeuzagallo May 28, 2015
ff49d86
Implemented fast path for same borders/radii
nicklockwood May 28, 2015
656c5e4
Revert "[ReactNative] Add completionBlock to -[RCTBridge enqueueJSCal…
May 28, 2015
45c1dc1
Fixed text background color
nicklockwood May 28, 2015
474ac65
[ReactNative] Allow decomposedMatrix style property to go to native view
May 28, 2015
3c1eaf7
[ReactNative] Fix inspect element crash
vjeux May 28, 2015
7e0064f
Add the license field on package.json
dalinaum May 28, 2015
0388978
[WIP] Added loadingView property to RCTRootView
nicklockwood May 28, 2015
40da2c7
[React Native] Add E2E tests for Catalyst that test login, app launch…
May 29, 2015
4097459
[React Native] Remove layout-only nodes from RCTText in RN OSS
May 29, 2015
36c33b4
Fixed delayed text layout bug
nicklockwood May 29, 2015
228dc5f
[MAdMan] Possibly fix "Cannot find breadcrumb interpolators for -1"
frantic May 29, 2015
ff48f78
[react_native] JS files from D2091792: Introduce vitual text node and…
kmagiera May 29, 2015
e2dc2db
[react_native] JS files from D2091817: Support nested text nodes in T…
kmagiera May 29, 2015
bb7ae59
[ReactNative] Update OSS screenshort tests
tadeuzagallo May 29, 2015
ef4f143
[ReactNative] Update objc-test to run on iOS 8.3
tadeuzagallo May 29, 2015
1567e82
Updates from Fri 29 May
tadeuzagallo May 29, 2015
74c337f
[ReactNative] Use Travis' Xcode 6.3 beta
tadeuzagallo May 29, 2015
b9a4706
[ReactNative] Unbreak flow errors
vjeux May 29, 2015
3b6ed00
[ReactNative] Remove AnimationUtils tests
tadeuzagallo May 29, 2015
8976a05
[ReactNative][Travis] Use nvm with node v0.10
tadeuzagallo May 30, 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
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
language: objective-c

osx_image: beta-xcode6.3

cache:
directories:
- node_modules
directories:
- node_modules
- .nvm

before_install:
- brew update
install:
- brew reinstall flow xctool
- brew reinstall flow xctool nvm
- mkdir -p .nvm
- cp $(brew --prefix nvm)/nvm-exec .nvm/
- export NVM_DIR=.nvm
- source $(brew --prefix nvm)/nvm.sh
- nvm install v0.10
- npm config set spin=false
- npm install

script:
- |
nvm use v0.10

if [ "$TEST_TYPE" = objc ]
then

Expand Down
8 changes: 6 additions & 2 deletions Examples/UIExplorer/BorderExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ var styles = StyleSheet.create({
borderTopLeftRadius: 100,
},
border7: {
borderRadius: 20,
borderWidth: 10,
borderColor: 'rgba(255,0,0,0.5)',
borderRadius: 30,
overflow: 'hidden',
},
border7_inner: {
backgroundColor: 'blue',
flex: 1,
width: 100,
height: 100
},
});

Expand Down
21 changes: 11 additions & 10 deletions Examples/UIExplorer/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,17 @@ exports.examples = [
title: 'containerBackgroundColor attribute',
render: function() {
return (
<View>
<View style={{flexDirection: 'row', height: 85}}>
<View style={{backgroundColor: '#ffaaaa', width: 150}} />
<View style={{backgroundColor: '#aaaaff', width: 150}} />
<View style={{backgroundColor: 'yellow'}}>
<View style={{flexDirection: 'row', position: 'absolute', height: 80}}>
<View style={{backgroundColor: '#ffaaaa', width: 140}} />
<View style={{backgroundColor: '#aaaaff', width: 140}} />
</View>
<Text style={[styles.backgroundColorText, {top: -80}]}>
<Text style={styles.backgroundColorText}>
Default containerBackgroundColor (inherited) + backgroundColor wash
</Text>
<Text style={[
styles.backgroundColorText,
{top: -70, containerBackgroundColor: 'transparent'}]}>
{marginBottom: 5, containerBackgroundColor: 'transparent'}]}>
{"containerBackgroundColor: 'transparent' + backgroundColor wash"}
</Text>
</View>
Expand All @@ -322,13 +322,13 @@ exports.examples = [
return (
<View>
<Text numberOfLines={1}>
Maximum of one line no matter now much I write here. If I keep writing it{"'"}ll just truncate after one line
Maximum of one line, no matter how much I write here. If I keep writing, it{"'"}ll just truncate after one line.
</Text>
<Text numberOfLines={2} style={{marginTop: 20}}>
Maximum of two lines no matter now much I write here. If I keep writing it{"'"}ll just truncate after two lines
Maximum of two lines, no matter how much I write here. If I keep writing, it{"'"}ll just truncate after two lines.
</Text>
<Text style={{marginTop: 20}}>
No maximum lines specified no matter now much I write here. If I keep writing it{"'"}ll just keep going and going
No maximum lines specified, no matter how much I write here. If I keep writing, it{"'"}ll just keep going and going.
</Text>
</View>
);
Expand All @@ -337,7 +337,8 @@ exports.examples = [

var styles = StyleSheet.create({
backgroundColorText: {
left: 5,
margin: 5,
marginBottom: 0,
backgroundColor: 'rgba(100, 100, 100, 0.3)'
},
entity: {
Expand Down
9 changes: 1 addition & 8 deletions Examples/UIExplorer/UIExplorerBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@ var styles = StyleSheet.create({
paddingHorizontal: 10,
paddingVertical: 5,
},
titleRow: {
flexDirection: 'row',
justifyContent: 'space-between',
backgroundColor: 'transparent',
},
titleText: {
backgroundColor: 'transparent',
fontSize: 14,
fontWeight: '500',
},
Expand All @@ -101,8 +95,7 @@ var styles = StyleSheet.create({
height: 8,
},
children: {
backgroundColor: 'transparent',
padding: 10,
margin: 10,
}
});

Expand Down
Binary file modified ...enceImages/Examples-UIExplorer-UIExplorerApp/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...enceImages/Examples-UIExplorer-UIExplorerApp/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)setUp
RCTAssert(!__LP64__, @"Snapshot tests should be run on 32-bit device simulators (e.g. iPhone 5)");
#endif
NSString *version = [[UIDevice currentDevice] systemVersion];
RCTAssert([version isEqualToString:@"8.1"], @"Snapshot tests should be run on iOS 8.1, found %@", version);
RCTAssert([version isEqualToString:@"8.3"], @"Snapshot tests should be run on iOS 8.3, found %@", version);
_runner = RCTInitRunnerForApp(@"Examples/UIExplorer/UIExplorerApp");

// If tests have changes, set recordMode = YES below and run the affected
Expand Down
54 changes: 0 additions & 54 deletions Libraries/Animation/__tests__/AnimationUtils-test.js

This file was deleted.

26 changes: 23 additions & 3 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,23 @@ var TextInput = React.createClass({
}
},

getChildContext: function(): Object {
return {isInAParentText: true};
},

childContextTypes: {
isInAParentText: React.PropTypes.bool
},

render: function() {
if (Platform.OS === 'ios') {
return this._renderIOs();
return this._renderIOS();
} else if (Platform.OS === 'android') {
return this._renderAndroid();
}
},

_renderIOs: function() {
_renderIOS: function() {
var textContainer;

var autoCapitalize = autoCapitalizeConsts[this.props.autoCapitalize];
Expand Down Expand Up @@ -515,14 +523,25 @@ var TextInput = React.createClass({
return (
<TouchableWithoutFeedback
onPress={this._onPress}
rejectResponderTermination={true}>
rejectResponderTermination={true}
testID={this.props.testID}>
{textContainer}
</TouchableWithoutFeedback>
);
},

_renderAndroid: function() {
var autoCapitalize = autoCapitalizeConsts[this.props.autoCapitalize];
var children = this.props.children;
var childCount = 0;
ReactChildren.forEach(children, () => ++childCount);
invariant(
!(this.props.value && childCount),
'Cannot specify both value and children.'
);
if (childCount > 1) {
children = <Text>{children}</Text>;
}
var textContainer =
<AndroidTextInput
ref="input"
Expand All @@ -540,6 +559,7 @@ var TextInput = React.createClass({
password={this.props.password || this.props.secureTextEntry}
placeholder={this.props.placeholder}
text={this.state.bufferedValue}
children={children}
/>;

return (
Expand Down
13 changes: 8 additions & 5 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,14 @@ var Navigator = React.createClass({
this.spring.getCurrentValue()
);
} else if (this.state.activeGesture != null) {
this._transitionBetween(
this.state.presentedIndex,
this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture),
this.spring.getCurrentValue()
);
var presentedToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture);
if (presentedToIndex > -1) {
this._transitionBetween(
this.state.presentedIndex,
presentedToIndex,
this.spring.getCurrentValue()
);
}
}
},

Expand Down
4 changes: 3 additions & 1 deletion Libraries/ReactIOS/InspectorOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ var InspectorOverlay = React.createClass({

var ElementProperties = React.createClass({
render: function() {
var path = this.props.hierarchy.map((instance) => instance.getName()).join(' > ');
var path = this.props.hierarchy.map((instance) => {
return instance.getName ? instance.getName() : 'Unknown';
}).join(' > ');
return (
<View style={styles.info}>
<Text style={styles.path}>
Expand Down
3 changes: 3 additions & 0 deletions Libraries/ReactNative/ReactNativeStyleAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ var ReactNativeStyleAttributes = {
ReactNativeStyleAttributes.transformMatrix = { diff: matricesDiffer };
ReactNativeStyleAttributes.shadowOffset = { diff: sizesDiffer };

// Do not rely on this attribute.
ReactNativeStyleAttributes.decomposedMatrix = 'decomposedMatrix';

module.exports = ReactNativeStyleAttributes;
1 change: 1 addition & 0 deletions Libraries/Text/RCTShadowText.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ extern NSString *const RCTReactTagAttributeName;
@property (nonatomic, assign) NSWritingDirection writingDirection;

- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width;
- (void)recomputeText;

@end
10 changes: 8 additions & 2 deletions Libraries/Text/RCTShadowText.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ - (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width
return textStorage;
}

- (void)recomputeText
{
[self attributedString];
[self setTextComputed];
}

- (NSAttributedString *)attributedString
{
return [self _attributedStringWithFontFamily:nil
Expand Down Expand Up @@ -125,13 +131,13 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily
}

if (_color) {
[self _addAttribute:NSForegroundColorAttributeName withValue:self.color toAttributedString:attributedString];
[self _addAttribute:NSForegroundColorAttributeName withValue:_color toAttributedString:attributedString];
}
if (_isHighlighted) {
[self _addAttribute:RCTIsHighlightedAttributeName withValue:@YES toAttributedString:attributedString];
}
if (_textBackgroundColor) {
[self _addAttribute:NSBackgroundColorAttributeName withValue:self.textBackgroundColor toAttributedString:attributedString];
[self _addAttribute:NSBackgroundColorAttributeName withValue:_textBackgroundColor toAttributedString:attributedString];
}

UIFont *font = [RCTConvert UIFont:nil withFamily:fontFamily size:fontSize weight:fontWeight style:fontStyle];
Expand Down
26 changes: 26 additions & 0 deletions Libraries/Text/RCTText.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
@implementation RCTText
{
NSTextStorage *_textStorage;
NSMutableArray *_reactSubviews;
}

- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
_textStorage = [[NSTextStorage alloc] init];
_reactSubviews = [NSMutableArray array];

self.isAccessibilityElement = YES;
self.accessibilityTraits |= UIAccessibilityTraitStaticText;
Expand All @@ -32,6 +34,30 @@ - (instancetype)initWithFrame:(CGRect)frame
return self;
}

- (void)reactSetFrame:(CGRect)frame
{
// Text looks super weird if its frame is animated.
// This disables the frame animation, without affecting opacity, etc.
[UIView performWithoutAnimation:^{
[super reactSetFrame:frame];
}];
}

- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
{
[_reactSubviews insertObject:subview atIndex:atIndex];
}

- (void)removeReactSubview:(UIView *)subview
{
[_reactSubviews removeObject:subview];
}

- (NSMutableArray *)reactSubviews
{
return _reactSubviews;
}

- (void)setTextStorage:(NSTextStorage *)textStorage
{
_textStorage = textStorage;
Expand Down
Loading