File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 11
22dependencies {
3- def androidXAppCompat = project. hasProperty(" androidXAppCompat" ) ? project. androidXAppCompat : " 1.1.0"
4- implementation(" androidx.appcompat:appcompat:$androidXAppCompat " ) {
5- exclude group : ' androidx.fragment'
6- }
7- def lottieVersion = project. hasProperty(" lottieVersion" ) ? project. lottieVersion : " 3.+"
3+ def lottieVersion = project. hasProperty(" lottieVersion" ) ? project. lottieVersion : " 4.1.+"
84 implementation " com.airbnb.android:lottie:$lottieVersion "
95}
Original file line number Diff line number Diff line change @@ -132,20 +132,20 @@ export class LottieView extends LottieViewBase {
132132 if ( ! src ) {
133133 this . nativeView . setAnimation ( null ) ;
134134 } else if ( src [ 0 ] === '{' ) {
135- this . nativeView . setAnimationFromJson ( src ) ;
135+ this . nativeView . setAnimationFromJson ( src , null ) ;
136136 } else if ( src . startsWith ( RESOURCE_PREFIX ) ) {
137137 const resName = src . replace ( RESOURCE_PREFIX , '' ) ;
138138 this . nativeView . setAnimation ( resName ) ;
139139 } else {
140- if ( src [ 0 ] === '~' ) {
141- src = `${ path . join ( appPath , src . substring ( 2 ) ) } ` ;
142- }
143- if ( ! / .( j s o n | z i p ) $ / . test ( src ) ) {
140+ if ( ! / .( j s o n | z i p | l o t t i e ) $ / . test ( src ) ) {
144141 src += '.json' ;
145142 }
146-
143+ if ( src [ 0 ] === '~' ) {
144+ this . nativeView . setAnimation ( 'app/' + src . substring ( 2 ) ) ;
145+ return ;
146+ }
147147 loadLottieJSON ( src ) . then ( ( r ) => {
148- this . nativeView . setAnimationFromJson ( r ) ;
148+ this . nativeView . setAnimationFromJson ( r , null ) ;
149149 } ) ;
150150 }
151151
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export class LottieView extends LottieViewBase {
4949 if ( src [ 0 ] === '~' ) {
5050 src = `${ path . join ( appPath , src . substring ( 2 ) ) } ` ;
5151 }
52- if ( ! / .( j s o n | z i p ) $ / . test ( src ) ) {
52+ if ( ! / .( j s o n | z i p | l o t t i e ) $ / . test ( src ) ) {
5353 src += '.json' ;
5454 }
5555 this . nativeView . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithFilepath ( src ) ;
You can’t perform that action at this time.
0 commit comments