@@ -143,9 +143,9 @@ export class ImagePipeline {
143143 const request = com . facebook . imagepipeline . request . ImageRequestBuilder . newBuilderWithSource ( nativeUri ) . build ( ) ;
144144 let datasource : com . facebook . datasource . DataSource < java . lang . Void > ;
145145 if ( toDiskCache ) {
146- datasource = this . _android . prefetchToDiskCache ( request , null ) ;
146+ datasource = this . _android . prefetchToDiskCache ( request , uri ) ;
147147 } else {
148- datasource = this . _android . prefetchToBitmapCache ( request , null ) ;
148+ datasource = this . _android . prefetchToBitmapCache ( request , uri ) ;
149149 }
150150 // initializeBaseDataSubscriber();
151151 datasource . subscribe (
@@ -332,46 +332,6 @@ export const needRequestImage = function (target: any, propertyKey: string | Sym
332332 } ;
333333} ;
334334
335- // type DraweeView = new (owner: Img, context) => com.facebook.drawee.view.SimpleDraweeView;
336- // // eslint-disable-next-line no-redeclare
337- // let DraweeView: DraweeView;
338- // function initializeDraweeView() {
339- // if (DraweeView) {
340- // return;
341- // }
342- // @NativeClass
343- // class DraweeViewImpl extends com.facebook.drawee.view.SimpleDraweeView {
344- // constructor(public owner: Img, context: android.content.Context) {
345- // super(context);
346- // return global.__native(this);
347- // }
348- // public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {
349- // const width = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
350- // const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
351- // const height = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
352- // const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
353- // const aspectRatio = this.getAspectRatio();
354- // CLog(CLogTypes.info, 'onMeasure', this.owner.src, widthMeasureSpec, heightMeasureSpec, width, height, aspectRatio);
355- // if (aspectRatio > 0) {
356- // const finiteWidth: boolean = widthMode === Utils.layout.EXACTLY;
357- // const finiteHeight: boolean = heightMode === Utils.layout.EXACTLY;
358- // // let scale: { width; height };
359- // if ((this as any).imageWidth && (this as any).imageHeight) {
360- // // scale = this.owner.computeScaleFactor(width, height, finiteWidth, finiteHeight, (this as any).imageWidth, (this as any).imageHeight, aspectRatio);
361- // if (!finiteWidth) {
362- // widthMeasureSpec = Utils.layout.makeMeasureSpec(height * aspectRatio, Utils.layout.EXACTLY);
363- // }
364- // if (!finiteHeight) {
365- // heightMeasureSpec = Utils.layout.makeMeasureSpec(width / aspectRatio, Utils.layout.EXACTLY);
366- // }
367- // }
368- // CLog(CLogTypes.info, 'onMeasure scale', this.owner.src, aspectRatio, finiteWidth, finiteHeight, width, height, (this as any).imageWidth, (this as any).imageHeight);
369- // }
370- // super.onMeasure(widthMeasureSpec, heightMeasureSpec);
371- // }
372- // }
373- // DraweeView = DraweeViewImpl as any;
374- // }
375335
376336export class Img extends ImageBase {
377337 nativeViewProtected : com . nativescript . image . DraweeView ;
@@ -724,6 +684,7 @@ export class Img extends ImageBase {
724684 } ) ;
725685 const builder = com . facebook . drawee . backends . pipeline . Fresco . newDraweeControllerBuilder ( ) ;
726686 builder . setImageRequest ( request ) ;
687+ builder . setCallerContext ( src ) ;
727688 builder . setControllerListener ( listener ) ;
728689 builder . setOldController ( this . nativeViewProtected . getController ( ) ) ;
729690 if ( Trace . isEnabled ( ) ) {
0 commit comments