...
|
...
|
@@ -14,6 +14,7 @@ import ReactNative, { |
|
|
Platform,
|
|
|
RefreshControl,
|
|
|
} from 'react-native';
|
|
|
import TimerMixin from 'react-timer-mixin';
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator';
|
|
|
import YH_SortView from '../../../common/components/YH_SortView';
|
...
|
...
|
@@ -84,6 +85,11 @@ export default class Home extends Component { |
|
|
}
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
this.requestAnimationFrame && TimerMixin.cancelAnimationFrame(this.requestAnimationFrame);
|
|
|
}
|
|
|
|
|
|
|
|
|
trigggePullToRefresh(changeChannel=false) {
|
|
|
let data = this._currentChannelData();
|
|
|
if (changeChannel) {
|
...
|
...
|
@@ -150,8 +156,8 @@ export default class Home extends Component { |
|
|
<DivideImage/>
|
|
|
<SingleImage
|
|
|
data={rowData}
|
|
|
onPressSlideItem={this.props.onPressSlideItem}
|
|
|
onPressTitleMore={this.props.onPressTitleMore}
|
|
|
onPressSlideItem={this.props.onPressChangeChannel}
|
|
|
onPressTitleMore={this.props.onPressChangeChannel}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
...
|
...
|
@@ -444,15 +450,22 @@ export default class Home extends Component { |
|
|
|
|
|
_onScroll(event) {
|
|
|
if (event.nativeEvent.contentOffset.y < height) {
|
|
|
this.setState({showBackTop: false, currentY: event.nativeEvent.contentOffset.y});
|
|
|
if (this.state.showBackTop) {
|
|
|
this.setState({showBackTop: false, currentY: event.nativeEvent.contentOffset.y});
|
|
|
}
|
|
|
}else {
|
|
|
this.setState({showBackTop: true, currentY: event.nativeEvent.contentOffset.y});
|
|
|
if (!this.state.showBackTop) {
|
|
|
this.setState({showBackTop: true, currentY: event.nativeEvent.contentOffset.y});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_backTop() {
|
|
|
this.setState({showBackTop: false});
|
|
|
this.listView && this.listView.scrollTo({x: 0, y: 0, animated: true});
|
|
|
// this.setState({showBackTop: false});
|
|
|
console.log(this.state.showBackTop);
|
|
|
InteractionManager.runAfterInteractions(() =>{
|
|
|
this.listView && this.listView.scrollTo({x: 0, y: 0, animated: true});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
_renderFooter() {
|
...
|
...
|
|