Skip to content

Commit 7a40846

Browse files
committed
Update Demo/Bump Version
1 parent c9c5ea5 commit 7a40846

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

demo/app/main-page.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
var cameraModule = require("camera");
1111
var icModule = require("nativescript-imagecropper");
1212

13-
var _page;
13+
var _page,_image1;
1414
function pageLoaded(args) {
1515
_page = args.object;
1616
// page.bindingContext = vmModule.mainViewModel;
17+
_image1 = _page.getViewById("image1");
1718
}
1819
exports.pageLoaded = pageLoaded;
1920

@@ -23,6 +24,13 @@ exports.tapCameraAction = function(args){
2324
var cropper = new icModule.ImageCropper();
2425
cropper.show(picture).then(function(args){
2526
console.log(JSON.stringify(args));
27+
if(args.image !== null){
28+
_image1.visibility = "visible";
29+
_image1.imageSource = args.image;
30+
}
31+
else{
32+
_image1.visibility = "collapsed";
33+
}
2634
})
2735
.catch(function(e){
2836
console.log(e);
@@ -38,6 +46,13 @@ exports.tapCameraActionResize = function(args){
3846
var cropper = new icModule.ImageCropper();
3947
cropper.show(picture,{width:100,height:100}).then(function(args){
4048
console.log(JSON.stringify(args));
49+
if(args.image !== null){
50+
_image1.visibility = "visible";
51+
_image1.imageSource = args.image;
52+
}
53+
else{
54+
_image1.visibility = "collapsed";
55+
}
4156
})
4257
.catch(function(e){
4358
console.log(e);

demo/app/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
<Label text="nativescript-imagecropper demo" class="title" textWrap="true"/>
44
<Button text="Camera" tap="tapCameraAction" />
55
<Button text="Camera with Resize" tap="tapCameraActionResize" />
6+
<Image id="image1" visibility="collapsed" />
67
</StackLayout>
78
</Page>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"nativescript-imagecropper",
3-
"version":"0.0.3",
3+
"version":"0.0.4",
44
"description":"A image cropper based on TOCropViewController for iOS and uCrop for Android",
55
"main":"imagecropper.js",
66
"nativescript":{

0 commit comments

Comments
 (0)