Authored by chenl

增加android 下拉刷新。review by 于良。

@@ -23,6 +23,7 @@ import LoadingIndicator from '../../../common/components/LoadingIndicator'; @@ -23,6 +23,7 @@ import LoadingIndicator from '../../../common/components/LoadingIndicator';
23 import IndexListView from './IndexListView'; 23 import IndexListView from './IndexListView';
24 import {ScrollCount} from '../../utils/Utils'; 24 import {ScrollCount} from '../../utils/Utils';
25 import NoNetworkTip from '../../../common/components/NoNetworkTip'; 25 import NoNetworkTip from '../../../common/components/NoNetworkTip';
  26 +import YH_PtrRefresh from '../../../common/components/YH_PtrRefresh';
26 27
27 export default class Brand extends Component { 28 export default class Brand extends Component {
28 constructor(props) { 29 constructor(props) {
@@ -235,6 +236,8 @@ export default class Brand extends Component { @@ -235,6 +236,8 @@ export default class Brand extends Component {
235 <View style={styles.container}> 236 <View style={styles.container}>
236 <ChannelSelector selectedChannelId={selectedChannelId} onSelectChannel={this.props.onSelectChannel}/> 237 <ChannelSelector selectedChannelId={selectedChannelId} onSelectChannel={this.props.onSelectChannel}/>
237 238
  239 + {
  240 + Platform.OS === 'ios' ?
238 <ListView 241 <ListView
239 ref={(ref)=>this.listView=ref} 242 ref={(ref)=>this.listView=ref}
240 initialListSize={initialListSize} 243 initialListSize={initialListSize}
@@ -251,6 +254,29 @@ export default class Brand extends Component { @@ -251,6 +254,29 @@ export default class Brand extends Component {
251 this.props.onRefresh && this.props.onRefresh(); 254 this.props.onRefresh && this.props.onRefresh();
252 }} 255 }}
253 /> 256 />
  257 + :
  258 + <ListView
  259 + ref={(ref)=>this.listView=ref}
  260 + initialListSize={initialListSize}
  261 + contentContainerStyle={contentContainerStyle}
  262 + enableEmptySections={true}
  263 + dataSource={listDataSource}
  264 + renderRow={this.renderRow}
  265 + showsVerticalScrollIndicator={showsVerticalScrollIndicator}
  266 + renderSectionHeader={renderSectionHeader}
  267 + renderHeader={this.renderHeader}
  268 + enablePullToRefresh={true}
  269 + isOnPullToRefresh={isPullToRefresh}
  270 + refreshControl={
  271 + <YH_PtrRefresh
  272 + refreshing={isPullToRefresh}
  273 + onRefresh={() => {
  274 + this.props.onRefresh && this.props.onRefresh();
  275 + }}
  276 + />
  277 + }
  278 + />
  279 + }
254 280
255 {showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null} 281 {showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}
256 282