File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ export default class LottieAnimatedExample extends React.Component {
62
62
if ( this . state . imperative ) {
63
63
this . anim . play ( ) ;
64
64
} else {
65
- this . state . progress . setValue ( 0 ) ;
65
+ this . state . progress . setValue ( 0.5 ) ;
66
66
Animated . timing ( this . state . progress , {
67
67
toValue : 1 ,
68
- duration : this . state . config . duration ,
68
+ duration : this . state . duration ,
69
69
easing : Easing . linear ,
70
70
} ) . start ( ( { finished } ) => {
71
71
if ( finished ) this . forceUpdate ( ) ;
@@ -128,10 +128,7 @@ export default class LottieAnimatedExample extends React.Component {
128
128
>
129
129
< Text > Use Imperative API:</ Text >
130
130
< View />
131
- < Switch
132
- onValueChange = { i => this . onConfigChange ( { imperative : i } ) }
133
- value = { imperative }
134
- />
131
+ < Switch onValueChange = { i => this . setState ( { imperative : i } ) } value = { imperative } />
135
132
</ View >
136
133
< View style = { { paddingBottom : 10 } } >
137
134
< View >
@@ -153,7 +150,7 @@ export default class LottieAnimatedExample extends React.Component {
153
150
minimumValue = { 50 }
154
151
maximumValue = { 4000 }
155
152
value = { duration }
156
- onValueChange = { d => this . onConfigChange ( { duration : d } ) }
153
+ onValueChange = { d => this . setState ( { duration : d } ) }
157
154
/>
158
155
</ View >
159
156
</ View >
You can’t perform that action at this time.
0 commit comments