10000 chore: cleanup · NativeScript/plugins@a421b3d · GitHub
[go: up one dir, main page]

Skip to content

Commit a421b3d

Browse files
committed
chore: cleanup
1 parent ff7a405 commit a421b3d

File tree

24 files changed

+725
-663
lines changed

24 files changed

+725
-663
lines changed

apps/demo-angular/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,30 @@
1515
"reflect-metadata": "file:../../node_modules/reflect-metadata",
1616
"rxjs": "file:../../node_modules/rxjs",
1717
"zone.js": "file:../../node_modules/zone.js",
18-
"@nativescript/localize": "file:../../dist/packages/localize",
18+
"@nativescript/social-share": "file:../../dist/packages/social-share",
1919
"@nativescript/animated-circle": "file:../../dist/packages/animated-circle",
2020
"@nativescript/appavailability": "file:../../dist/packages/appavailability",
2121
"@nativescript/auto-fit-text": "file:../../dist/packages/auto-fit-text",
2222
"@nativescript/background-http": "file:../../dist/packages/background-http",
2323
"@nativescript/brightness": "file:../../dist/packages/brightness",
2424
"@nativescript/camera": "file:../../dist/packages/camera",
2525
"@nativescript/datetimepicker": "file:../../dist/packages/datetimepicker",
26+
"@nativescript/detox": "file:../../dist/packages/detox",
2627
"@nativescript/directions": "file:../../dist/packages/directions",
2728
"@nativescript/email": "file:../../dist/packages/email",
2829
"@nativescript/fingerprint-auth": "file:../../dist/packages/fingerprint-auth",
2930
"@nativescript/geolocation": "file:../../dist/packages/geolocation",
3031
"@nativescript/imagepicker": "file:../../dist/packages/imagepicker",
3132
"@nativescript/iqkeyboardmanager": "file:../../dist/packages/iqkeyboardmanager",
3233
"@nativescript/local-notifications": "file:../../dist/packages/local-notifications",
34+
"@nativescript/localize": "file:../../dist/packages/localize",
3335
"@nativescript/shared-notification-delegate": "file:../../dist/packages/shared-notification-delegate",
34-
"@nativescript/social-share": "file:../../dist/packages/social-share",
3536
"@nativescript/zip": "file:../../dist/packages/zip"
3637
},
3738
"devDependencies": {
3839
"@angular/compiler-cli": "file:../../node_modules/@angular/compiler-cli",
39-
"@nativescript/android": "7.0.0",
40-
"@nativescript/ios": "7.0.0",
40+
"@nativescript/android": "7.0.1",
41+
"@nativescript/ios": "7.1.1",
4142
"@nativescript/webpack": "~3.0.0",
4243
"@ngtools/webpack": "file:../../node_modules/@ngtools/webpack",
4344
"typescript": "file:../../node_modules/typescript"

apps/demo-angular/src/app-routing.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const routes: Routes = [
1414
{ path: 'brightness', loadChildren: () => import('./plugin-demos/brightness.module').then((m) => m.BrightnessModule) },
1515
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then((m) => m.CameraModule) },
1616
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then((m) => m.DatetimepickerModule) },
17+
{ path: 'detox', loadChildren: () => import('./plugin-demos/detox.module').then((m) => m.DetoxModule) },
1718
{ path: 'directions', loadChildren: () => import('./plugin-demos/directions.module').then((m) => m.DirectionsModule) },
1819
{ path: 'email', loadChildren: () => import('./plugin-demos/email.module').then((m) => m.EmailModule) },
1920
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then((m) => m.FingerprintAuthModule) },

apps/demo-angular/src/home.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export class HomeComponent {
2727
{
2828
name: 'datetimepicker',
2929
},
30+
{
31+
name: 'detox',
32+
},
3033
{
3134
name: 'directions',
3235
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="detox" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test detox" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedDetox } from '@demo/shared';
3+
import {} from '@nativescript/detox';
4+
5+
@Component({
6+
selector: 'demo-detox',
7+
templateUrl: 'detox.component.html',
8+
})
9+
export class DetoxComponent {
10+
demoShared: DemoSharedDetox;
11+
12+
constructor(private _ngZone: NgZone) {}
13+
14+
ngOnInit() {
15+
this.demoShared = new DemoSharedDetox();
16+
}
17+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
3+
import { DetoxComponent } from './detox.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: DetoxComponent }])],
7+
declarations: [DetoxComponent],
8+
schemas: [NO_ERRORS_SCHEMA],
9+
})
10+
export class DetoxModule {}

apps/demo/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,29 @@
66
"dependencies": {
77
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
88
"@nativescript/core": "file:../../node_modules/@nativescript/core",
9-
"@nativescript/localize": "file:../../packages/localize",
9+
"@nativescript/social-share": "file:../../packages/social-share",
1010
"@nativescript/animated-circle": "file:../../packages/animated-circle",
1111
"@nativescript/appavailability": "file:../../packages/appavailability",
1212
"@nativescript/auto-fit-text": "file:../../packages/auto-fit-text",
1313
"@nativescript/background-http": "file:../../packages/background-http",
1414
"@nativescript/brightness": "file:../../packages/brightness",
1515
"@nativescript/camera": "file:../../packages/camera",
1616
"@nativescript/datetimepicker": "file:../../packages/datetimepicker",
17+
"@nativescript/detox": "file:../../packages/detox",
1718
"@nativescript/directions": "file:../../packages/directions",
1819
"@nativescript/email": "file:../../packages/email",
1920
"@nativescript/fingerprint-auth": "file:../../packages/fingerprint-auth",
2021
"@nativescript/geolocation": "file:../../packages/geolocation",
2122
"@nativescript/imagepicker": "file:../../packages/imagepicker",
2223
"@nativescript/iqkeyboardmanager": "file:../../packages/iqkeyboardmanager",
2324
"@nativescript/local-notifications": "file:../../packages/local-notifications",
25+
"@nativescript/localize": "file:../../dist/packages/localize",
2426
"@nativescript/shared-notification-delegate": "file:../../packages/shared-notification-delegate",
25-
"@nativescript/social-share": "file:../../packages/social-share",
2627
"@nativescript/zip": "file:../../packages/zip"
2728
},
2829
"devDependencies": {
29-
"@nativescript/android": "7.0.0",
30-
"@nativescript/ios": "7.0.0",
30+
"@nativescript/android": "7.0.1",
31+
"@nativescript/ios": "7.1.1",
3132
"@nativescript/webpack": "~3.0.0",
3233
"typescript": "file:../../node_modules/typescript"
3334
}

apps/demo/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<Button text="brightness" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1313
<Button text="camera" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1414
<Button text="datetimepicker" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
15+
<Button text="detox" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1516
<Button text="directions" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1617
<Button text="email" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
1718
<Button text="fingerprint-auth" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>

apps/demo/src/plugin-demos/animated-circle.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ import { EventData, Page } from '@nativescript/core';
33

44
export function navigatingTo(args: EventData) {
55
const page = <Page>args.object;
6-
page.bindingContext = new DemoModel();
6+
page.bindingContext = new DemoModel(page);
77
}
88

99
export class DemoModel extends DemoSharedAnimatedCircle {
1010
private _progress: number = 0;
11+
private _interval: number;
1112

12-
constructor() {
13+
constructor(page: Page) {
1314
super();
14-
setInterval(() => {
15+
this._interval = <any>setInterval(() => {
1516
console.log(this.progress, this._progress);
1617
if (this.progress === 100) {< FE7F /span>
1718
this.progress = 0;
1819
}
1920
this.progress++;
2021
}, 100);
22+
page.on(Page.navigatingFromEvent, () => {
23+
clearInterval(this._interval);
24+
});
2125
}
2226

2327
set progress(value: number) {
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { Observable, EventData, Page } from '@nativescript/core';
2-
import { } from '@nativescript/appavailability';
2+
import { available } from '@nativescript/appavailability';
33

44
export function navigatingTo(args: EventData) {
55
const page = <Page>args.object;
66
page.bindingContext = new DemoModel();
77
}
88

99
export class DemoModel extends Observable {
10-
11-
testIt() {
12-
// test something here
13-
}
14-
}
10+
testIt() {
11+
available('twitter://').then((avail: boolean) => {
12+
alert('Twitter app available? ' + avail);
13+
});
14+
}
15+
}

0 commit comments

Comments
 (0)
0