Fix: Setting ImageSource to image.src

This commit is contained in:
vakrilov
2017-02-09 13:23:30 +02:00
parent 15fa8fa936
commit e682e1aaec
2 changed files with 9 additions and 16 deletions

View File

@ -21,10 +21,6 @@ export abstract class ImageBase extends View implements ImageDefinition {
this.style.tintColor = value;
}
public _setNativeImage(nativeImage: any) {
//
}
/**
* @internal
*/

View File

@ -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 = <any>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 {