Modified the Application module. Removed the Application class and added its methods to the exports directly.

This commit is contained in:
atanasovg
2014-05-09 19:25:11 +03:00
parent 7aa70fb14c
commit 44c51a0e48
10 changed files with 70 additions and 108 deletions

View File

@@ -6,7 +6,7 @@ var REQUEST_SELECT_PICTURE: number = 2;
export class CameraManager {
public takePicture(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
var takePictureIntent = new android.content.Intent('android.media.action.IMAGE_CAPTURE');
var androidApp = appModule.current.android;
var androidApp = appModule.android;
if (takePictureIntent.resolveActivity(androidApp.context.getPackageManager()) !== null) {
androidApp.currentActivity.startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
@@ -16,7 +16,7 @@ export class CameraManager {
// options { useSavedPhotos: true }
public pictureFromLibrary(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
var readPictureIntent = new android.content.Intent();
var androidApp = appModule.current.android;
var androidApp = appModule.android;
readPictureIntent.setType('image/*');
readPictureIntent.setAction('android.intent.action.GET_CONTENT');