...
|
...
|
@@ -27,7 +27,7 @@ export default class CategoryList extends Component { |
|
|
this.dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => !immutable.is(r1, r2)});
|
|
|
this.subRenderRow = this.subRenderRow.bind(this);
|
|
|
this.state = {
|
|
|
offsetx: 0,
|
|
|
offsetx: -width/2,
|
|
|
};
|
|
|
this.cacheChannel='';
|
|
|
}
|
...
|
...
|
@@ -38,7 +38,7 @@ export default class CategoryList extends Component { |
|
|
|
|
|
componentWillUpdate(nextProps,nextState){
|
|
|
if(this.cacheChannel!=nextProps.currentChannelId){
|
|
|
this.setState({offsetx:0});
|
|
|
this.setState({offsetx:-width/2});
|
|
|
this.refs.categoryList && this.refs.categoryList.scrollTo({x: 0, y: 0, animated: false});
|
|
|
this.cacheChannel=nextProps.currentChannelId;
|
|
|
}
|
...
|
...
|
@@ -53,7 +53,7 @@ export default class CategoryList extends Component { |
|
|
if(rowID==this.props.currentCateId){
|
|
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
|
if(this.state.offsetx<0){
|
|
|
this.setState({offsetx:0});
|
|
|
this.setState({offsetx:-width/2});
|
|
|
}else{
|
|
|
this.setState({offsetx: -width/2});
|
|
|
}
|
...
|
...
|
@@ -157,19 +157,19 @@ let styles = StyleSheet.create({ |
|
|
flex: 1,
|
|
|
flexDirection: 'row',
|
|
|
width: width,
|
|
|
height: height - 156,
|
|
|
height: height - 106,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
contentContainer: {
|
|
|
backgroundColor: 'white',
|
|
|
width: width,
|
|
|
height: height - 156,
|
|
|
height: height - 106,
|
|
|
},
|
|
|
subContentContainer: {
|
|
|
// position: 'absolute',
|
|
|
backgroundColor: '#f4f4f4',
|
|
|
width: width/2,
|
|
|
height: height - 156,
|
|
|
height: height - 106,
|
|
|
|
|
|
},
|
|
|
row: {
|
...
|
...
|
|