Skip to content

Commit 2170ad9

Browse files
committed
adjusted default styling of refreshing indicator
1 parent ba8608f commit 2170ad9

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ var MyRefreshingIndicator = React.createClass({
222222

223223
### changelog
224224

225+
- **2.0.0-beta3**
226+
- fixed proptype warnings from internal component
227+
- adjusted default styling of refreshing indicator
228+
229+
- **2.0.0-beta2**
230+
- pulling down now reveals refreshing indicator behind current view, rather
231+
than the refreshing indicator moving down from the top of the screen
232+
- `renderHeaderWrapper` is no longer used
233+
- fixed infinite refreshing when pulled down
234+
225235
- **1.2.0**
226236
- deprecated `renderHeader` in favour of `renderHeaderWrapper` as some
227237
developers seemed to be confused by the fact that a `renderHeader` handler

lib/RefreshingIndicator.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ var RefreshingIndicator = React.createClass({
7575
return (
7676
<View style={[styles.wrapper]}>
7777
<View style={[styles.container, styles.loading, styles.content]}>
78-
{this.renderDescription(styles)}
79-
{this.renderActivityIndicator(styles)}
78+
<View style={[styles.stack]}>
79+
{this.renderDescription(styles)}
80+
{this.renderActivityIndicator(styles)}
81+
</View>
8082
</View>
8183
</View>
8284
)
@@ -87,16 +89,21 @@ var stylesheet = StyleSheet.create({
8789
container: {
8890
flex: 1,
8991
justifyContent: 'center',
90-
alignItems: 'center',
92+
alignItems: 'flex-start',
9193
flexDirection: 'row',
9294
},
95+
stack: {
96+
flex: 1,
97+
justifyContent: 'center',
98+
alignItems: 'center',
99+
flexDirection: 'column',
100+
},
93101
wrapper: {
94102
height: 60,
95-
marginTop: 10,
96103
},
97104
content: {
98105
marginTop: 10,
99-
height: 60,
106+
height: 40,
100107
},
101108
})
102109

test/RefreshableListViewTest/index.ios.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var {
55
Text,
66
View,
77
ListView,
8+
StatusBarIOS,
89
} = React;
910

1011
var RefreshableListView = require('react-native-refreshable-listview')
@@ -22,6 +23,9 @@ var RefreshableListViewTest = React.createClass({
2223
var rows = makeSequence(100).map((n) => ({text: 'not refreshed '+n}))
2324
return {dataSource: ds.cloneWithRows(rows)}
2425
},
26+
componentDidMount() {
27+
StatusBarIOS.setStyle(0)
28+
},
2529
reloadItems() {
2630
return delay(1000).then(() => {
2731
var rows = makeSequence(100).map((n) => ({text: 'refreshed '+n}))
@@ -39,13 +43,15 @@ var RefreshableListViewTest = React.createClass({
3943
},
4044
render() {
4145
return (
42-
<RefreshableListView
43-
dataSource={this.state.dataSource}
44-
renderRow={this.renderItem}
45-
loadData={this.reloadItems}
46-
refreshDescription="Refreshing items"
47-
refreshPrompt="Pull down to refresh"
48-
/>
46+
<View style={{marginTop: 20}}>
47+
<RefreshableListView
48+
dataSource={this.state.dataSource}
49+
renderRow={this.renderItem}
50+
loadData={this.reloadItems}
51+
refreshDescription="Refreshing items"
52+
refreshPrompt="Pull down to refresh"
53+
/>
54+
</View>
4955
)
5056
},
5157
});

0 commit comments

Comments
 (0)