/** * Copyright (c) Facebook, Inc. and its affiliates. * * 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 MovingBar = createReactClass({ displayName: 'MovingBar', _intervalID: (null: ?IntervalID), getInitialState: function() { return { progress: 0, }; }, componentDidMount: function() { this._intervalID = setInterval(() => { var progress = (this.state.progress + 0.02) % 1; this.setState({progress: progress}); }, 50); }, componentWillUnmount: function() { if (this._intervalID != null) { clearInterval(this._intervalID); } }, render: function() { return ; }, }); class ProgressBarAndroidExample extends React.Component<{}> { static title = ''; static description = 'Horizontal bar to show the progress of some operation.'; render() { return ( {/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was * found when making Flow check .android.js files. */} {/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was * found when making Flow check .android.js files. */} ); } } module.exports = ProgressBarAndroidExample;