-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSmartRefreshLayout.android.js
More file actions
55 lines (53 loc) · 1.69 KB
/
SmartRefreshLayout.android.js
File metadata and controls
55 lines (53 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Created by dowin on 2017/11/28.
*/
'use strict';
import React, {
Component,
} from 'react';
import {
requireNativeComponent,
ScrollView,
View,
} from 'react-native';
import PropTypes from 'prop-types';
const UIManager = require('react-native/lib/UIManager');
const ReactNative = require('react-native');
const REF_PTR = "ptr_ref";
/**
* SmartRefreshLayout https://github.com/scwang90/SmartRefreshLayout.git
*/
export default class SmartRefreshLayout extends Component {
static defaultProps = {
// 1 BezierCircleHeader 2 DeliveryHeader 3 DropboxHeader 4 FlyRefreshHeader(bug) 5 FunGameBattleCityHeader
// 6 FunGameHitBlockHeader 7 MaterialHeader 8 PhoenixHeader 9 StoreHouseHeader 10 TaurusHeader(bug) 11 WaterDropHeader 12 WaveSwipeHeader
hStyle:1,
refreshing: false,//设置false结束否刷新
}
constructor(props) {
super(props);
}
componentWillReceiveProps(nextProps) {
}
render() {
return (
<RNSmartRefreshLayout
ref={REF_PTR}
{...this.props}
style={{flex:1}}
onPtrRefresh={() => this._onRefresh()}>
<ScrollView>
{this.props.children}
</ScrollView>
</RNSmartRefreshLayout>
);
}
}
console.info('SmartRefreshLayout',SmartRefreshLayout.name)
// SmartRefreshLayout.name = "RCTSmartRefreshLayout"; //便于调试时显示(可以设置为任意字符串)
SmartRefreshLayout.propTypes = {
hStyle: PropTypes.number,
refreshing: PropTypes.bool,
...View.propTypes,
};
const RNSmartRefreshLayout = requireNativeComponent('RCTSmartRefreshLayout', SmartRefreshLayout);