...
|
...
|
@@ -39,6 +39,8 @@ const requireNativeComponent = require('requireNativeComponent'); |
|
|
const warning = require('fbjs/lib/warning');
|
|
|
const resolveAssetSource = require('resolveAssetSource');
|
|
|
|
|
|
const RCTScrollViewManager = require('NativeModules').ScrollViewManager;
|
|
|
|
|
|
import type {NativeMethodsMixinType} from 'ReactNativeTypes';
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -467,7 +469,24 @@ const ScrollView = createReactClass({ |
|
|
'always',
|
|
|
'never',
|
|
|
]),
|
|
|
|
|
|
/**
|
|
|
|
|
|
pull to refresh
|
|
|
*/
|
|
|
enablePullToRefresh: PropTypes.bool,
|
|
|
isOnPullToRefresh: PropTypes.bool,
|
|
|
onRefreshData: PropTypes.func,
|
|
|
onFinishRefreshData: PropTypes.func,
|
|
|
|
|
|
/**
|
|
|
|
|
|
埋点
|
|
|
*/
|
|
|
yh_exposureData: PropTypes.any,
|
|
|
yh_viewVisible: PropTypes.bool,
|
|
|
|
|
|
/**
|
|
|
* When true, ScrollView will emit updateChildFrames data in scroll events,
|
|
|
* otherwise will not compute or emit child frame data. This only exists
|
|
|
* to support legacy issues, `onLayout` should be used instead to retrieve
|
...
|
...
|
@@ -503,6 +522,24 @@ const ScrollView = createReactClass({ |
|
|
_scrollAnimatedValueAttachment: (null: ?{detach: () => void}),
|
|
|
_stickyHeaderRefs: (new Map(): Map<number, ScrollViewStickyHeader>),
|
|
|
_headerLayoutYs: (new Map(): Map<string, number>),
|
|
|
yh_updateVisibleSubViews: function() {
|
|
|
RCTScrollViewManager.yh_updateVisibleSubViews(
|
|
|
ReactNative.findNodeHandle(this._scrollViewRef)
|
|
|
);
|
|
|
},
|
|
|
|
|
|
startPullToRefresh: function() {
|
|
|
RCTScrollViewManager.startPullToRefresh(
|
|
|
ReactNative.findNodeHandle(this._scrollViewRef)
|
|
|
);
|
|
|
},
|
|
|
|
|
|
stopPullToRefresh: function() {
|
|
|
RCTScrollViewManager.stopPullToRefresh(
|
|
|
ReactNative.findNodeHandle(this._scrollViewRef)
|
|
|
);
|
|
|
},
|
|
|
|
|
|
getInitialState: function() {
|
|
|
return {
|
|
|
...this.scrollResponderMixinGetInitialState(),
|
...
|
...
|
|