@@ -14,9 +14,6 @@ const React = require('react');
14
14
15
15
const {
16
16
Alert,
17
- Platform,
18
- ProgressBarAndroid,
19
- ProgressViewIOS,
20
17
StyleSheet,
21
18
Switch,
22
19
Text,
@@ -31,21 +28,6 @@ function roundKilo(value: number): number {
31
28
return Math . round ( value / 1000 ) ;
32
29
}
33
30
34
- class ProgressBar extends React . Component < $FlowFixMeProps > {
35
- render ( ) {
36
- if ( Platform . OS === 'android' ) {
37
- return (
38
- < ProgressBarAndroid
39
- progress = { this . props . progress }
40
- styleAttr = "Horizontal"
41
- indeterminate = { false }
42
- />
43
- ) ;
44
- }
45
- return < ProgressViewIOS progress = { this . props . progress } /> ;
46
- }
47
- }
48
-
49
31
class XHRExampleDownload extends React . Component < { ...} , Object > {
50
32
state : Object = {
51
33
downloading : false ,
@@ -126,7 +108,10 @@ class XHRExampleDownload extends React.Component<{...}, Object> {
126
108
Alert . alert ( 'Error' , xhr . responseText ) ;
127
109
}
128
110
} ;
129
- xhr . open ( 'GET' , 'http://aleph.gutenberg.org/cache/epub/100/pg100.txt.utf8' ) ;
111
+ xhr . open (
112
+ 'GET' ,
113
+ 'http://aleph.gutenberg.org/cache/epub/100/pg100-images.html.utf8' ,
114
+ ) ;
130
115
// Avoid gzip so we can actually show progress
131
116
xhr . setRequestHeader ( 'Accept-Encoding' , '' ) ;
132
117
xhr . send ( ) ;
@@ -149,7 +134,7 @@ class XHRExampleDownload extends React.Component<{...}, Object> {
149
134
) : (
150
135
< TouchableHighlight style = { styles . wrapper } onPress = { this . _download } >
151
136
< View style = { styles . button } >
152
- < Text > Download 5MB Text File</ Text >
137
+ < Text > Download 7MB Text File</ Text >
153
138
</ View >
154
139
</ TouchableHighlight >
155
140
) ;
@@ -164,7 +149,6 @@ class XHRExampleDownload extends React.Component<{...}, Object> {
164
149
responseText: { roundKilo ( responseLength ) } /{ roundKilo ( contentLength ) }
165
150
k chars
166
151
</ Text >
167
- < ProgressBar progress = { responseLength / contentLength } />
168
152
</ View >
169
153
) ;
170
154
}
@@ -176,7 +160,6 @@ class XHRExampleDownload extends React.Component<{...}, Object> {
176
160
onprogress: { roundKilo ( progressLoaded ) } /{ roundKilo ( progressTotal ) } { ' ' }
177
161
KB
178
162
</ Text >
179
- < ProgressBar progress = { progressLoaded / progressTotal } />
180
163
</ View >
181
164
) ;
182
165
}
0 commit comments