Skip to content

Commit

Permalink
Fix animation bug in NostList
Browse files Browse the repository at this point in the history
  • Loading branch information
imWildCat committed Jul 29, 2016
1 parent 3d81fc8 commit 987084f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ios/Wetoo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>4</string>
<key>CodePushDeploymentKey</key>
<string>$(CODEPUSH_KEY)</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/GiftedListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default class GiftedListViewWrapper extends Component {

onCancelSearch = () => {
const { listView } = this.refs;
listView.props.onFetch(listView._getPage(), listView._postRefresh, { search: false });
listView.refs.listview.scrollTo({ x: 0, y: 44, animated: true });
listView.props.onFetch(listView._getPage(), listView._postRefresh, { search: false });
};

renderHeader = () => {
Expand Down
19 changes: 10 additions & 9 deletions src/components/common/Separator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@ import React, {Component, PropTypes} from 'react';
import {View} from 'react-native';

class Separator extends Component {

static defaultProps = {
marginLeft: 12,
};
static propTypes = {
marginLeft: PropTypes.number,
};

render() {
const { marginLeft } = this.props;
let style = {
marginLeft: 12,
const style = {
marginLeft: marginLeft,
backgroundColor: '#CCCCDE',
height: 0.5,
};
if (marginLeft) {
style = [style, { marginLeft }];
}
return (
<View style={style} />
);
}
}

Separator.propTypes = {
marginLeft: PropTypes.number,
};

export default Separator;
4 changes: 2 additions & 2 deletions src/components/common/TouchableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class TouchableRow extends Component {
};

render() {
const {style, innerViewStyle, children} = this.props;
const { style, innerViewStyle, children } = this.props;
return (
<TouchableHighlight underlayColor="#E6E6E6" {...this.props} style={[{ overflow: 'hidden' }, style]}>
<View style={innerViewStyle}>
<View style={[{ flex: 1 }, innerViewStyle]}>
{children}
</View>
</TouchableHighlight>
Expand Down
26 changes: 13 additions & 13 deletions src/components/pages/NodeList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class NodeList extends Component {
refreshable={true}
enableSearch={true}
searchOnChange={true}
renderSeparator={this.renderSeparator}
/>
</PageContainer>
);
Expand Down Expand Up @@ -100,20 +99,15 @@ class NodeList extends Component {
renderSearchResultRow = (rowData) => {
const { slug, name } = rowData;
return (
<TouchableRow style={styles.searchResultRow} onPress={() => this.onNodePress(slug, name)}>
<Text style={styles.searchResultRowText}>{name}{slug}</Text>
</TouchableRow>
<View style={styles.searchResultRow}>
<TouchableRow style={{flex: 1}} innerViewStyle={{justifyContent: 'center'}} onPress={() => this.onNodePress(slug, name)}>
<Text style={styles.searchResultRowText}>{name}{slug}</Text>
</TouchableRow>
<Separator marginLeft={0} />
</View>
);
};

renderSeparator = (sectionID, rowID) => {
if (this.searchMode) {
return <Separator key={`${sectionID}-${rowID}`} />;
} else {
return null;
}
};

renderNodeElement = (node) => {
const { slug, name } = node;
return (
Expand Down Expand Up @@ -173,11 +167,17 @@ const styles = Style.create({
searchResultRow: {
height: 44,
marginLeft: 12,
},
searchResultRowTextWrapper: {
flex: 1,
},
searchResultRowTextInnerWrapper: {
justifyContent: 'center',
},
searchResultRowText: {
fontSize: 14,
}
},

});

export default NodeList;

0 comments on commit 987084f

Please sign in to comment.