Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit b1dde32

Browse files
Merge pull request #74 from varmais/master
Add ActivityIndicator
2 parents 31a5918 + afe12a9 commit b1dde32

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

src/components/ActivityIndicator.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicator.js
3+
*/
4+
import React from 'react';
5+
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
6+
import View from './View';
7+
import ColorPropType from '../propTypes/ColorPropType';
8+
9+
const { PropTypes } = React;
10+
11+
const ActivityIndicator = React.createClass({
12+
propTypes: {
13+
...View.propTypes,
14+
/**
15+
* Whether to show the indicator (true, the default) or hide it (false).
16+
*/
17+
animating: PropTypes.bool,
18+
/**
19+
* The foreground color of the spinner (default is gray).
20+
*/
21+
color: ColorPropType,
22+
/**
23+
* Whether the indicator should hide when not animating (true by default).
24+
*/
25+
hidesWhenStopped: PropTypes.bool,
26+
/**
27+
* Size of the indicator. Small has a height of 20, large has a height of 36.
28+
*/
29+
size: PropTypes.oneOf([
30+
'small',
31+
'large',
32+
]),
33+
/**
34+
* Invoked on mount and layout changes with
35+
*
36+
* {nativeEvent: { layout: {x, y, width, height}}}.
37+
*/
38+
onLayout: PropTypes.func,
39+
},
40+
mixins: [NativeMethodsMixin],
41+
render() {
42+
return null;
43+
},
44+
});
45+
46+
module.exports = ActivityIndicator;

src/components/ActivityIndicatorIOS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.js
2+
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicatorIOS.ios.js
33
*/
44
import React from 'react';
55
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';

src/react-native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import createMockComponent from './components/createMockComponent';
88
// Export React, plus some native additions.
99
const ReactNative = {
1010
// Components
11+
ActivityIndicator: require('./components/ActivityIndicator'),
1112
ActivityIndicatorIOS: require('./components/ActivityIndicatorIOS'),
1213
ART: require('./components/ART'),
1314
DatePickerIOS: createMockComponent('DatePickerIOS'),

0 commit comments

Comments
 (0)