Skip to content

Commit 4c614a9

Browse files
committed
Revert "added"
This reverts commit bea462e.
1 parent bea462e commit 4c614a9

File tree

4 files changed

+19
-81
lines changed

4 files changed

+19
-81
lines changed

examples/CameraTest/app/App_Resources/iOS/build.xcconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
66
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
77
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8-
DEVELOPMENT_TEAM = W7TGC3P93K

examples/CameraTest/app/main-page.ts

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@ import { takePicture, requestPermissions } from "nativescript-camera";
55
import * as appModule from "application";
66
import * as imageSourceModule from "image-source";
77

8-
import { ImagePicker, ImageOptions } from "nativescript-imagepicker";
9-
108
import * as trace from "trace";
119
trace.addCategories(trace.categories.Debug);
1210
trace.enable();
1311

14-
var list;
15-
1612
export function navigatingTo(args: EventData) {
1713
var page = <Page>args.object;
1814
let picturePath = null;
19-
list = page.getViewById("urls-list");
20-
page.bindingContext = fromObject({ cameraImage: picturePath, saveToGallery: true });
15+
16+
page.bindingContext = fromObject({cameraImage: picturePath, saveToGallery: true});
2117
}
2218

2319
export function onRequestPermissionsTap(args: EventData) {
@@ -27,56 +23,15 @@ export function onRequestPermissionsTap(args: EventData) {
2723
export function onTakePictureTap(args: EventData) {
2824
let page = <Page>(<View>args.object).page;
2925
let saveToGallery = page.bindingContext.get("saveToGallery");
30-
takePicture({ width: 180, height: 180, keepAspectRatio: false, saveToGallery: saveToGallery }).
26+
takePicture({width: 180, height: 180, keepAspectRatio: false, saveToGallery: saveToGallery}).
3127
then((imageAsset) => {
3228
let source = new imageSourceModule.ImageSource();
3329
source.fromAsset(imageAsset).then((source) => {
3430
console.log(`Size: ${source.width}x${source.height}`);
3531
});
3632
page.bindingContext.set("cameraImage", imageAsset);
37-
},
33+
},
3834
(err) => {
3935
console.log("Error -> " + err.message);
4036
});
41-
}
42-
43-
44-
export function onSelectMultipleTap(args) {
45-
var imagepicker = require("nativescript-imagepicker");
46-
var context = imagepicker.create({
47-
mode: "multiple"
48-
});
49-
startSelection(context);
50-
}
51-
52-
53-
export function onSelectSingleTap(args) {
54-
var imagepicker = require("nativescript-imagepicker");
55-
var context = imagepicker.create({
56-
mode: "single"
57-
});
58-
startSelection(context);
59-
}
60-
61-
62-
export function startSelection(context) {
63-
context
64-
.authorize()
65-
.then(() => {
66-
list.items = [];
67-
return context.present();
68-
})
69-
.then(selection => {
70-
console.log("Selection done:");
71-
var tempList = [];
72-
selection.forEach(function (selected) {
73-
console.log("----------------");
74-
console.log("uri: " + selected.uri);
75-
console.log("fileUri: " + selected.fileUri);
76-
tempList.push(selected);
77-
});
78-
list.items = tempList;
79-
}).catch((e) => {
80-
console.log(e);
81-
});
8237
}

examples/CameraTest/app/main-page.xml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
11
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo">
2-
<ScrollView>
3-
<StackLayout>
4-
<GridLayout rows="auto, *, auto">
5-
<StackLayout orientation="horizontal" row="0" padding="10">
6-
<Label text="saveToGallery" />
7-
<Switch checked="{{ saveToGallery }}"/>
8-
</StackLayout>
9-
<Image row="1" src="{{ cameraImage }}" id="image" stretch="aspectFit" margin="10"/>
10-
<StackLayout row="2" padding="10">
11-
<Button text="Take Picture" tap="onTakePictureTap" />
12-
<Button text="Request Permissions" tap="onRequestPermissionsTap" />
13-
</StackLayout>
14-
</GridLayout>
15-
16-
<GridLayout rows="*, auto, auto">
17-
<ListView id="urls-list" borderColor="gray" borderWidth="5">
18-
<ListView.itemTemplate>
19-
<GridLayout columns="94, *" rows="*, *" height="150">
20-
<Image rowSpan="2" width="80" height="80" src="{{ $value }}" />
21-
<Label col="1" text="{{ uri }}" />
22-
<Label col="1" row="1" text="{{ fileUri }}" />
23-
</GridLayout>
24-
</ListView.itemTemplate>
25-
</ListView>
26-
<Button row="1" text="Pick Single" tap="onSelectSingleTap" horizontalAlignment="center" />
27-
<Button row="2" text="Pick Multiple" tap="onSelectMultipleTap" horizontalAlignment="center" />
28-
</GridLayout>
2+
<GridLayout rows="auto, *, auto">
3+
<StackLayout orientation="horizontal" row="0" padding="10">
4+
<Label text="saveToGallery" />
5+
<Switch checked="{{ saveToGallery }}"/>
296
</StackLayout>
30-
</ScrollView>
7+
<Image row="1" src="{{ cameraImage }}" id="image" stretch="aspectFit" margin="10"/>
8+
<StackLayout orientation="horizontal" row="2" padding="10">
9+
<Button text="Take Picture" tap="onTakePictureTap" />
10+
<Button text="Request Permissions" tap="onRequestPermissionsTap" />
11+
</StackLayout>
12+
</GridLayout>
3113
</Page>

examples/CameraTest/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
"id": "org.nativescript.CameraTest",
88
"tns-ios": {
99
"version": "2.5.0"
10+
},
11+
"tns-android": {
12+
"version": "2.5.0"
1013
}
1114
},
1215
"dependencies": {
13-
"nativescript-camera": "0.0.8",
14-
"nativescript-imagepicker": "^2.5.1",
15-
"tns-core-modules": "^2.5.2"
16+
"nativescript-camera": "0.0.6",
17+
"tns-core-modules": "^2.5.1"
1618
},
1719
"devDependencies": {
1820
"babel-traverse": "6.15.0",

0 commit comments

Comments
 (0)