mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
ImageAsset extends Observable
This commit is contained in:
@ -1,7 +1,8 @@
|
|||||||
import definition = require("image-asset");
|
import definition = require("image-asset");
|
||||||
|
import observable = require("data/observable");
|
||||||
import platform = require("platform");
|
import platform = require("platform");
|
||||||
|
|
||||||
export class ImageAsset implements definition.ImageAsset {
|
export class ImageAsset extends observable.Observable implements definition.ImageAsset {
|
||||||
private _options: definition.ImageAssetOptions;
|
private _options: definition.ImageAssetOptions;
|
||||||
private _ios: PHAsset;
|
private _ios: PHAsset;
|
||||||
private _nativeImage: any;
|
private _nativeImage: any;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
declare module "image-asset" {
|
declare module "image-asset" {
|
||||||
export class ImageAsset {
|
import observable = require("data/observable");
|
||||||
|
|
||||||
|
export class ImageAsset extends observable.Observable {
|
||||||
constructor(asset: any);
|
constructor(asset: any);
|
||||||
getImageAsync(callback: (image: any, error: any) => void); //UIImage for iOS and android.graphics.Bitmap for Android
|
getImageAsync(callback: (image: any, error: any) => void); //UIImage for iOS and android.graphics.Bitmap for Android
|
||||||
ios: any; //PHAsset
|
ios: any; //PHAsset
|
||||||
|
@ -122,7 +122,9 @@ export class ImageSource implements definition.ImageSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setNativeSource(source: any): boolean {
|
public setNativeSource(source: any): boolean {
|
||||||
this.ios = source;
|
if (source instanceof UIImage) {
|
||||||
|
this.ios = source;
|
||||||
|
}
|
||||||
return source != null;
|
return source != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user