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,6 +236,8 @@ export default class Brand extends Component {
<View style={styles.container}>
<ChannelSelector selectedChannelId={selectedChannelId} onSelectChannel={this.props.onSelectChannel}/>
{
Platform.OS === 'ios' ?
<ListView
ref={(ref)=>this.listView=ref}
initialListSize={initialListSize}
... ... @@ -251,6 +254,29 @@ export default class Brand extends Component {
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}
... ...