ImageAsset extends Observable

This commit is contained in:
zh-m
2016-11-29 17:43:50 +02:00
parent d43dd159c2
commit 5f94a302fb
3 changed files with 8 additions and 3 deletions

View File

@ -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;

View File

@ -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

View File

@ -122,7 +122,9 @@ export class ImageSource implements definition.ImageSource {
} }
public setNativeSource(source: any): boolean { public setNativeSource(source: any): boolean {
if (source instanceof UIImage) {
this.ios = source; this.ios = source;
}
return source != null; return source != null;
} }