mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Re-license and rename UIExplorer integration test app as RNTester
Reviewed By: yungsters Differential Revision: D4950085 fbshipit-source-id: 44574b5d0ef0d2ad5dfc714309b18dc69cbad9ff
This commit is contained in:
committed by
Facebook Github Bot
parent
82c4b9f0b7
commit
4a80dceac7
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @flow
|
||||
* @providesModule ProgressBarAndroidExample
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ProgressBar = require('ProgressBarAndroid');
|
||||
var React = require('React');
|
||||
var RNTesterBlock = require('RNTesterBlock');
|
||||
var RNTesterPage = require('RNTesterPage');
|
||||
|
||||
var TimerMixin = require('react-timer-mixin');
|
||||
|
||||
var MovingBar = React.createClass({
|
||||
mixins: [TimerMixin],
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
progress: 0
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.setInterval(
|
||||
() => {
|
||||
var progress = (this.state.progress + 0.02) % 1;
|
||||
this.setState({progress: progress});
|
||||
}, 50
|
||||
);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return <ProgressBar progress={this.state.progress} {...this.props} />;
|
||||
},
|
||||
});
|
||||
|
||||
class ProgressBarAndroidExample extends React.Component {
|
||||
static title = '<ProgressBarAndroid>';
|
||||
static description = 'Horizontal bar to show the progress of some operation.';
|
||||
|
||||
render() {
|
||||
return (
|
||||
<RNTesterPage title="ProgressBar Examples">
|
||||
<RNTesterBlock title="Horizontal Indeterminate ProgressBar">
|
||||
<ProgressBar styleAttr="Horizontal" />
|
||||
</RNTesterBlock>
|
||||
|
||||
<RNTesterBlock title="Horizontal ProgressBar">
|
||||
<MovingBar styleAttr="Horizontal" indeterminate={false} />
|
||||
</RNTesterBlock>
|
||||
|
||||
<RNTesterBlock title="Horizontal Black Indeterminate ProgressBar">
|
||||
<ProgressBar styleAttr="Horizontal" color="black" />
|
||||
</RNTesterBlock>
|
||||
|
||||
<RNTesterBlock title="Horizontal Blue ProgressBar">
|
||||
<MovingBar styleAttr="Horizontal" indeterminate={false} color="blue" />
|
||||
</RNTesterBlock>
|
||||
</RNTesterPage>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ProgressBarAndroidExample;
|
||||
Reference in New Issue
Block a user