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

Commit

Permalink
Merge pull request #74 from varmais/master
Browse files Browse the repository at this point in the history
Add ActivityIndicator
  • Loading branch information
RealOrangeOne authored Jun 30, 2016
2 parents 31a5918 + afe12a9 commit b1dde32
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
46 changes: 46 additions & 0 deletions src/components/ActivityIndicator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicator.js
*/
import React from 'react';
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
import View from './View';
import ColorPropType from '../propTypes/ColorPropType';

const { PropTypes } = React;

const ActivityIndicator = React.createClass({
propTypes: {
...View.propTypes,
/**
* Whether to show the indicator (true, the default) or hide it (false).
*/
animating: PropTypes.bool,
/**
* The foreground color of the spinner (default is gray).
*/
color: ColorPropType,
/**
* Whether the indicator should hide when not animating (true by default).
*/
hidesWhenStopped: PropTypes.bool,
/**
* Size of the indicator. Small has a height of 20, large has a height of 36.
*/
size: PropTypes.oneOf([
'small',
'large',
]),
/**
* Invoked on mount and layout changes with
*
* {nativeEvent: { layout: {x, y, width, height}}}.
*/
onLayout: PropTypes.func,
},
mixins: [NativeMethodsMixin],
render() {
return null;
},
});

module.exports = ActivityIndicator;
2 changes: 1 addition & 1 deletion src/components/ActivityIndicatorIOS.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.js
* https://github.com/facebook/react-native/blob/master/Libraries/Components/ActivityIndicator/ActivityIndicatorIOS.ios.js
*/
import React from 'react';
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
Expand Down
1 change: 1 addition & 0 deletions src/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import createMockComponent from './components/createMockComponent';
// Export React, plus some native additions.
const ReactNative = {
// Components
ActivityIndicator: require('./components/ActivityIndicator'),
ActivityIndicatorIOS: require('./components/ActivityIndicatorIOS'),
ART: require('./components/ART'),
DatePickerIOS: createMockComponent('DatePickerIOS'),
Expand Down

0 comments on commit b1dde32

Please sign in to comment.