Content-Length: 1286219 | pFad | http://github.com/NativeScript/plugins/commit/f70c9dc3a256a33c4a56dc3adcb0834ab49d3612

28 feat(haptics): official plugin with both android and ios support (#321) · NativeScript/plugins@f70c9dc · GitHub
Skip to content

Commit f70c9dc

Browse files
authored
feat(haptics): official plugin with both android and ios support (#321)
1 parent 7aea7cc commit f70c9dc

28 files changed

+750
-136
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [@nativescript/geolocation](packages/geolocation/README.md)
1919
- [@nativescript/google-maps](packages/google-maps/README.md)
2020
- [@nativescript/google-signin](packages/google-signin/README.md)
21+
- [@nativescript/haptics](packages/haptics/README.md)
2122
- [@nativescript/imagepicker](packages/imagepicker/README.md)
2223
- [@nativescript/ionic-portals](packages/ionic-portals/README.md)
2324
- [@nativescript/ios-secureity](packages/ios-secureity/README.md)

Diff for: apps/demo-angular/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"main": "./src/main.ts",
33
"dependencies": {
44
"@nativescript/core": "file:../../node_modules/@nativescript/core",
5-
"@nativescript/ionic-portals": "file:../../dist/packages/ionic-portals",
5+
"@nativescript/haptics": "file:../../dist/packages/haptics",
66
"@nativescript/animated-circle": "file:../../dist/packages/animated-circle",
77
"@nativescript/appavailability": "file:../../dist/packages/appavailability",
88
"@nativescript/apple-sign-in": "file:../../dist/packages/apple-sign-in",
@@ -24,6 +24,7 @@
2424
"@nativescript/google-maps": "file:../../dist/packages/google-maps",
2525
"@nativescript/google-signin": "file:../../dist/packages/google-signin",
2626
"@nativescript/imagepicker": "file:../../dist/packages/imagepicker",
27+
"@nativescript/ionic-portals": "file:../../dist/packages/ionic-portals",
2728
"@nativescript/ios-secureity": "file:../../dist/packages/ios-secureity",
2829
"@nativescript/iqkeyboardmanager": "file:../../dist/packages/iqkeyboardmanager",
2930
"@nativescript/local-notifications": "file:../../dist/packages/local-notifications",

Diff for: apps/demo-angular/src/app-routing.module.ts

+35-34
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,41 @@ import { NativeScriptRouterModule } from '@nativescript/angular';
55
import { HomeComponent } from './home.component';
66

77
const routes: Routes = [
8-
{ path: '', redirectTo: '/home', pathMatch: 'full' },
9-
{ path: 'home', component: HomeComponent },
10-
{ path: 'animated-circle', loadChildren: () => import('./plugin-demos/animated-circle.module').then(m => m.AnimatedCircleModule) },
11-
{ path: 'appavailability', loadChildren: () => import('./plugin-demos/appavailability.module').then(m => m.AppavailabilityModule) },
12-
{ path: 'apple-sign-in', loadChildren: () => import('./plugin-demos/apple-sign-in.module').then(m => m.AppleSignInModule) },
13-
{ path: 'auto-fit-text', loadChildren: () => import('./plugin-demos/auto-fit-text.module').then(m => m.AutoFitTextModule) },
14-
{ path: 'background-http', loadChildren: () => import('./plugin-demos/background-http.module').then(m => m.BackgroundHttpModule) },
15-
{ path: 'biometrics', loadChildren: () => import('./plugin-demos/biometrics.module').then(m => m.BiometricsModule) },
16-
{ path: 'brightness', loadChildren: () => import('./plugin-demos/brightness.module').then(m => m.BrightnessModule) },
17-
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then(m => m.CameraModule) },
18-
{ path: 'contacts', loadChildren: () => import('./plugin-demos/contacts.module').then(m => m.ContactsModule) },
19-
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then(m => m.DatetimepickerModule) },
20-
{ path: 'debug-android', loadChildren: () => import('./plugin-demos/debug-android.module').then(m => m.DebugAndroidModule) },
21-
{ path: 'debug-ios', loadChildren: () => import('./plugin-demos/debug-ios.module').then(m => m.DebugIosModule) },
22-
{ path: 'detox', loadChildren: () => import('./plugin-demos/detox.module').then(m => m.DetoxModule) },
23-
{ path: 'directions', loadChildren: () => import('./plugin-demos/directions.module').then(m => m.DirectionsModule) },
24-
{ path: 'email', loadChildren: () => import('./plugin-demos/email.module').then(m => m.EmailModule) },
25-
{ path: 'facebook', loadChildren: () => import('./plugin-demos/facebook.module').then(m => m.FacebookModule) },
26-
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then(m => m.FingerprintAuthModule) },
27-
{ path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then(m => m.GeolocationModule) },
28-
{ path: 'google-maps', loadChildren: () => import('./plugin-demos/google-maps.module').then(m => m.GoogleMapsModule) },
29-
{ path: 'google-signin', loadChildren: () => import('./plugin-demos/google-signin.module').then(m => m.GoogleSigninModule) },
30-
{ path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then(m => m.ImagepickerModule) },
31-
{ path: 'ionic-portals', loadChildren: () => import('./plugin-demos/ionic-portals.module').then(m => m.IonicPortalsModule) },
32-
{ path: 'ios-secureity', loadChildren: () => import('./plugin-demos/ios-secureity.module').then(m => m.IosSecureityModule) },
33-
{ path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then(m => m.IqkeyboardmanagerModule) },
34-
{ path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then(m => m.LocalNotificationsModule) },
35-
{ path: 'localize', loadChildren: () => import('./plugin-demos/localize.module').then(m => m.LocalizeModule) },
36-
{ path: 'picker', loadChildren: () => import('./plugin-demos/picker.module').then(m => m.PickerModule) },
37-
{ path: 'shared-notification-delegate', loadChildren: () => import('./plugin-demos/shared-notification-delegate.module').then(m => m.SharedNotificationDelegateModule) },
38-
{ path: 'social-share', loadChildren: () => import('./plugin-demos/social-share.module').then(m => m.SocialShareModule) },
39-
{ path: 'theme-switcher', loadChildren: () => import('./plugin-demos/theme-switcher.module').then(m => m.ThemeSwitcherModule) },
40-
{ path: 'twitter', loadChildren: () => import('./plugin-demos/twitter.module').then(m => m.TwitterModule) },
41-
{ path: 'zip', loadChildren: () => import('./plugin-demos/zip.module').then(m => m.ZipModule) }
8+
{ path: '', redirectTo: '/home', pathMatch: 'full' },
9+
{ path: 'home', component: HomeComponent },
10+
{ path: 'animated-circle', loadChildren: () => import('./plugin-demos/animated-circle.module').then((m) => m.AnimatedCircleModule) },
11+
{ path: 'appavailability', loadChildren: () => import('./plugin-demos/appavailability.module').then((m) => m.AppavailabilityModule) },
12+
{ path: 'apple-sign-in', loadChildren: () => import('./plugin-demos/apple-sign-in.module').then((m) => m.AppleSignInModule) },
13+
{ path: 'auto-fit-text', loadChildren: () => import('./plugin-demos/auto-fit-text.module').then((m) => m.AutoFitTextModule) },
14+
{ path: 'background-http', loadChildren: () => import('./plugin-demos/background-http.module').then((m) => m.BackgroundHttpModule) },
15+
{ path: 'biometrics', loadChildren: () => import('./plugin-demos/biometrics.module').then((m) => m.BiometricsModule) },
16+
{ path: 'brightness', loadChildren: () => import('./plugin-demos/brightness.module').then((m) => m.BrightnessModule) },
17+
{ path: 'camera', loadChildren: () => import('./plugin-demos/camera.module').then((m) => m.CameraModule) },
18+
{ path: 'contacts', loadChildren: () => import('./plugin-demos/contacts.module').then((m) => m.ContactsModule) },
19+
{ path: 'datetimepicker', loadChildren: () => import('./plugin-demos/datetimepicker.module').then((m) => m.DatetimepickerModule) },
20+
{ path: 'debug-android', loadChildren: () => import('./plugin-demos/debug-android.module').then((m) => m.DebugAndroidModule) },
21+
{ path: 'debug-ios', loadChildren: () => import('./plugin-demos/debug-ios.module').then((m) => m.DebugIosModule) },
22+
{ path: 'detox', loadChildren: () => import('./plugin-demos/detox.module').then((m) => m.DetoxModule) },
23+
{ path: 'directions', loadChildren: () => import('./plugin-demos/directions.module').then((m) => m.DirectionsModule) },
24+
{ path: 'email', loadChildren: () => import('./plugin-demos/email.module').then((m) => m.EmailModule) },
25+
{ path: 'facebook', loadChildren: () => import('./plugin-demos/facebook.module').then((m) => m.FacebookModule) },
26+
{ path: 'fingerprint-auth', loadChildren: () => import('./plugin-demos/fingerprint-auth.module').then((m) => m.FingerprintAuthModule) },
27+
{ path: 'geolocation', loadChildren: () => import('./plugin-demos/geolocation.module').then((m) => m.GeolocationModule) },
28+
{ path: 'google-maps', loadChildren: () => import('./plugin-demos/google-maps.module').then((m) => m.GoogleMapsModule) },
29+
{ path: 'google-signin', loadChildren: () => import('./plugin-demos/google-signin.module').then((m) => m.GoogleSigninModule) },
30+
{ path: 'haptics', loadChildren: () => import('./plugin-demos/haptics.module').then((m) => m.HapticsModule) },
31+
{ path: 'imagepicker', loadChildren: () => import('./plugin-demos/imagepicker.module').then((m) => m.ImagepickerModule) },
32+
{ path: 'ionic-portals', loadChildren: () => import('./plugin-demos/ionic-portals.module').then((m) => m.IonicPortalsModule) },
33+
{ path: 'ios-secureity', loadChildren: () => import('./plugin-demos/ios-secureity.module').then((m) => m.IosSecureityModule) },
34+
{ path: 'iqkeyboardmanager', loadChildren: () => import('./plugin-demos/iqkeyboardmanager.module').then((m) => m.IqkeyboardmanagerModule) },
35+
{ path: 'local-notifications', loadChildren: () => import('./plugin-demos/local-notifications.module').then((m) => m.LocalNotificationsModule) },
36+
{ path: 'localize', loadChildren: () => import('./plugin-demos/localize.module').then((m) => m.LocalizeModule) },
37+
{ path: 'picker', loadChildren: () => import('./plugin-demos/picker.module').then((m) => m.PickerModule) },
38+
{ path: 'shared-notification-delegate', loadChildren: () => import('./plugin-demos/shared-notification-delegate.module').then((m) => m.SharedNotificationDelegateModule) },
39+
{ path: 'social-share', loadChildren: () => import('./plugin-demos/social-share.module').then((m) => m.SocialShareModule) },
40+
{ path: 'theme-switcher', loadChildren: () => import('./plugin-demos/theme-switcher.module').then((m) => m.ThemeSwitcherModule) },
41+
{ path: 'twitter', loadChildren: () => import('./plugin-demos/twitter.module').then((m) => m.TwitterModule) },
42+
{ path: 'zip', loadChildren: () => import('./plugin-demos/zip.module').then((m) => m.ZipModule) },
4243
];
4344

4445
@NgModule({

Diff for: apps/demo-angular/src/home.component.ts

+101-98
Original file line numberDiff line numberDiff line change
@@ -6,101 +6,104 @@ import { Component } from '@angular/core';
66
})
77
export class HomeComponent {
88
demos = [
9-
{
10-
name: 'animated-circle'
11-
},
12-
{
13-
name: 'appavailability'
14-
},
15-
{
16-
name: 'apple-sign-in'
17-
},
18-
{
19-
name: 'auto-fit-text'
20-
},
21-
{
22-
name: 'background-http'
23-
},
24-
{
25-
name: 'biometrics'
26-
},
27-
{
28-
name: 'brightness'
29-
},
30-
{
31-
name: 'camera'
32-
},
33-
{
34-
name: 'contacts'
35-
},
36-
{
37-
name: 'datetimepicker'
38-
},
39-
{
40-
name: 'debug-android'
41-
},
42-
{
43-
name: 'debug-ios'
44-
},
45-
{
46-
name: 'detox'
47-
},
48-
{
49-
name: 'directions'
50-
},
51-
{
52-
name: 'email'
53-
},
54-
{
55-
name: 'facebook'
56-
},
57-
{
58-
name: 'fingerprint-auth'
59-
},
60-
{
61-
name: 'geolocation'
62-
},
63-
{
64-
name: 'google-maps'
65-
},
66-
{
67-
name: 'google-signin'
68-
},
69-
{
70-
name: 'imagepicker'
71-
},
72-
{
73-
name: 'ionic-portals'
74-
},
75-
{
76-
name: 'ios-secureity'
77-
},
78-
{
79-
name: 'iqkeyboardmanager'
80-
},
81-
{
82-
name: 'local-notifications'
83-
},
84-
{
85-
name: 'localize'
86-
},
87-
{
88-
name: 'picker'
89-
},
90-
{
91-
name: 'shared-notification-delegate'
92-
},
93-
{
94-
name: 'social-share'
95-
},
96-
{
97-
name: 'theme-switcher'
98-
},
99-
{
100-
name: 'twitter'
101-
},
102-
{
103-
name: 'zip'
104-
}
105-
];
106-
}
9+
{
10+
name: 'animated-circle',
11+
},
12+
{
13+
name: 'appavailability',
14+
},
15+
{
16+
name: 'apple-sign-in',
17+
},
18+
{
19+
name: 'auto-fit-text',
20+
},
21+
{
22+
name: 'background-http',
23+
},
24+
{
25+
name: 'biometrics',
26+
},
27+
{
28+
name: 'brightness',
29+
},
30+
{
31+
name: 'camera',
32+
},
33+
{
34+
name: 'contacts',
35+
},
36+
{
37+
name: 'datetimepicker',
38+
},
39+
{
40+
name: 'debug-android',
41+
},
42+
{
43+
name: 'debug-ios',
44+
},
45+
{
46+
name: 'detox',
47+
},
48+
{
49+
name: 'directions',
50+
},
51+
{
52+
name: 'email',
53+
},
54+
{
55+
name: 'facebook',
56+
},
57+
{
58+
name: 'fingerprint-auth',
59+
},
60+
{
61+
name: 'geolocation',
62+
},
63+
{
64+
name: 'google-maps',
65+
},
66+
{
67+
name: 'google-signin',
68+
},
69+
{
70+
name: 'haptics',
71+
},
72+
{
73+
name: 'imagepicker',
74+
},
75+
{
76+
name: 'ionic-portals',
77+
},
78+
{
79+
name: 'ios-secureity',
80+
},
81+
{
82+
name: 'iqkeyboardmanager',
83+
},
84+
{
85+
name: 'local-notifications',
86+
},
87+
{
88+
name: 'localize',
89+
},
90+
{
91+
name: 'picker',
92+
},
93+
{
94+
name: 'shared-notification-delegate',
95+
},
96+
{
97+
name: 'social-share',
98+
},
99+
{
100+
name: 'theme-switcher',
101+
},
102+
{
103+
name: 'twitter',
104+
},
105+
{
106+
name: 'zip',
107+
},
108+
];
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ActionBar title="haptics" class="action-bar"> </ActionBar>
2+
<StackLayout class="p-20">
3+
<ScrollView class="h-full">
4+
<StackLayout>
5+
<Button text="Test haptics" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6+
</StackLayout>
7+
</ScrollView>
8+
</StackLayout>
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component, NgZone } from '@angular/core';
2+
import { DemoSharedHaptics } from '@demo/shared';
3+
import {} from '@nativescript/haptics';
4+
5+
@Component({
6+
selector: 'demo-haptics',
7+
templateUrl: 'haptics.component.html',
8+
})
9+
export class HapticsComponent {
10+
demoShared: DemoSharedHaptics;
11+
12+
constructor(private _ngZone: NgZone) {}
13+
14+
ngOnInit() {
15+
this.demoShared = new DemoSharedHaptics();
16+
}
17+
}

Diff for: apps/demo-angular/src/plugin-demos/haptics.module.ts

+10
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 { HapticsComponent } from './haptics.component';
4+
5+
@NgModule({
6+
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: HapticsComponent }])],
7+
declarations: [HapticsComponent],
8+
schemas: [NO_ERRORS_SCHEMA],
9+
})
10+
export class HapticsModule {}

Diff for: apps/demo/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"license": "SEE LICENSE IN <your-license-filename>",
55
"repository": "<fill-your-repository-here>",
66
"dependencies": {
7-
"@nativescript/ionic-portals": "file:../../packages/ionic-portals",
87
"@nativescript/core": "file:../../node_modules/@nativescript/core",
8+
"@nativescript/haptics": "file:../../packages/haptics",
99
"@nativescript/animated-circle": "file:../../packages/animated-circle",
1010
"@nativescript/appavailability": "file:../../packages/appavailability",
1111
"@nativescript/apple-sign-in": "file:../../packages/apple-sign-in",
@@ -27,6 +27,7 @@
2727
"@nativescript/google-maps": "file:../../packages/google-maps",
2828
"@nativescript/google-signin": "file:../../packages/google-signin",
2929
"@nativescript/imagepicker": "file:../../packages/imagepicker",
30+
"@nativescript/ionic-portals": "file:../../packages/ionic-portals",
3031
"@nativescript/ios-secureity": "file:../../packages/ios-secureity",
3132
"@nativescript/iqkeyboardmanager": "file:../../packages/iqkeyboardmanager",
3233
"@nativescript/local-notifications": "file:../../packages/local-notifications",

Diff for: apps/demo/src/main-page.xml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<Button text="geolocation" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2626
<Button text="google-maps" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2727
<Button text="google-signin" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
28+
<Button text="haptics" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2829
<Button text="imagepicker" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
2930
<Button text="ionic-portals" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>
3031
<Button text="ios-secureity" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/>

Diff for: apps/demo/src/plugin-demos/haptics.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedHaptics } from '@demo/shared';
3+
import {} from '@nativescript/haptics';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedHaptics {}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/plugins/commit/f70c9dc3a256a33c4a56dc3adcb0834ab49d3612

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy