@@ -40,6 +40,7 @@ var GiftedListView = React.createClass({
40
40
refreshable : true ,
41
41
refreshableViewHeight : 50 ,
42
42
refreshableDistance : 40 ,
43
+ headerView : null ,
43
44
sectionHeaderView : null ,
44
45
withSections : false ,
45
46
onFetch ( page , callback , options ) { callback ( [ ] ) ; } ,
@@ -63,6 +64,7 @@ var GiftedListView = React.createClass({
63
64
refreshable : React . PropTypes . bool ,
64
65
refreshableViewHeight : React . PropTypes . number ,
65
66
refreshableDistance : React . PropTypes . number ,
67
+ headerView : React . PropTypes . func ,
66
68
sectionHeaderView : React . PropTypes . func ,
67
69
withSections : React . PropTypes . bool ,
68
70
onFetch : React . PropTypes . func ,
@@ -126,14 +128,23 @@ var GiftedListView = React.createClass({
126
128
</ TouchableHighlight >
127
129
) ;
128
130
} ,
131
+ headerView ( ) {
132
+ if ( this . state . paginationStatus === 'firstLoad' || ! this . props . headerView ) {
133
+ return ( < View /> ) ;
134
+ }
135
+ return this . props . headerView ( ) ;
136
+ } ,
129
137
refreshableFetchingView ( ) {
130
138
if ( this . props . refreshableFetchingView ) {
131
139
return this . props . refreshableFetchingView ( ) ;
132
140
}
133
141
134
142
return (
135
- < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
136
- < GiftedSpinner />
143
+ < View >
144
+ < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
145
+ < GiftedSpinner />
146
+ </ View >
147
+ { this . headerView ( ) }
137
148
</ View >
138
149
) ;
139
150
} ,
@@ -143,10 +154,13 @@ var GiftedListView = React.createClass({
143
154
}
144
155
145
156
return (
146
- < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
147
- < Text style = { [ this . defaultStyles . actionsLabel , this . props . customStyles . actionsLabel ] } >
148
- ↻
149
- </ Text >
157
+ < View >
158
+ < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
159
+ < Text style = { [ this . defaultStyles . actionsLabel , this . props . customStyles . actionsLabel ] } >
160
+ ↻
161
+ </ Text >
162
+ </ View >
163
+ { this . headerView ( ) }
150
164
</ View >
151
165
) ;
152
166
} ,
@@ -157,10 +171,13 @@ var GiftedListView = React.createClass({
157
171
158
172
if ( Platform . OS !== 'android' ) {
159
173
return (
160
- < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
161
- < Text style = { [ this . defaultStyles . actionsLabel , this . props . customStyles . actionsLabel ] } >
162
- ↓
163
- </ Text >
174
+ < View >
175
+ < View style = { [ this . defaultStyles . refreshableView , this . props . customStyles . refreshableView ] } >
176
+ < Text style = { [ this . defaultStyles . actionsLabel , this . props . customStyles . actionsLabel ] } >
177
+ ↓
178
+ </ Text >
179
+ </ View >
180
+ { this . headerView ( ) }
164
181
</ View >
165
182
) ;
166
183
} else {
0 commit comments