diff --git a/tns-core-modules/ui/image/image-common.ts b/tns-core-modules/ui/image/image-common.ts index e5ce622ea..2925ff38b 100644 --- a/tns-core-modules/ui/image/image-common.ts +++ b/tns-core-modules/ui/image/image-common.ts @@ -21,10 +21,6 @@ export abstract class ImageBase extends View implements ImageDefinition { this.style.tintColor = value; } - public _setNativeImage(nativeImage: any) { - // - } - /** * @internal */ @@ -110,7 +106,7 @@ export abstract class ImageBase extends View implements ImageDefinition { export const imageSourceProperty = new Property({ name: "imageSource" }); imageSourceProperty.register(ImageBase); -export const srcProperty = new Property({ name: "src"}); +export const srcProperty = new Property({ name: "src" }); srcProperty.register(ImageBase); export const loadModeProperty = new Property({ name: "loadMode", defaultValue: "sync" }); diff --git a/tns-core-modules/ui/image/image.android.ts b/tns-core-modules/ui/image/image.android.ts index 6dcaf8e42..ffad3c44a 100644 --- a/tns-core-modules/ui/image/image.android.ts +++ b/tns-core-modules/ui/image/image.android.ts @@ -67,16 +67,6 @@ export class Image extends ImageBase { this._android = new org.nativescript.widgets.ImageView(this._context); } - public _setNativeImage(nativeImage: any) { - if (!nativeImage) { - return; - } - - let rotation = nativeImage.rotationAngle ? nativeImage.rotationAngle : 0; - this.android.setRotationAngle(rotation); - this.android.setImageBitmap(nativeImage.android); - } - public _createImageSourceFromSrc() { let imageView = this._android; this.imageSource = unsetValue; @@ -155,7 +145,14 @@ export class Image extends ImageBase { return undefined; } set [imageSourceProperty.native](value: ImageSource) { - this._setNativeImage(value ? value.android : null); + if (value && value.android) { + let rotation = value.rotationAngle ? value.rotationAngle : 0; + this.android.setRotationAngle(rotation); + this.android.setImageBitmap(value.android); + } else { + this.android.setRotationAngle(0); + this.android.setImageBitmap(null); + } } get [srcProperty.native](): any {