Skip to content

Commit 9a46881

Browse files
committed
update demo apps and repo with formatting
1 parent b528617 commit 9a46881

33 files changed

+788
-694
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build CI
2+
3+
# Trigger the workflow on push
4+
on: [push]
5+
6+
jobs:
7+
job1:
8+
name: Android Build
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-java@v1
13+
with:
14+
java-version: 1.8
15+
16+
- name: Base Setup
17+
run: npm run ci.base.setup
18+
19+
- name: Lint
20+
run: npm run ci.tslint
21+
22+
- name: Build Vanilla Android Demo App
23+
run: npm run ci.vanilla.android.build
24+
25+
# - name: Install Android sdkmanager
26+
# run: |
27+
# wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
28+
# sudo unzip -d $ANDROID_HOME android-sdk.zip > /dev/null
29+
# - name: Install required Android tools
30+
# run: |
31+
# echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;${ANDROID_NDK}" > /dev/null
32+
# - name: Android Test
33+
# run: |
34+
# echo no | android create avd --force -n test -b armeabi-v7a
35+
# emulator -avd test -no-audio -no-window &
36+
# android-wait-for-emulator
37+
# cd src && npm i && npm run tsc && cd ../demo && tns build android
38+
# tns test android --justlaunch
39+
40+
job2:
41+
name: iOS Build
42+
runs-on: macos-latest
43+
steps:
44+
- uses: actions/checkout@v1
45+
46+
- name: Base Setup
47+
run: npm run ci.base.setup && npm run ci.pip.install
48+
49+
- name: Build Vanilla iOS Demo App
50+
run: npm run ci.vanilla.ios.build

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
22
"singleQuote": true,
3-
"semi": true
3+
"semi": true,
4+
"trailingComma": "none",
5+
"arrowParens": "avoid"
46
}

.travis.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,17 @@ NativeScript plugin to provide a way to capture any drawing (signatures are a co
3333

3434
From your command prompt/termial go to your app's root folder and execute:
3535

36-
#### NativeScript
36+
#### NativeScript 7+:
3737

38-
`tns plugin add nativescript-drawingpad`
38+
```bash
39+
ns plugin add @nativescript-community/drawingpad
40+
```
41+
42+
#### NativeScript < 7:
43+
44+
```bash
45+
tns plugin add nativescript-drawingpad
46+
```
3947

4048
## Samples
4149

@@ -107,29 +115,29 @@ import { Component, ElementRef, ViewChild } from '@angular/core';
107115
import { registerElement } from '@nativescript/angular';
108116
import { DrawingPad } from '@nativescript-community/drawingpad';
109117

110-
registerElement(
111-
'DrawingPad',
112-
() => DrawingPad
113-
);
118+
registerElement('DrawingPad', () => DrawingPad);
114119

115120
@Component({
116121
selector: 'drawing-pad-example',
117122
template: `
118123
<ScrollView>
119-
<StackLayout>
120-
<DrawingPad #DrawingPad
121-
height="400"
122-
id="drawingPad"
123-
penColor="#ff4081" penWidth="3">
124-
</DrawingPad>
125-
126-
<StackLayout orientation="horizontal">
127-
<Button text="Get Drawing" (tap)="getMyDrawing()"></Button>
128-
<Button text="Clear Drawing" (tap)="clearMyDrawing()"></Button>
129-
</StackLayout>
124+
<StackLayout>
125+
<DrawingPad
126+
#DrawingPad
127+
height="400"
128+
id="drawingPad"
129+
penColor="#ff4081"
130+
penWidth="3"
131+
>
132+
</DrawingPad>
133+
134+
<StackLayout orientation="horizontal">
135+
<Button text="Get Drawing" (tap)="getMyDrawing()"></Button>
136+
<Button text="Clear Drawing" (tap)="clearMyDrawing()"></Button>
130137
</StackLayout>
138+
</StackLayout>
131139
</ScrollView>
132-
`
140+
`
133141
})
134142
export class DrawingPadExample {
135143
@ViewChild('DrawingPad') DrawingPad: ElementRef;

demo-angular/nativescript.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NativeScriptConfig } from '@nativescript/core';
2+
3+
export default {
4+
id: 'org.nativescript.demoangular',
5+
appResourcesPath: 'App_Resources',
6+
android: {
7+
v8Flags: '--expose_gc',
8+
markingMode: 'none'
9+
},
10+
appPath: 'src'
11+
} as NativeScriptConfig;

demo-angular/nsconfig.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

demo-angular/package.json

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
11
{
2-
"nativescript": {
3-
"id": "org.nativescript.demoangular",
4-
"tns-android": {
5-
"version": "5.2.1"
6-
},
7-
"tns-ios": {
8-
"version": "5.2.0"
9-
}
10-
},
112
"description": "NativeScript Application",
123
"license": "SEE LICENSE IN <your-license-filename>",
134
"repository": "<fill-your-repository-here>",
145
"dependencies": {
15-
"@angular/animations": "~7.2.0",
16-
"@angular/common": "~7.2.0",
17-
"@angular/compiler": "~7.2.0",
18-
"@angular/core": "~7.2.0",
19-
"@angular/forms": "~7.2.0",
20-
"@angular/http": "~7.2.0",
21-
"@angular/platform-browser": "~7.2.0",
22-
"@angular/platform-browser-dynamic": "~7.2.0",
23-
"@angular/router": "~7.2.0",
24-
"nativescript-angular": "~7.2.1",
6+
"@angular/animations": "~10.1.0",
7+
"@angular/common": "~10.1.0",
8+
"@angular/compiler": "~10.1.0",
9+
"@angular/core": "~10.1.0",
10+
"@angular/forms": "~10.1.0",
11+
"@angular/http": "^7.2.16",
12+
"@angular/platform-browser": "~10.1.0",
13+
"@angular/platform-browser-dynamic": "~10.1.0",
14+
"@angular/router": "~10.1.0",
2515
"nativescript-theme-core": "~1.0.4",
26-
"nativescript-drawingpad": "file:../src",
16+
"@nativescript-community/drawingpad": "file:../src",
2717
"reflect-metadata": "~0.1.12",
2818
"rxjs": "~6.3.0",
29-
"tns-core-modules": "~5.2.0",
30-
"zone.js": "~0.8.26"
19+
"zone.js": "~0.8.26",
20+
"@nativescript/core": "~7.0.5",
21+
"@nativescript/angular": "10.1.5"
3122
},
3223
"devDependencies": {
33-
"@angular/compiler-cli": "~7.2.0",
24+
"@angular/compiler-cli": "~10.1.0",
25+
"@nativescript/android": "7.0.0",
3426
"@nativescript/schematics": "~0.5.0",
27+
"@nativescript/types": "7.0.0",
28+
"@nativescript/webpack": "~3.0.0",
3529
"@ngtools/webpack": "~7.2.0",
36-
"nativescript-dev-typescript": "~0.8.0",
37-
"nativescript-dev-webpack": "~0.20.0"
30+
"typescript": "~3.9.7"
3831
},
3932
"gitHead": "f548ec926e75201ab1b7c4a3a7ceefe7a4db15af",
40-
"readme": "NativeScript Application"
33+
"readme": "NativeScript Application",
34+
"main": "main.js"
4135
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import { NgModule } from "@angular/core";
2-
import { NativeScriptRouterModule } from "nativescript-angular/router";
3-
import { Routes } from "@angular/router";
4-
5-
import { ItemsComponent } from "./item/items.component";
6-
import { ItemDetailComponent } from "./item/item-detail.component";
1+
import { NgModule } from '@angular/core';
2+
import { Routes } from '@angular/router';
3+
import { NativeScriptRouterModule } from '@nativescript/angular';
4+
import { ItemDetailComponent } from './item/item-detail.component';
5+
import { ItemsComponent } from './item/items.component';
76

87
const routes: Routes = [
9-
{ path: "", redirectTo: "/items", pathMatch: "full" },
10-
{ path: "items", component: ItemsComponent },
11-
{ path: "item/:id", component: ItemDetailComponent }
8+
{ path: '', redirectTo: '/items', pathMatch: 'full' },
9+
{ path: 'items', component: ItemsComponent },
10+
{ path: 'item/:id', component: ItemDetailComponent }
1211
];
1312

1413
@NgModule({
1514
imports: [NativeScriptRouterModule.forRoot(routes)],
1615
exports: [NativeScriptRouterModule]
1716
})
18-
export class AppRoutingModule { }
17+
export class AppRoutingModule {}

demo-angular/src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component } from '@angular/core';
2-
import { registerElement } from 'nativescript-angular/element-registry';
3-
import { DrawingPad } from 'nativescript-drawingpad';
2+
import { DrawingPad } from '@nativescript-community/drawingpad';
3+
import { registerElement } from '@nativescript/angular';
44

55
registerElement('DrawingPad', () => DrawingPad);
66

0 commit comments

Comments
 (0)