-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from NativeScript/hristova/make-dimensions-ma…
…tch-orientation-when-keepAspectRatio-true fix: make dimensions match orientation when keepAspectRatio is true
- Loading branch information
Showing
9 changed files
with
121 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# Example for using nativescript-camera plugin | ||
## This example demonstrates how to use plugin with nativescript-angular and webpack | ||
|
||
Steps to start example. | ||
If you want to test it out on an emulator or a device you can follow the instructions below: | ||
|
||
1. npm install | ||
2. Due to a bug with the used version of @angular, a single line from file | ||
node_modules/@angular/compiler/index.js (line 38: export * from './src/template_parser/template_ast';) should be deleted, since its duplicated. | ||
3. tns platform add android - to add platform before starting webpack process | ||
4. npm run start-android | ||
`git clone https://github.com/NativeScript/nativescript-camera.git` | ||
`cd nativescript-camera/demo` or `cd nativescript-camera/demo-angular` | ||
`npm run build.plugin && npm install` | ||
`tns run android` or `tns run ios` depending on the platform you want to test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
<GridLayout rows="auto, *, auto"> | ||
<StackLayout orientation="horizontal" row="0" padding="10"> | ||
<Label text="saveToGallery"></Label> | ||
<Switch [(ngModel)]="saveToGallery"></Switch> | ||
<GridLayout rows="auto, *, auto, auto"> | ||
<StackLayout row="0" orientation="vertical" padding="10"> | ||
<StackLayout orientation="horizontal" padding="10"> | ||
<Label text="saveToGallery"></Label> | ||
<Switch [(ngModel)]="saveToGallery"></Switch> | ||
</StackLayout> | ||
<StackLayout orientation="horizontal" padding="10"> | ||
<Label text="keepAspectRatio"></Label> | ||
<Switch [(ngModel)]="keepAspectRatio"></Switch> | ||
</StackLayout> | ||
<StackLayout orientation="horizontal" padding="10"> | ||
<Label text="width"></Label> | ||
<TextField hint="Enter width" keyboardType="number" [(ngModel)]="width" class="input"></TextField> | ||
<Label text="height"></Label> | ||
<TextField hint="Enter height" keyboardType="number" [(ngModel)]="height" class="input"></TextField> | ||
</StackLayout> | ||
</StackLayout> | ||
<Image row="1" [src]="cameraImage" stretch="fill" margin="10"></Image> | ||
<Button text="Take Picture" (tap)='onTakePictureTap($event)' row="2" padding="10"></Button> | ||
|
||
<Image row="1" [src]="cameraImage" stretch="aspectFit" margin="10"></Image> | ||
<TextView row="2" [(ngModel)]="labelText" editable="false"></TextView>> | ||
<Button row="3" text="Take Picture" (tap)='onTakePictureTap($event)' padding="10"></Button> | ||
</GridLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Example for using nativescript-camera plugin | ||
|
||
If you want to test it out on an emulator or a device you can follow the instructions below: | ||
|
||
`git clone https://github.com/NativeScript/nativescript-camera.git` | ||
`cd nativescript-camera/demo` or `cd nativescript-camera/demo-angular` | ||
`npm run build.plugin && npm install` | ||
`tns run android` or `tns run ios` depending on the platform you want to test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo"> | ||
<GridLayout rows="auto, *, auto"> | ||
<StackLayout orientation="horizontal" row="0" padding="10"> | ||
<Label text="saveToGallery" /> | ||
<Switch checked="{{ saveToGallery }}"/> | ||
<GridLayout rows="auto, *, auto, auto"> | ||
<StackLayout row="0" orientation="vertical" padding="10"> | ||
<StackLayout orientation="horizontal" row="0" padding="10"> | ||
<Label text="saveToGallery" /> | ||
<Switch checked="{{ saveToGallery }}"/> | ||
</StackLayout> | ||
<StackLayout orientation="horizontal" row="0" padding="10"> | ||
<Label text="keepAspectRatio" /> | ||
<Switch checked="{{ keepAspectRatio }}"/> | ||
</StackLayout> | ||
<StackLayout orientation="horizontal" padding="10"> | ||
<Label text="width"></Label> | ||
<TextField hint="Enter width" keyboardType="number" text="{{ width }}" class="input"></TextField> | ||
<Label text="height"></Label> | ||
<TextField hint="Enter height" keyboardType="number" text="{{ height }}" class="input"></TextField> | ||
</StackLayout> | ||
</StackLayout> | ||
<Image row="1" src="{{ cameraImage }}" id="image" stretch="fill" margin="10"/> | ||
<Button text="Take Picture" tap="onTakePictureTap" row="2" padding="10"/> | ||
<Image row="1" src="{{ cameraImage }}" id="image" stretch="aspectFit" margin="10"/> | ||
<TextView row="2" text="{{ labelText }}" editable="false"></TextView>> | ||
<Button row="3" text="Take Picture" tap="onTakePictureTap" padding="10"/> | ||
</GridLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters