...
|
...
|
@@ -9,6 +9,9 @@ import { |
|
|
Text,
|
|
|
ListView,
|
|
|
Dimensions,
|
|
|
ActivityIndicatorIOS,
|
|
|
Platform,
|
|
|
ProgressBarAndroid,
|
|
|
} from 'react-native';
|
|
|
|
|
|
|
...
|
...
|
@@ -78,14 +81,32 @@ export default class AccountSettlement extends Component { |
|
|
return (<Text>Error data source</Text>);
|
|
|
}
|
|
|
render() {
|
|
|
|
|
|
let isFetching = this.props.isFetching;
|
|
|
let loadText = isFetching?'加载中':'上拉加载更多';
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<View>
|
|
|
<ListView
|
|
|
style={styles.container}
|
|
|
dataSource={this.dataSource.cloneWithRowsAndSections(this.props.dataBlob.toJS())}
|
|
|
renderRow={this.renderRow}
|
|
|
onEndReachedThreshold={-50}
|
|
|
onEndReached={this.props.fetchNextPage}
|
|
|
enableEmptySections={true}
|
|
|
renderFooter={()=>{
|
|
|
if (Platform.OS === 'android') {
|
|
|
return <View style={styles.footerContainer}>
|
|
|
<ProgressBarAndroid style={styles.footerIndicator}/>
|
|
|
<Text style = {styles.footerText}>{loadText}</Text>
|
|
|
</View>
|
|
|
} else {
|
|
|
return <View style={styles.footerContainer}>
|
|
|
<ActivityIndicatorIOS style={styles.footerIndicator} size='small' animating={isFetching}/>
|
|
|
<Text style = {styles.footerText}>{loadText}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
...
|
...
|
@@ -113,6 +134,21 @@ const styles = StyleSheet.create({ |
|
|
textAlign: 'center',
|
|
|
},
|
|
|
|
|
|
footerContainer: {
|
|
|
flexDirection: 'row',
|
|
|
|
|
|
},
|
|
|
footerIndicator: {
|
|
|
marginTop: 15,
|
|
|
marginLeft: Dimensions.get('window').width/2-50,
|
|
|
marginRight: 10,
|
|
|
},
|
|
|
footerText: {
|
|
|
marginTop: 17,
|
|
|
textAlign: 'center',
|
|
|
color:'#b1b1b1',
|
|
|
},
|
|
|
|
|
|
container: {
|
|
|
top: 64,
|
|
|
flex:1,
|
...
|
...
|
|