Authored by chenl

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

... ... @@ -23,6 +23,7 @@ import LoadingIndicator from '../../../common/components/LoadingIndicator';
import IndexListView from './IndexListView';
import {ScrollCount} from '../../utils/Utils';
import NoNetworkTip from '../../../common/components/NoNetworkTip';
import YH_PtrRefresh from '../../../common/components/YH_PtrRefresh';
export default class Brand extends Component {
constructor(props) {
... ... @@ -235,22 +236,47 @@ export default class Brand extends Component {
<View style={styles.container}>
<ChannelSelector selectedChannelId={selectedChannelId} onSelectChannel={this.props.onSelectChannel}/>
<ListView
ref={(ref)=>this.listView=ref}
initialListSize={initialListSize}
contentContainerStyle={contentContainerStyle}
enableEmptySections={true}
dataSource={listDataSource}
renderRow={this.renderRow}
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
renderSectionHeader={renderSectionHeader}
renderHeader={this.renderHeader}
enablePullToRefresh={true}
isOnPullToRefresh={isPullToRefresh}
onRefreshData={() => {
this.props.onRefresh && this.props.onRefresh();
}}
/>
{
Platform.OS === 'ios' ?
<ListView
ref={(ref)=>this.listView=ref}
initialListSize={initialListSize}
contentContainerStyle={contentContainerStyle}
enableEmptySections={true}
dataSource={listDataSource}
renderRow={this.renderRow}
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
renderSectionHeader={renderSectionHeader}
renderHeader={this.renderHeader}
enablePullToRefresh={true}
isOnPullToRefresh={isPullToRefresh}
onRefreshData={() => {
this.props.onRefresh && this.props.onRefresh();
}}
/>
:
<ListView
ref={(ref)=>this.listView=ref}
initialListSize={initialListSize}
contentContainerStyle={contentContainerStyle}
enableEmptySections={true}
dataSource={listDataSource}
renderRow={this.renderRow}
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
renderSectionHeader={renderSectionHeader}
renderHeader={this.renderHeader}
enablePullToRefresh={true}
isOnPullToRefresh={isPullToRefresh}
refreshControl={
<YH_PtrRefresh
refreshing={isPullToRefresh}
onRefresh={() => {
this.props.onRefresh && this.props.onRefresh();
}}
/>
}
/>
}
{showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}
... ...