Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
孙凯
8 years ago
Commit
b7df766844a43cfb79043f8b75115070eda5d597
1 parent
0eebe623
add RN 下拉刷新完成回调 review by hongmo
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletions
js/common/components/customComponents/ListView.js.bak
js/common/components/customComponents/ScrollView.js.bak
js/home/components/home/Home.js
js/common/components/customComponents/ListView.js.bak
View file @
b7df766
...
...
@@ -274,6 +274,12 @@ var ListView = React.createClass({
}
},
yh_updateVisibleSubViews: function() {
if (this._scrollComponent && this._scrollComponent.yh_updateVisibleSubViews) {
this._scrollComponent.yh_updateVisibleSubViews();
}
},
setNativeProps: function(props: Object) {
if (this._scrollComponent) {
this._scrollComponent.setNativeProps(props);
...
...
js/common/components/customComponents/ScrollView.js.bak
View file @
b7df766
...
...
@@ -335,6 +335,7 @@ const ScrollView = React.createClass({
enablePullToRefresh: PropTypes.bool,
isOnPullToRefresh: PropTypes.bool,
onRefreshData: PropTypes.func,
onFinishRefreshData: PropTypes.func,
/**
...
...
@@ -346,6 +347,12 @@ const ScrollView = React.createClass({
mixins: [ScrollResponder.Mixin],
yh_updateVisibleSubViews: function() {
RCTScrollViewManager.yh_updateVisibleSubViews(
ReactNative.findNodeHandle(this)
);
},
startPullToRefresh: function() {
RCTScrollViewManager.startPullToRefresh(
ReactNative.findNodeHandle(this)
...
...
js/home/components/home/Home.js
View file @
b7df766
...
...
@@ -653,7 +653,7 @@ export default class Home extends Component {
let
rowIndexs
=
Object
.
keys
(
visibleRows
[
targetSection
]);
if
(
rowIndexs
.
length
>
0
)
{
selectedIndex
=
rowIndexs
[
0
];
}
}
if
(
rowIndexs
.
length
>
3
)
{
selectedIndex
=
rowIndexs
[
2
];
}
...
...
@@ -721,6 +721,9 @@ export default class Home extends Component {
onRefreshData
=
{()
=>
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}}
onFinishRefreshData
=
{()
=>
{
this
.
listView
&&
this
.
listView
.
yh_updateVisibleSubViews
();
}}
onEndReached
=
{()
=>
{
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
();
}}
...
...
Please
register
or
login
to post a comment