crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 1.66 kB
JavaScript
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),s=r(d[1]),o=r(d[2]),n=r(d[3]),l=r(d[4]),p=r(d[5]),c=r(d[6]),u=c.ProgressViewIOS,f=c.StyleSheet,h=c.View,w=(function(c){function f(){var s,l;t(this,f);for(var p=arguments.length,c=new Array(p),u=0;u<p;u++)c[u]=arguments[u];return(l=o(this,(s=n(f)).call.apply(s,[this].concat(c))))._rafId=null,l.state={progress:0},l.updateProgress=function(){var t=l.state.progress+.01;l.setState({progress:t}),l._rafId=requestAnimationFrame(function(){return l.updateProgress()})},l.getProgress=function(t){var s=l.state.progress+t;return Math.sin(s%Math.PI)%1},l}return l(f,c),s(f,[{key:"componentDidMount",value:function(){this.updateProgress()}},{key:"componentWillUnmount",value:function(){null!=this._rafId&&cancelAnimationFrame(this._rafId)}},{key:"render",value:function(){return p.createElement(h,{style:y.container},p.createElement(u,{style:y.progressView,progress:this.getProgress(0)}),p.createElement(u,{style:y.progressView,progressTintColor:"purple",progress:this.getProgress(.2)}),p.createElement(u,{style:y.progressView,progressTintColor:"red",progress:this.getProgress(.4)}),p.createElement(u,{style:y.progressView,progressTintColor:"orange",progress:this.getProgress(.6)}),p.createElement(u,{style:y.progressView,progressTintColor:"yellow",progress:this.getProgress(.8)}))}}]),f})(p.Component),y=f.create({container:{marginTop:-20,backgroundColor:'transparent'},progressView:{marginTop:20}});e.displayName=void 0,e.framework='React',e.title='ProgressViewIOS',e.description='ProgressViewIOS',e.examples=[{title:'ProgressViewIOS',render:function(){return p.createElement(w,null)}}]},666723,[3,4,5,8,9,11,15]);