File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -32,5 +32,5 @@ PRs are welcome!
3232
3333The following important features are not implemented:
3434
35- - ` progress ` prop
35+ - ` progress ` prop (partially implemented using Animated.Value)
3636- imperative API
Original file line number Diff line number Diff line change @@ -8,6 +8,23 @@ class Animation extends PureComponent {
88
99 componentDidMount ( ) {
1010 this . loadAnimation ( this . props ) ;
11+
12+ if ( typeof this . props . progress === 'object' &&
13+ this . props . progress . _listeners ) {
14+
15+ this . props . progress . addListener ( ( progress ) => {
16+ const { value } = progress ;
17+ let frame = value / ( 1 / this . anim . getDuration ( true ) ) ;
18+ this . anim . goToAndStop ( frame , true ) ;
19+ } ) ;
20+ }
21+ }
22+
23+ componentWillUnmount ( ) {
24+ if ( typeof this . props . progress === 'object' &&
25+ this . props . progress . _listeners ) {
26+ this . props . progress . removeAllListeners ( ) ;
27+ }
1128 }
1229
1330 UNSAFE_componentWillReceiveProps ( nextProps ) {
You can’t perform that action at this time.
0 commit comments