From 7a408468a7b7edaf8ed5a34255e4dc83b30996ea Mon Sep 17 00:00:00 2001 From: bthurlow Date: Fri, 1 Apr 2016 08:04:42 -0500 Subject: [PATCH] Update Demo/Bump Version --- demo/app/main-page.js | 17 ++++++++++++++++- demo/app/main-page.xml | 1 + package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/demo/app/main-page.js b/demo/app/main-page.js index 83cd7bd..04eac31 100644 --- a/demo/app/main-page.js +++ b/demo/app/main-page.js @@ -10,10 +10,11 @@ var cameraModule = require("camera"); var icModule = require("nativescript-imagecropper"); -var _page; +var _page,_image1; function pageLoaded(args) { _page = args.object; // page.bindingContext = vmModule.mainViewModel; + _image1 = _page.getViewById("image1"); } exports.pageLoaded = pageLoaded; @@ -23,6 +24,13 @@ exports.tapCameraAction = function(args){ var cropper = new icModule.ImageCropper(); cropper.show(picture).then(function(args){ console.log(JSON.stringify(args)); + if(args.image !== null){ + _image1.visibility = "visible"; + _image1.imageSource = args.image; + } + else{ + _image1.visibility = "collapsed"; + } }) .catch(function(e){ console.log(e); @@ -38,6 +46,13 @@ exports.tapCameraActionResize = function(args){ var cropper = new icModule.ImageCropper(); cropper.show(picture,{width:100,height:100}).then(function(args){ console.log(JSON.stringify(args)); + if(args.image !== null){ + _image1.visibility = "visible"; + _image1.imageSource = args.image; + } + else{ + _image1.visibility = "collapsed"; + } }) .catch(function(e){ console.log(e); diff --git a/demo/app/main-page.xml b/demo/app/main-page.xml index c47c245..560d3d6 100644 --- a/demo/app/main-page.xml +++ b/demo/app/main-page.xml @@ -3,5 +3,6 @@