5566 **********************************************************************************/
77
8- import { Color } from '@nativescript/core/color ' ;
8+ import { Color , Utils , knownFolders , path , View } from '@nativescript/core' ;
99import { LottieViewBase , autoPlayProperty , loopProperty , progressProperty , srcProperty , stretchProperty } from './lottie.common' ;
10- import { RESOURCE_PREFIX , layout } from '@nativescript/core/utils/utils' ;
11- import { knownFolders , path } from '@nativescript/core/file-system' ;
1210import { clamp } from './utils' ;
13- import { View } from '@nativescript/core/ui/core/view' ;
1411
1512const appPath = knownFolders . currentApp ( ) . path ;
1613
@@ -32,8 +29,8 @@ export class LottieView extends LottieViewBase {
3229 this . nativeViewProtected . compatibleAnimation = null ;
3330 } else if ( src [ 0 ] === '{' ) {
3431 this . nativeViewProtected . compatibleAnimation = CompatibleAnimation . alloc ( ) . initWithJson ( src ) ;
35- } else if ( src . startsWith ( RESOURCE_PREFIX ) ) {
36- const resName = src . replace ( RESOURCE_PREFIX , '' ) ;
32+ } else if ( src . startsWith ( Utils . RESOURCE_PREFIX ) ) {
33+ const resName = src . replace ( Utils . RESOURCE_PREFIX , '' ) ;
3734 if ( resName . endsWith ( '.lottie' ) ) {
3835 DotLottie . objcLoadWithNameShouldCacheCompletion ( resName . replace ( '.lottie' , '' ) , true , ( animation ) => {
3936 this . nativeViewProtected . animation = animation ;
@@ -200,22 +197,22 @@ export class LottieView extends LottieViewBase {
200197 public onMeasure ( widthMeasureSpec : number , heightMeasureSpec : number ) : void {
201198 const intrinsicContentSize = this . nativeViewProtected . intrinsicContentSize ;
202199 // We don't call super because we measure native view with specific size.
203- const width = layout . getMeasureSpecSize ( widthMeasureSpec ) ;
204- const widthMode = layout . getMeasureSpecMode ( widthMeasureSpec ) ;
200+ const width = Utils . layout . getMeasureSpecSize ( widthMeasureSpec ) ;
201+ const widthMode = Utils . layout . getMeasureSpecMode ( widthMeasureSpec ) ;
205202
206- const height = layout . getMeasureSpecSize ( heightMeasureSpec ) ;
207- const heightMode = layout . getMeasureSpecMode ( heightMeasureSpec ) ;
203+ const height = Utils . layout . getMeasureSpecSize ( heightMeasureSpec ) ;
204+ const heightMode = Utils . layout . getMeasureSpecMode ( heightMeasureSpec ) ;
208205
209- const nativeWidth = intrinsicContentSize ? layout . toDevicePixels ( intrinsicContentSize . width ) : 0 ;
210- const nativeHeight = intrinsicContentSize ? layout . toDevicePixels ( intrinsicContentSize . height ) : 0 ;
206+ const nativeWidth = intrinsicContentSize ? Utils . layout . toDevicePixels ( intrinsicContentSize . width ) : 0 ;
207+ const nativeHeight = intrinsicContentSize ? Utils . layout . toDevicePixels ( intrinsicContentSize . height ) : 0 ;
211208
212209 let measureWidth = Math . max ( nativeWidth , this . effectiveMinWidth ) ;
213210 let measureHeight = Math . max ( nativeHeight , this . effectiveMinHeight ) ;
214211
215- const finiteWidth : boolean = widthMode !== layout . UNSPECIFIED ;
216- const finiteHeight : boolean = heightMode !== layout . UNSPECIFIED ;
212+ const finiteWidth : boolean = widthMode !== Utils . layout . UNSPECIFIED ;
213+ const finiteHeight : boolean = heightMode !== Utils . layout . UNSPECIFIED ;
217214
218- this . _imageSourceAffectsLayout = widthMode !== layout . EXACTLY || heightMode !== layout . EXACTLY ;
215+ this . _imageSourceAffectsLayout = widthMode !== Utils . layout . EXACTLY || heightMode !== Utils . layout . EXACTLY ;
219216
220217 if ( nativeWidth !== 0 && nativeHeight !== 0 && ( finiteWidth || finiteHeight ) ) {
221218 const scale = LottieView . computeScaleFactor (
0 commit comments