Skip to content

Commit

Permalink
Update Demo/Bump Version
Browse files Browse the repository at this point in the history
  • Loading branch information
bthurlow committed Apr 1, 2016
1 parent c9c5ea5 commit 7a40846
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion demo/app/main-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions demo/app/main-page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<Label text="nativescript-imagecropper demo" class="title" textWrap="true"/>
<Button text="Camera" tap="tapCameraAction" />
<Button text="Camera with Resize" tap="tapCameraActionResize" />
<Image id="image1" visibility="collapsed" />
</StackLayout>
</Page>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"nativescript-imagecropper",
"version":"0.0.3",
"version":"0.0.4",
"description":"A image cropper based on TOCropViewController for iOS and uCrop for Android",
"main":"imagecropper.js",
"nativescript":{
Expand Down

0 comments on commit 7a40846

Please sign in to comment.