|
@@ -11,6 +11,7 @@ import ReactNative, { |
|
@@ -11,6 +11,7 @@ import ReactNative, { |
11
|
TouchableOpacity,
|
11
|
TouchableOpacity,
|
12
|
InteractionManager,
|
12
|
InteractionManager,
|
13
|
Platform,
|
13
|
Platform,
|
|
|
14
|
+ RefreshControl,
|
14
|
} from 'react-native';
|
15
|
} from 'react-native';
|
15
|
|
16
|
|
16
|
import MessageCell from './MessageCell';
|
17
|
import MessageCell from './MessageCell';
|
|
@@ -61,6 +62,9 @@ export default class Message extends Component { |
|
@@ -61,6 +62,9 @@ export default class Message extends Component { |
61
|
let isPullToRefresh = latest.isFetching;
|
62
|
let isPullToRefresh = latest.isFetching;
|
62
|
return (
|
63
|
return (
|
63
|
<View style={styles.container}>
|
64
|
<View style={styles.container}>
|
|
|
65
|
+
|
|
|
66
|
+ {
|
|
|
67
|
+ Platform.OS === 'ios' ?
|
64
|
<ListView
|
68
|
<ListView
|
65
|
ref={(c) => {
|
69
|
ref={(c) => {
|
66
|
this.listView = c;
|
70
|
this.listView = c;
|
|
@@ -76,6 +80,29 @@ export default class Message extends Component { |
|
@@ -76,6 +80,29 @@ export default class Message extends Component { |
76
|
this.props.onRefresh && this.props.onRefresh();
|
80
|
this.props.onRefresh && this.props.onRefresh();
|
77
|
}}
|
81
|
}}
|
78
|
/>
|
82
|
/>
|
|
|
83
|
+ :
|
|
|
84
|
+ <ListView
|
|
|
85
|
+ ref={(c) => {
|
|
|
86
|
+ this.listView = c;
|
|
|
87
|
+ }}
|
|
|
88
|
+ contentContainerStyle={styles.contentContainer}
|
|
|
89
|
+ dataSource={this.dataSource.cloneWithRows(dataSource)}
|
|
|
90
|
+ renderRow={this.renderRow}
|
|
|
91
|
+ renderSeparator={this.renderSeparator}
|
|
|
92
|
+ enableEmptySections={true}
|
|
|
93
|
+ enablePullToRefresh={true}
|
|
|
94
|
+ refreshControl={
|
|
|
95
|
+ <RefreshControl
|
|
|
96
|
+ refreshing={false}
|
|
|
97
|
+ onRefresh={() => {
|
|
|
98
|
+ this.props.onRefresh && this.props.onRefresh();
|
|
|
99
|
+ }}
|
|
|
100
|
+ colors={['#000000', '#ff0000']}
|
|
|
101
|
+ progressBackgroundColor="#ffffff"
|
|
|
102
|
+ />
|
|
|
103
|
+ }
|
|
|
104
|
+ />
|
|
|
105
|
+ }
|
79
|
</View>
|
106
|
</View>
|
80
|
);
|
107
|
);
|
81
|
}
|
108
|
}
|