Authored by chenl

增加了消息中心的下拉刷新兼容android。review by shixiang。

... ... @@ -195,7 +195,7 @@ function parseCategoryBSubDetail(channel_id, category_id, subcategory_data, prop
});
let more = {
show_category_name: 'more',
show_category_name: 'MORE',
category_name: "全部" + (category ? category.get('category_name') : ''),
parent_id: category_id,
relation_parameter: category ? category.get('relation_parameter') : {},
... ...
... ... @@ -11,6 +11,7 @@ import ReactNative, {
TouchableOpacity,
InteractionManager,
Platform,
RefreshControl,
} from 'react-native';
import MessageCell from './MessageCell';
... ... @@ -61,6 +62,9 @@ export default class Message extends Component {
let isPullToRefresh = latest.isFetching;
return (
<View style={styles.container}>
{
Platform.OS === 'ios' ?
<ListView
ref={(c) => {
this.listView = c;
... ... @@ -76,6 +80,29 @@ export default class Message extends Component {
this.props.onRefresh && this.props.onRefresh();
}}
/>
:
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
dataSource={this.dataSource.cloneWithRows(dataSource)}
renderRow={this.renderRow}
renderSeparator={this.renderSeparator}
enableEmptySections={true}
enablePullToRefresh={true}
refreshControl={
<RefreshControl
refreshing={false}
onRefresh={() => {
this.props.onRefresh && this.props.onRefresh();
}}
colors={['#000000', '#ff0000']}
progressBackgroundColor="#ffffff"
/>
}
/>
}
</View>
);
}
... ...
... ... @@ -59,7 +59,9 @@ class MessageContainer extends Component {
}
onRefresh() {
this.props.actions.latestMessage();
InteractionManager.runAfterInteractions(() => {
this.props.actions.latestMessage();
});
}
onPressListItem(item) {
... ...