react-native/RNTester/js/ProgressBarAndroidExample.android.js
Jordan Brown b64b9dbece Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-08 10:48:19 -07:00

75 lines
1.9 KiB
JavaScript

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
var ProgressBar = require('ProgressBarAndroid');
var React = require('React');
var createReactClass = require('create-react-class');
var RNTesterBlock = require('RNTesterBlock');
var RNTesterPage = require('RNTesterPage');
var TimerMixin = require('react-timer-mixin');
var MovingBar = createReactClass({
displayName: 'MovingBar',
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;