├── .gitignore
├── .npmignore
├── .vscode
├── launch.json
└── settings.json
├── LICENSE
├── README.md
├── app
├── App_Resources
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── app.gradle
│ │ ├── drawable-hdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-ldpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-mdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-nodpi
│ │ │ └── splash_screen.xml
│ │ ├── drawable-xhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── values-v21
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ └── iOS
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── icon-1024.png
│ │ │ ├── icon-29.png
│ │ │ ├── icon-29@2x.png
│ │ │ ├── icon-29@3x.png
│ │ │ ├── icon-40.png
│ │ │ ├── icon-40@2x.png
│ │ │ ├── icon-40@3x.png
│ │ │ ├── icon-60@2x.png
│ │ │ ├── icon-60@3x.png
│ │ │ ├── icon-76.png
│ │ │ ├── icon-76@2x.png
│ │ │ └── icon-83.5@2x.png
│ │ ├── Contents.json
│ │ ├── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-1125h.png
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-667h@2x.png
│ │ │ ├── Default-736h@3x.png
│ │ │ ├── Default-Landscape-X.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Landscape@3x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ └── Default@2x.png
│ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ └── LaunchScreen.Center.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-Center.png
│ │ │ └── LaunchScreen-Center@2x.png
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── build.xcconfig
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── app-routing.module.ts
├── app.component.html
├── app.component.ts
├── app.css
├── app.module.ngfactory.d.ts
├── app.module.ts
├── home
│ ├── home-routing.module.ts
│ ├── home.component.html
│ ├── home.component.ts
│ └── home.module.ts
├── main.aot.ts
├── main.ts
├── package.json
├── tools
│ └── assets
│ │ ├── appTemplate-android.png
│ │ ├── appTemplate-ios.png
│ │ ├── marketplace.png
│ │ ├── thumbnail.png
│ │ └── thumbnail.svg
├── vendor-platform.android.ts
├── vendor-platform.ios.ts
└── vendor.ts
├── lib
├── index.ts
├── package.json
└── src
│ ├── index.ts
│ ├── public_api.ts
│ ├── slide
│ ├── slide.component.html
│ └── slide.component.ts
│ ├── slides.module.ts
│ └── slides
│ ├── slides.component.html
│ └── slides.component.ts
├── package-lock.json
├── package.json
├── references.d.ts
├── tsconfig.json
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # see http://help.github.com/ignore-files/ for more about ignoring files.
2 | ### WEB
3 | # compiled output
4 | dist
5 |
6 | # IDE - VsCode
7 | .vscode/*
8 | !.vscode/settings.json
9 | !.vscode/tasks.json
10 | !.vscode/launch.json
11 | !.vscode/extensions.json
12 |
13 | # misc
14 | /.sass-cache
15 | /connect.lock
16 | /coverage
17 | /libpeerconnection.log
18 | npm-debug.log
19 | testem.log
20 | /typings
21 |
22 |
23 | # system Files
24 | .Ds_store
25 | Thumbs.db
26 |
27 | node_modules
28 |
29 | platforms
30 |
31 | /**/*.js
32 | !/webpack.config.js
33 | /**/*.js.map
34 | /**/*.log
35 | /**/*.nsbuildinfo
36 | /platforms
37 | /node_modules
38 | /report
39 | !/**/*.worker.js
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | demo/
2 | slides/app/App_Resources
3 | slides/hooks
4 | slides/libs
5 | slides/node_modules
6 | slides/platforms
7 |
8 | *.png
9 | *.log
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Launch on iOS Device",
6 | "type": "nativescript",
7 | "platform": "ios",
8 | "request": "launch",
9 | "appRoot": "${workspaceRoot}",
10 | "sourceMaps": true,
11 | "diagnosticLogging": false,
12 | "emulator": false
13 | },
14 | {
15 | "name": "Attach on iOS Device",
16 | "type": "nativescript",
17 | "platform": "ios",
18 | "request": "attach",
19 | "appRoot": "${workspaceRoot}",
20 | "sourceMaps": true,
21 | "diagnosticLogging": false,
22 | "emulator": false
23 | },
24 | {
25 | "name": "Launch on iOS Emulator",
26 | "type": "nativescript",
27 | "platform": "ios",
28 | "request": "launch",
29 | "appRoot": "${workspaceRoot}",
30 | "sourceMaps": true,
31 | "diagnosticLogging": false,
32 | "emulator": true
33 | },
34 | {
35 | "name": "Attach on iOS Emulator",
36 | "type": "nativescript",
37 | "platform": "ios",
38 | "request": "attach",
39 | "appRoot": "${workspaceRoot}",
40 | "sourceMaps": true,
41 | "diagnosticLogging": false,
42 | "emulator": true
43 | },
44 | {
45 | "name": "Launch on Android Device",
46 | "type": "nativescript",
47 | "platform": "android",
48 | "request": "launch",
49 | "appRoot": "${workspaceRoot}",
50 | "sourceMaps": true,
51 | "diagnosticLogging": false,
52 | "emulator": false
53 | },
54 | {
55 | "name": "Launch on Android Emulator",
56 | "type": "nativescript",
57 | "platform": "android",
58 | "request": "launch",
59 | "appRoot": "${workspaceRoot}",
60 | "sourceMaps": true,
61 | "diagnosticLogging": false,
62 | "emulator": true
63 | },
64 | {
65 | "name": "Attach on Android Device",
66 | "type": "nativescript",
67 | "platform": "android",
68 | "request": "attach",
69 | "appRoot": "${workspaceRoot}",
70 | "sourceMaps": false,
71 | "diagnosticLogging": false,
72 | "emulator": false
73 | },
74 | {
75 | "name": "Attach on Android Emulator",
76 | "type": "nativescript",
77 | "platform": "android",
78 | "request": "attach",
79 | "appRoot": "${workspaceRoot}",
80 | "sourceMaps": false,
81 | "diagnosticLogging": false,
82 | "emulator": true
83 | }
84 | ]
85 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "./node_modules/typescript/lib",
3 | "editor.tabSize": 4,
4 | "editor.formatOnType": true,
5 | "files.exclude": {
6 | "**/.git": true,
7 | "**/.DS_Store": true,
8 | "**/dist/": false,
9 | "**/debug/": true,
10 | "**/release/": true,
11 | "**/tests/": true,
12 | "**/*.js": true,
13 | "**/*.js.map": true,
14 | "**/*.d.ts": true,
15 | "**/*.metadata.json": true
16 | }
17 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | nativescript-slides
4 | Copyright (c) 2016, Josh Sommer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of
7 | this software and associated documentation files (the "Software"), to deal in
8 | the Software without restriction, including without limitation the rights to
9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10 | the Software, and to permit persons to whom the Software is furnished to do so,
11 | subject to the following conditions:
12 |
13 | This software may not be used for any type of Multi Level Marketing, Network
14 | Marketing or any other type of pyramid schemes application, or application
15 | associated with a business with this type of business model, without express written
16 | consent from its author.
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
23 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
24 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NativeScript + Angular Slides for iOS and Android
2 |
3 | [![NPM version][npm-image]][npm-url]
4 | [![Downloads][downloads-image]][npm-url]
5 | [![Twitter Follow][twitter-image]][twitter-url]
6 |
7 | [npm-image]: http://img.shields.io/npm/v/nativescript-ngx-slides.svg
8 | [npm-url]: https://npmjs.org/package/nativescript-ngx-slides
9 | [downloads-image]: http://img.shields.io/npm/dt/nativescript-ngx-slides.svg
10 | [twitter-image]: https://img.shields.io/twitter/follow/_joshsommer.svg?style=social&label=Josh%20Sommer
11 | [twitter-url]: https://twitter.com/_joshsommer
12 |
13 | ### Intro slides example:
14 |
15 | [](https://www.youtube.com/embed/kGby8qtSDjM)
16 |
17 | ### Image carousel example:
18 |
19 | [](https://www.youtube.com/embed/RsEqGAKm62k)
20 |
21 | _videos are from the NativeScript Slides plugin. all features may not be implemented yet._
22 |
23 | _videos by [Brad Martin](https://github.com/bradmartin)_
24 |
25 | ## Example Usage:
26 |
27 | ```ts
28 | import { SlidesModule } from "nativescript-ngx-slides";
29 |
30 | import { AppComponent } from "./app.component";
31 |
32 | @NgModule({
33 | declarations: [AppComponent],
34 | bootstrap: [AppComponent],
35 | imports: [NativeScriptModule, SlidesModule],
36 | schemas: [NO_ERRORS_SCHEMA]
37 | })
38 | export class AppModule {}
39 | ```
40 |
41 | ### XML
42 |
43 | ```xml
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | ```
62 |
63 | ### CSS
64 |
65 | place this in the app.css file in the root of your project.
66 |
67 | ```css
68 | .slide-1 {
69 | background-color: darkslateblue;
70 | }
71 |
72 | .slide-2 {
73 | background-color: darkcyan;
74 | }
75 | .slide-3 {
76 | background-color: darkgreen;
77 | }
78 |
79 | .slide-4 {
80 | background-color: darkgoldenrod;
81 | }
82 | .slide-5 {
83 | background-color: darkslategray;
84 | }
85 | label {
86 | text-align: center;
87 | width: 100%;
88 | font-size: 35;
89 | margin-top: 35;
90 | color: #fff;
91 | }
92 | ```
93 |
94 | Great for Intros/Tutorials to Image Carousels.
95 |
96 | This very much a work in progress. Please feel free to contribute.
97 |
98 | ### Attributes for SlideContainer
99 |
100 | - **loop : boolean** - If true will cause the slide to be an endless loop. The suggested use case would be for a Image Carousel or something of that nature.
101 |
102 | - **pageIndicators : boolean** - If true adds indicator dots to the bottom of your slides.
103 |
104 | - **swipeSpeed : number** - Determines the speed of swipe. The bigger `swipeSpeed` property is, the faster you swipe the slides. Default value is 3. Try changing it to 15 to see the result.
105 |
106 | #### Indicators
107 |
108 | If the property `pageIndicators` is `true` you won't see the page indicators anymore as of 2.0.0 right away. there are two css classes exposed that you can setup however you like for active and inactive indicators. below is an example for semi translucent dots.
109 |
110 | ```css
111 | .slide-indicator-inactive {
112 | background-color: #fff;
113 | opacity: 0.4;
114 | width: 10;
115 | height: 10;
116 | margin-left: 2.5;
117 | margin-right: 2.5;
118 | margin-top: 0;
119 | border-radius: 5;
120 | }
121 |
122 | .slide-indicator-active {
123 | background-color: #fff;
124 | opacity: 0.9;
125 | width: 10;
126 | height: 10;
127 | margin-left: 2.5;
128 | margin-right: 2.5;
129 | margin-top: 0;
130 | border-radius: 5;
131 | }
132 | ```
133 |
134 | #### Plugin Development Work Flow:
135 |
136 | - Clone repository to your machine.
137 | - Run `npm install` to prepare the project
138 | - Run and deploy to your device or emulator with `npm run android` or `npm run ios`
139 | - Build a ngPackagr version with `npm run build`
140 |
141 | #### Known issues
142 |
143 | - Does not work well inside of ScrollView or TabViews.
144 |
145 | ## Contributors
146 |
147 | | [
](https://github.com/TheOriginalJosh) | [
](https://github.com/dobjek) | [
](https://github.com/EddyVerbruggen) | [
](https://github.com/vahidvdn) | [
](https://github.com/codeback) |
148 | | :-------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
149 | | [Josh Sommer](https://github.com/TheOriginalJosh) | [dobjek](https://github.com/dobjek) | [Eddy Verbruggen](https://github.com/EddyVerbruggen) | [Vahid Najafi](https://github.com/vahidvdn) | [Codeback Software](https://github.com/codeback) |
150 |
151 | ## Contributing guidelines
152 |
153 | [Contributing guidelines](https://github.com/TheOriginalJosh/nativescript-swiss-army-knife/blob/master/CONTRIBUTING.md)
154 |
155 | ## License
156 |
157 | [MIT](/LICENSE)
158 |
159 | for {N} version 2.0.0+
160 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.nativescript.nativescriptpackagr"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/Android/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
18 |
20 |
21 |
22 |
29 |
30 |
32 |
33 |
34 |
39 |
40 |
42 |
43 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "60x60",
35 | "idiom" : "iphone",
36 | "filename" : "icon-60@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "icon-60@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "29x29",
47 | "idiom" : "ipad",
48 | "filename" : "icon-29.png",
49 | "scale" : "1x"
50 | },
51 | {
52 | "size" : "29x29",
53 | "idiom" : "ipad",
54 | "filename" : "icon-29@2x.png",
55 | "scale" : "2x"
56 | },
57 | {
58 | "size" : "40x40",
59 | "idiom" : "ipad",
60 | "filename" : "icon-40.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "40x40",
65 | "idiom" : "ipad",
66 | "filename" : "icon-40@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "76x76",
71 | "idiom" : "ipad",
72 | "filename" : "icon-76.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "76x76",
77 | "idiom" : "ipad",
78 | "filename" : "icon-76@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "83.5x83.5",
83 | "idiom" : "ipad",
84 | "filename" : "icon-83.5@2x.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "size" : "1024x1024",
89 | "idiom" : "ios-marketing",
90 | "filename" : "icon-1024.png",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2436h",
7 | "filename" : "Default-1125h.png",
8 | "minimum-system-version" : "11.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "orientation" : "landscape",
14 | "idiom" : "iphone",
15 | "extent" : "full-screen",
16 | "filename" : "Default-Landscape-X.png",
17 | "minimum-system-version" : "11.0",
18 | "subtype" : "2436h",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "736h",
25 | "filename" : "Default-736h@3x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "3x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "736h",
34 | "filename" : "Default-Landscape@3x.png",
35 | "minimum-system-version" : "8.0",
36 | "orientation" : "landscape",
37 | "scale" : "3x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "667h",
43 | "filename" : "Default-667h@2x.png",
44 | "minimum-system-version" : "8.0",
45 | "orientation" : "portrait",
46 | "scale" : "2x"
47 | },
48 | {
49 | "orientation" : "portrait",
50 | "idiom" : "iphone",
51 | "filename" : "Default@2x.png",
52 | "extent" : "full-screen",
53 | "minimum-system-version" : "7.0",
54 | "scale" : "2x"
55 | },
56 | {
57 | "extent" : "full-screen",
58 | "idiom" : "iphone",
59 | "subtype" : "retina4",
60 | "filename" : "Default-568h@2x.png",
61 | "minimum-system-version" : "7.0",
62 | "orientation" : "portrait",
63 | "scale" : "2x"
64 | },
65 | {
66 | "orientation" : "portrait",
67 | "idiom" : "ipad",
68 | "filename" : "Default-Portrait.png",
69 | "extent" : "full-screen",
70 | "minimum-system-version" : "7.0",
71 | "scale" : "1x"
72 | },
73 | {
74 | "orientation" : "landscape",
75 | "idiom" : "ipad",
76 | "filename" : "Default-Landscape.png",
77 | "extent" : "full-screen",
78 | "minimum-system-version" : "7.0",
79 | "scale" : "1x"
80 | },
81 | {
82 | "orientation" : "portrait",
83 | "idiom" : "ipad",
84 | "filename" : "Default-Portrait@2x.png",
85 | "extent" : "full-screen",
86 | "minimum-system-version" : "7.0",
87 | "scale" : "2x"
88 | },
89 | {
90 | "orientation" : "landscape",
91 | "idiom" : "ipad",
92 | "filename" : "Default-Landscape@2x.png",
93 | "extent" : "full-screen",
94 | "minimum-system-version" : "7.0",
95 | "scale" : "2x"
96 | },
97 | {
98 | "orientation" : "portrait",
99 | "idiom" : "iphone",
100 | "filename" : "Default.png",
101 | "extent" : "full-screen",
102 | "scale" : "1x"
103 | },
104 | {
105 | "orientation" : "portrait",
106 | "idiom" : "iphone",
107 | "filename" : "Default@2x.png",
108 | "extent" : "full-screen",
109 | "scale" : "2x"
110 | },
111 | {
112 | "orientation" : "portrait",
113 | "idiom" : "iphone",
114 | "filename" : "Default-568h@2x.png",
115 | "extent" : "full-screen",
116 | "subtype" : "retina4",
117 | "scale" : "2x"
118 | },
119 | {
120 | "orientation" : "portrait",
121 | "idiom" : "ipad",
122 | "extent" : "to-status-bar",
123 | "scale" : "1x"
124 | },
125 | {
126 | "orientation" : "portrait",
127 | "idiom" : "ipad",
128 | "filename" : "Default-Portrait.png",
129 | "extent" : "full-screen",
130 | "scale" : "1x"
131 | },
132 | {
133 | "orientation" : "landscape",
134 | "idiom" : "ipad",
135 | "extent" : "to-status-bar",
136 | "scale" : "1x"
137 | },
138 | {
139 | "orientation" : "landscape",
140 | "idiom" : "ipad",
141 | "filename" : "Default-Landscape.png",
142 | "extent" : "full-screen",
143 | "scale" : "1x"
144 | },
145 | {
146 | "orientation" : "portrait",
147 | "idiom" : "ipad",
148 | "extent" : "to-status-bar",
149 | "scale" : "2x"
150 | },
151 | {
152 | "orientation" : "portrait",
153 | "idiom" : "ipad",
154 | "filename" : "Default-Portrait@2x.png",
155 | "extent" : "full-screen",
156 | "scale" : "2x"
157 | },
158 | {
159 | "orientation" : "landscape",
160 | "idiom" : "ipad",
161 | "extent" : "to-status-bar",
162 | "scale" : "2x"
163 | },
164 | {
165 | "orientation" : "landscape",
166 | "idiom" : "ipad",
167 | "filename" : "Default-Landscape@2x.png",
168 | "extent" : "full-screen",
169 | "scale" : "2x"
170 | }
171 | ],
172 | "info" : {
173 | "version" : 1,
174 | "author" : "xcode"
175 | }
176 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with XCode 8 you need to specify your development team.
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/app/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # NativeScript Community Code of Conduct
2 |
3 | Our community members come from all walks of life and are all at different stages of their personal and professional journeys. To support everyone, we've prepared a short code of conduct. Our mission is best served in an environment that is friendly, safe, and accepting; free from intimidation or harassment.
4 |
5 | Towards this end, certain behaviors and practices will not be tolerated.
6 |
7 | ## tl;dr
8 |
9 | - Be respectful.
10 | - We're here to help.
11 | - Abusive behavior is never tolerated.
12 | - Violations of this code may result in swift and permanent expulsion from the NativeScript community channels.
13 |
14 | ## Administrators
15 |
16 | - Dan Wilson (@DanWilson on Slack)
17 | - Jen Looper (@jen.looper on Slack)
18 | - TJ VanToll (@tjvantoll on Slack)
19 |
20 | ## Scope
21 |
22 | We expect all members of the NativeScript community, including administrators, users, facilitators, and vendors to abide by this Code of Conduct at all times in our community venues, online and in person, and in one-on-one communications pertaining to NativeScript affairs.
23 |
24 | This policy covers the usage of the NativeScript Slack community, as well as the NativeScript support forums, NativeScript GitHub repositories, the NativeScript website, and any NativeScript-related events. This Code of Conduct is in addition to, and does not in any way nullify or invalidate, any other terms or conditions related to use of NativeScript.
25 |
26 | The definitions of various subjective terms such as "discriminatory", "hateful", or "confusing" will be decided at the sole discretion of the NativeScript administrators.
27 |
28 | ## Friendly, Harassment-Free Space
29 |
30 | We are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics.
31 |
32 | We ask that you please respect that people have differences of opinion regarding technical choices, and acknowledge that every design or implementation choice carries a trade-off and numerous costs. There is seldom a single right answer. A difference of technology preferences is never a license to be rude.
33 |
34 | Any spamming, trolling, flaming, baiting, or other attention-stealing behaviour is not welcome, and will not be tolerated.
35 |
36 | Harassing other users of NativeScript is never tolerated, whether via public or private media.
37 |
38 | Avoid using offensive or harassing package names, nicknames, or other identifiers that might detract from a friendly, safe, and welcoming environment for all.
39 |
40 | Harassment includes, but is not limited to: harmful or prejudicial verbal or written comments related to gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics; inappropriate use of nudity, sexual images, and/or sexually explicit language in public spaces; threats of physical or non-physical harm; deliberate intimidation, stalking or following; harassing photography or recording; sustained disruption of talks or other events; inappropriate physical contact; and unwelcome sexual attention.
41 |
42 | ## Acceptable Content
43 |
44 | The NativeScript administrators reserve the right to make judgement calls about what is and isn't appropriate in published content. These are guidelines to help you be successful in our community.
45 |
46 | Content must contain something applicable to the previously stated goals of the NativeScript community. "Spamming", that is, publishing any form of content that is not applicable, is not allowed.
47 |
48 | Content must not contain illegal or infringing content. You should only publish content to NativeScript properties if you have the right to do so. This includes complying with all software license agreements or other intellectual property restrictions. For example, redistributing an MIT-licensed module with the copyright notice removed, would not be allowed. You will be responsible for any violation of laws or others’ intellectual property rights.
49 |
50 | Content must not be malware. For example, content (code, video, pictures, words, etc.) which is designed to maliciously exploit or damage computer systems, is not allowed.
51 |
52 | Content name, description, and other visible metadata must not include abusive, inappropriate, or harassing content.
53 |
54 | ## Reporting Violations of this Code of Conduct
55 |
56 | If you believe someone is harassing you or has otherwise violated this Code of Conduct, please contact the administrators and send us an abuse report. If this is the initial report of a problem, please include as much detail as possible. It is easiest for us to address issues when we have more context.
57 |
58 | ## Consequences
59 |
60 | All content published to the NativeScript community channels is hosted at the sole discretion of the NativeScript administrators.
61 |
62 | Unacceptable behavior from any community member, including sponsors, employees, customers, or others with decision-making authority, will not be tolerated.
63 |
64 | Anyone asked to stop unacceptable behavior is expected to comply immediately.
65 |
66 | If a community member engages in unacceptable behavior, the NativeScript administrators may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event or service).
67 |
68 | ## Addressing Grievances
69 |
70 | If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify the administrators. We will do our best to ensure that your grievance is handled appropriately.
71 |
72 | In general, we will choose the course of action that we judge as being most in the interest of fostering a safe and friendly community.
73 |
74 | ## Contact Info
75 | Please contact Dan Wilson @DanWilson if you need to report a problem or address a grievance related to an abuse report.
76 |
77 | You are also encouraged to contact us if you are curious about something that might be "on the line" between appropriate and inappropriate content. We are happy to provide guidance to help you be a successful part of our community.
78 |
79 | ## Credit and License
80 |
81 | This Code of Conduct borrows heavily from the WADE Code of Conduct, which is derived from the NodeBots Code of Conduct, which in turn borrows from the npm Code of Conduct, which was derived from the Stumptown Syndicate Citizen's Code of Conduct, and the Rust Project Code of Conduct.
82 |
83 | This document may be reused under a Creative Commons Attribution-ShareAlike License.
--------------------------------------------------------------------------------
/app/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright (c) 2015-2018 Telerik AD
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/app/README.md:
--------------------------------------------------------------------------------
1 | # NativeScript with Angular Blank Template
2 | App templates help you jump start your native cross-platform apps with built-in UI elements and best practices. Save time writing boilerplate code over and over again when you create new apps.
3 |
4 | ## Quick Start
5 | Execute the following command to create an app from this template:
6 |
7 | ```
8 | tns create my-blank-ng --template tns-template-blank-ng
9 | ```
10 |
11 | > Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm] (https://www.npmjs.com/package/tns-template-blank-ng).
12 |
13 | If you want to create a new app that uses the source of the template from the `master` branch, you can execute the following:
14 |
15 | ```
16 | tns create my-blank-ng --template https://github.com/NativeScript/template-blank-ng
17 | ```
18 |
19 | **NB:** Please, have in mind that the master branch may refer to dependencies that are not on NPM yet!
20 |
21 | ## Walkthrough
22 |
23 | ### Architecture
24 | The application component:
25 | - `app.component.ts` - sets up a page router outlet that lets you navigate between pages.
26 |
27 | There is a single blank component that sets up an empty page layout:
28 | - `/home`
29 |
30 | **Home** page has the following components:
31 | - `ActionBar` - It holds the title of the page.
32 | - `GridLayout` - The main page layout that should contains all the page content.
33 |
34 | ## Get Help
35 | The NativeScript framework has a vibrant community that can help when you run into problems.
36 |
37 | Try [joining the NativeScript community Slack](http://developer.telerik.com/wp-login.php?action=slack-invitation). The Slack channel is a great place to get help troubleshooting problems, as well as connect with other NativeScript developers.
38 |
39 | If you have found an issue with this template, please report the problem in the [Issues](https://github.com/NativeScript/template-blank-ng/issues).
40 |
41 | ## Contributing
42 |
43 | We love PRs, and accept them gladly. Feel free to propose changes and new ideas. We will review and discuss, so that they can be accepted and better integrated.
44 |
--------------------------------------------------------------------------------
/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { Routes } from "@angular/router";
3 | import { NativeScriptRouterModule } from "nativescript-angular/router";
4 |
5 | const routes: Routes = [
6 | { path: "", redirectTo: "/home", pathMatch: "full" },
7 | { path: "home", loadChildren: "./home/home.module#HomeModule" }
8 | ];
9 |
10 | @NgModule({
11 | imports: [NativeScriptRouterModule.forRoot(routes)],
12 | exports: [NativeScriptRouterModule]
13 | })
14 | export class AppRoutingModule { }
15 |
--------------------------------------------------------------------------------
/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 |
3 | @Component({
4 | selector: "ns-app",
5 | templateUrl: "app.component.html"
6 | })
7 | export class AppComponent { }
8 |
--------------------------------------------------------------------------------
/app/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.css file is where you place CSS rules that
3 | you would like to apply to your entire application. Check out
4 | http://docs.nativescript.org/ui/styling for a full list of the CSS
5 | selectors and properties you can use to style UI components.
6 |
7 | /*
8 | In many cases you may want to use the NativeScript core theme instead
9 | of writing your own CSS rules. For a full list of class names in the theme
10 | refer to http://docs.nativescript.org/ui/theme.
11 | */
12 | @import '~nativescript-theme-core/css/core.light.css';
13 |
14 | /*
15 | For example, the following CSS rule changes the font size of all UI
16 | components that have the btn class name.
17 | */
18 | .btn {
19 | font-size: 18;
20 | }
21 | .slide-1{
22 | background-color: #448AFF;
23 | }
24 |
25 | .slide-2{
26 | background-color: #F44336;
27 | }
28 | .slide-3{
29 | background-color: #8BC34A;
30 | }
31 |
32 | .slide-4{
33 | background-color: #9C27B0;
34 | }
35 | .slide-5{
36 | background-color: #FFC107;
37 | }
38 |
39 | .slide-6{
40 | background-color: #448AFF;
41 | }
42 |
43 | .slide-7{
44 | background-color: #F44336;
45 | }
46 | .slide-8{
47 | background-color: #8BC34A;
48 | }
49 |
50 | .slide-9{
51 | background-color: #9C27B0;
52 | }
53 | .slide-10{
54 | background-color: #FFC107;
55 | }
56 |
57 |
58 | .slide-indicator-inactive{
59 | background-color: #fff;
60 | opacity : 0.4;
61 | width : 10;
62 | height : 10;
63 | margin-left : 2.5;
64 | margin-right : 2.5;
65 | margin-top : 0;
66 | border-radius : 5;
67 | }
68 |
69 | .slide-indicator-active{
70 | background-color: #fff;
71 | opacity : 0.9;
72 | width : 10;
73 | height : 10;
74 | margin-left : 2.5;
75 | margin-right : 2.5;
76 | margin-top : 0;
77 | border-radius : 5;
78 | }
--------------------------------------------------------------------------------
/app/app.module.ngfactory.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * A dynamically generated module when compiled with AoT.
3 | */
4 | export const AppModuleNgFactory: any;
5 |
--------------------------------------------------------------------------------
/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptModule } from "nativescript-angular/nativescript.module";
3 |
4 | import { AppRoutingModule } from "./app-routing.module";
5 | import { AppComponent } from "./app.component";
6 |
7 |
8 | @NgModule({
9 | bootstrap: [
10 | AppComponent
11 | ],
12 | imports: [
13 | NativeScriptModule,
14 | AppRoutingModule,
15 | ],
16 | declarations: [
17 | AppComponent,
18 | ],
19 | schemas: [
20 | NO_ERRORS_SCHEMA
21 | ]
22 | })
23 | export class AppModule { }
24 |
--------------------------------------------------------------------------------
/app/home/home-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { Routes } from "@angular/router";
3 | import { NativeScriptRouterModule } from "nativescript-angular/router";
4 |
5 | import { HomeComponent } from "./home.component";
6 |
7 | const routes: Routes = [
8 | { path: "", component: HomeComponent }
9 | ];
10 |
11 | @NgModule({
12 | imports: [NativeScriptRouterModule.forChild(routes)],
13 | exports: [NativeScriptRouterModule]
14 | })
15 | export class HomeRoutingModule { }
16 |
--------------------------------------------------------------------------------
/app/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from "@angular/core";
2 |
3 | @Component({
4 | selector: "Home",
5 | moduleId: module.id,
6 | templateUrl: "./home.component.html"
7 | })
8 | export class HomeComponent implements OnInit {
9 |
10 | constructor() {
11 | // Use the component constructor to inject providers.
12 | }
13 |
14 | ngOnInit(): void {
15 | // Init your component properties here.
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/home/home.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2 | import { NativeScriptCommonModule } from "nativescript-angular/common";
3 |
4 | import { HomeRoutingModule } from "./home-routing.module";
5 | import { HomeComponent } from "./home.component";
6 | import { SlidesModule } from "nativescript-ngx-slides";
7 |
8 | @NgModule({
9 | imports: [NativeScriptCommonModule, HomeRoutingModule, SlidesModule],
10 | declarations: [HomeComponent],
11 | schemas: [NO_ERRORS_SCHEMA]
12 | })
13 | export class HomeModule {}
14 |
--------------------------------------------------------------------------------
/app/main.aot.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScript } from "nativescript-angular/platform-static";
3 |
4 | import { AppModuleNgFactory } from "./app.module.ngfactory";
5 |
6 | platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);
7 |
--------------------------------------------------------------------------------
/app/main.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScriptDynamic } from "nativescript-angular/platform";
3 |
4 | import { AppModule } from "./app.module";
5 |
6 | platformNativeScriptDynamic().bootstrapModule(AppModule);
7 |
--------------------------------------------------------------------------------
/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "android": {
3 | "v8Flags": "--expose_gc"
4 | },
5 | "main": "main.js",
6 | "name": "tns-template-blank-ng",
7 | "version": "4.0.0"
8 | }
--------------------------------------------------------------------------------
/app/tools/assets/appTemplate-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/tools/assets/appTemplate-android.png
--------------------------------------------------------------------------------
/app/tools/assets/appTemplate-ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/tools/assets/appTemplate-ios.png
--------------------------------------------------------------------------------
/app/tools/assets/marketplace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/tools/assets/marketplace.png
--------------------------------------------------------------------------------
/app/tools/assets/thumbnail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoshDSommer/nativescript-ngx-slides/e30909991aab65c7bda72059ca073314123aeb60/app/tools/assets/thumbnail.png
--------------------------------------------------------------------------------
/app/tools/assets/thumbnail.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/vendor-platform.android.ts:
--------------------------------------------------------------------------------
1 | require("application");
2 | if (!global["__snapshot"]) {
3 | // In case snapshot generation is enabled these modules will get into the bundle
4 | // but will not be required/evaluated.
5 | // The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
6 | // This way, they will be evaluated on app start as early as possible.
7 | require("ui/frame");
8 | require("ui/frame/activity");
9 | }
10 |
--------------------------------------------------------------------------------
/app/vendor-platform.ios.ts:
--------------------------------------------------------------------------------
1 | // There is a bug in angular: https://github.com/angular/angular-cli/pull/8589/files
2 | // Legendary stuff, its webpack plugin pretty much doesn't work with empty TypeScript files in v1.8.3
3 | void 0;
4 |
--------------------------------------------------------------------------------
/app/vendor.ts:
--------------------------------------------------------------------------------
1 | // Snapshot the ~/app.css and the theme
2 | const application = require("application");
3 | require("ui/styling/style-scope");
4 | const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/);
5 | global.registerWebpackModules(appCssContext);
6 | application.loadAppCss();
7 |
8 | require("./vendor-platform");
9 |
10 | require("reflect-metadata");
11 | require("@angular/platform-browser");
12 | require("@angular/core");
13 | require("@angular/common");
14 | require("@angular/forms");
15 | require("@angular/http");
16 | require("@angular/router");
17 |
18 | require("nativescript-angular/platform-static");
19 | require("nativescript-angular/forms");
20 | require("nativescript-angular/router");
21 |
--------------------------------------------------------------------------------
/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./src/public_api";
2 |
--------------------------------------------------------------------------------
/lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-ngx-slides",
3 | "version": "6.1.0",
4 | "description": "NativeScript + Angular version of the slides",
5 | "repository": {
6 | "type": "git",
7 | "url": "https://github.com/TheOriginalJosh/nativescript-ngx-slides"
8 | },
9 | "nativescript": {
10 | "platforms": {
11 | "android": "4.0.1",
12 | "ios": "4.0.1"
13 | }
14 | },
15 | "author": "Josh Sommer (https://twitter.com/_JoshSommer)",
16 | "license": "MIT",
17 | "private": false,
18 | "peerDependencies": {
19 | "@angular/core": ">=6.0.0",
20 | "@angular/common": ">=6.0.0"
21 | },
22 | "ngPackage": {
23 | "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
24 | "lib": {
25 | "entryFile": "src/public_api.ts"
26 | },
27 | "dest": "../dist/"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/src/index.ts:
--------------------------------------------------------------------------------
1 | export { SlidesModule } from './slides.module';
2 | export * from './slide/slide.component';
3 | export * from './slides/slides.component';
--------------------------------------------------------------------------------
/lib/src/public_api.ts:
--------------------------------------------------------------------------------
1 | export * from './slides.module';
--------------------------------------------------------------------------------
/lib/src/slide/slide.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/lib/src/slide/slide.component.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Component,
3 | Input,
4 | ViewChild,
5 | ElementRef,
6 | Output,
7 | EventEmitter,
8 | ViewEncapsulation
9 | } from "@angular/core";
10 | import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
11 | import * as gestures from "tns-core-modules/ui/gestures";
12 |
13 | @Component({
14 | selector: "slide",
15 | moduleId: module.id,
16 | templateUrl: "./slide.component.html",
17 | encapsulation: ViewEncapsulation.None
18 | })
19 | export class SlideComponent {
20 | @ViewChild("slideLayout") slideLayout: ElementRef;
21 | @Input("class") cssClass: string = "";
22 | @Output("tap") tap = new EventEmitter();
23 | @Output("doubleTap")
24 | doubleTap = new EventEmitter();
25 | @Output("pinch") pinch = new EventEmitter();
26 |
27 | set slideWidth(width: number) {
28 | this.layout.width = width;
29 | }
30 |
31 | set slideHeight(height: number | string) {
32 | this.layout.height = height;
33 | }
34 |
35 | get layout(): StackLayout {
36 | return this.slideLayout.nativeElement;
37 | }
38 |
39 | constructor() {
40 | this.cssClass = this.cssClass ? this.cssClass : "";
41 | }
42 |
43 | ngOnInit() {}
44 |
45 | ngAfterViewInit() {
46 | this.slideLayout.nativeElement.on(
47 | "tap",
48 | (args: gestures.GestureEventData): void => {
49 | this.tap.next(args);
50 | }
51 | );
52 |
53 | this.slideLayout.nativeElement.on(
54 | "doubleTap",
55 | (args: gestures.GestureEventData): void => {
56 | this.doubleTap.next(args);
57 | }
58 | );
59 |
60 | this.slideLayout.nativeElement.on(
61 | "pinch",
62 | (args: gestures.GestureEventData): void => {
63 | this.pinch.next(args);
64 | }
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/src/slides.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 |
4 | import { SlidesComponent } from './slides/slides.component';
5 | import { SlideComponent } from './slide/slide.component';
6 |
7 | export { SlidesComponent } from './slides/slides.component';
8 | export { SlideComponent } from './slide/slide.component';
9 |
10 | @NgModule({
11 | imports: [CommonModule],
12 | exports: [SlideComponent, SlidesComponent],
13 | declarations: [SlidesComponent, SlideComponent],
14 | providers: [],
15 | schemas: [
16 | NO_ERRORS_SCHEMA
17 | ]
18 | })
19 | export class SlidesModule { }
20 |
--------------------------------------------------------------------------------
/lib/src/slides/slides.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/lib/src/slides/slides.component.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Component,
3 | OnInit,
4 | AfterViewInit,
5 | ViewEncapsulation,
6 | ChangeDetectorRef,
7 | OnDestroy,
8 | forwardRef,
9 | ViewChild,
10 | ContentChildren,
11 | ElementRef,
12 | QueryList,
13 | Input,
14 | Output,
15 | EventEmitter
16 | } from "@angular/core";
17 |
18 | import { SlideComponent } from "../slide/slide.component";
19 | import * as gestures from "tns-core-modules/ui/gestures";
20 | import * as platform from "tns-core-modules/platform";
21 | import * as AnimationModule from "tns-core-modules/ui/animation";
22 | import { AnimationCurve } from "tns-core-modules/ui/enums";
23 | import * as app from "tns-core-modules/application";
24 | import { AbsoluteLayout } from "tns-core-modules/ui/layouts/absolute-layout";
25 | import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
26 |
27 | export interface IIndicators {
28 | active: boolean;
29 | }
30 |
31 | export interface ISlideMap {
32 | slide: SlideComponent;
33 | index: number;
34 | left?: ISlideMap;
35 | right?: ISlideMap;
36 | }
37 |
38 | enum direction {
39 | none,
40 | left,
41 | right
42 | }
43 |
44 | enum cancellationReason {
45 | user,
46 | noPrevSlides,
47 | noMoreSlides
48 | }
49 |
50 | @Component({
51 | selector: "slides",
52 | templateUrl: "./slides.component.html",
53 | moduleId: module.id,
54 | encapsulation: ViewEncapsulation.None
55 | })
56 | export class SlidesComponent implements OnInit, AfterViewInit, OnDestroy {
57 | @ContentChildren(forwardRef(() => SlideComponent))
58 | slides: QueryList;
59 | @ViewChild("footer") footer: ElementRef;
60 | @Input("pageWidth") pageWidth: number;
61 | @Input("pageHeight") pageHeight: number;
62 | @Input("footerMarginTop") footerMarginTop: number;
63 | @Input("loop") loop: boolean;
64 | @Input("pageIndicators") pageIndicators: boolean;
65 | @Input("swipeSpeed") swipeSpeed: number;
66 | @Input("class") cssClass: string = "";
67 | @Input() zoomEnabled = false;
68 | @Input("autoInit") autoInit: boolean = true;
69 | @Output() changed: EventEmitter = new EventEmitter();
70 | @Output() finished: EventEmitter = new EventEmitter();
71 | @Output("tap")
72 | tap: EventEmitter = new EventEmitter<
73 | gestures.GestureEventData
74 | >();
75 |
76 | /** If auto init is turned off this flag indicates when the slides are ready to be rendered */
77 | private manualInitTriggered: boolean = false;
78 | private transitioning: boolean;
79 | private direction: direction = direction.none;
80 | private FOOTER_HEIGHT: number = 50;
81 |
82 | indicators: IIndicators[];
83 | currentSlide: ISlideMap;
84 | _slideMap: ISlideMap[];
85 |
86 | currentScale = 1;
87 | currentDeltaX = 0;
88 | currentDeltaY = 0;
89 |
90 | get hasNext(): boolean {
91 | return !!this.currentSlide && !!this.currentSlide.right;
92 | }
93 | get hasPrevious(): boolean {
94 | return !!this.currentSlide && !!this.currentSlide.left;
95 | }
96 |
97 | constructor(private ref: ChangeDetectorRef) {
98 | this.indicators = [];
99 | }
100 |
101 | ngOnInit() {
102 | this.loop = this.loop ? this.loop : false;
103 | this.pageIndicators = this.pageIndicators ? this.pageIndicators : false;
104 | this.swipeSpeed = this.swipeSpeed ? this.swipeSpeed : 3;
105 | this.pageWidth = this.pageWidth
106 | ? this.pageWidth
107 | : platform.screen.mainScreen.widthDIPs;
108 | this.pageHeight = this.pageHeight
109 | ? this.pageHeight
110 | : platform.screen.mainScreen.heightDIPs;
111 | this.footerMarginTop = this.footerMarginTop
112 | ? this.footerMarginTop
113 | : this.calculateFoorterMarginTop(this.pageHeight);
114 | // handle orientation change
115 | app.on(app.orientationChangedEvent, this.onOrientationChanged, this);
116 | }
117 |
118 | ngAfterViewInit() {
119 | if (!this.manualInitTriggered) {
120 | this._init();
121 | }
122 | this.slides.changes.subscribe(() => {
123 | this._init();
124 | });
125 | }
126 |
127 | public init() {
128 | this.manualInitTriggered = true;
129 | }
130 |
131 | private _init() {
132 | if (
133 | this.slides === undefined ||
134 | this.slides === null ||
135 | this.slides.length == 0 ||
136 | (!this.manualInitTriggered && !this.autoInit)
137 | ) {
138 | return;
139 | }
140 |
141 | // loop through slides and setup height and width
142 | this.slides.forEach((slide: SlideComponent) => {
143 | AbsoluteLayout.setLeft(slide.layout, this.pageWidth);
144 | slide.slideWidth = this.pageWidth;
145 | slide.slideHeight = this.pageHeight;
146 | });
147 |
148 | this.currentSlide = this.buildSlideMap(this.slides.toArray());
149 |
150 | if (this.currentSlide) {
151 | this.positionSlides(this.currentSlide);
152 | this.applyGestures();
153 | }
154 |
155 | if (this.pageIndicators) {
156 | this.buildFooter(this.slides.length);
157 | this.setActivePageIndicator(0);
158 | }
159 | }
160 |
161 | ngOnDestroy() {
162 | app.off(app.orientationChangedEvent, this.onOrientationChanged, this);
163 | }
164 |
165 | onOrientationChanged(args: app.OrientationChangedEventData) {
166 | // event and page orientation didn't seem to always be on the same page so
167 | // setting it in the time out addresses this.
168 | setTimeout(() => {
169 | // the values are either 'landscape' or 'portrait'
170 | // platform.screen.mainScreen.heightDIPs/widthDIPs holds original screen size
171 | if (args.newValue === "landscape") {
172 | this.pageWidth = app.android
173 | ? platform.screen.mainScreen.heightDIPs
174 | : platform.screen.mainScreen.widthDIPs;
175 | this.pageHeight = app.android
176 | ? platform.screen.mainScreen.widthDIPs
177 | : platform.screen.mainScreen.heightDIPs;
178 | } else {
179 | this.pageWidth = platform.screen.mainScreen.widthDIPs;
180 | this.pageHeight = platform.screen.mainScreen.heightDIPs;
181 | }
182 |
183 | this.footerMarginTop = this.calculateFoorterMarginTop(this.pageHeight);
184 |
185 | // loop through slides and setup height and widith
186 | this.slides.forEach((slide: SlideComponent) => {
187 | AbsoluteLayout.setLeft(slide.layout, this.pageWidth);
188 | slide.slideWidth = this.pageWidth;
189 | slide.slideHeight = this.pageHeight;
190 | slide.layout.eachLayoutChild((view: any) => {
191 | if (view instanceof StackLayout) {
192 | AbsoluteLayout.setLeft(view, this.pageWidth);
193 | view.width = this.pageWidth;
194 | view.height = this.pageHeight;
195 | }
196 | });
197 | });
198 |
199 | if (this.currentSlide) {
200 | this.positionSlides(this.currentSlide);
201 | }
202 |
203 | if (this.pageIndicators) {
204 | this.buildFooter(this.slides.length);
205 | }
206 | }, 17); // one frame @ 60 frames/s, no flicker
207 | }
208 |
209 | setActivePageIndicator(activeIndex: number) {
210 | this.indicators.map((indicator: IIndicators, index: number) => {
211 | if (index === activeIndex) {
212 | indicator.active = true;
213 | } else {
214 | indicator.active = false;
215 | }
216 | });
217 |
218 | this.indicators = [...this.indicators];
219 | this.ref.detectChanges();
220 | }
221 |
222 | //
223 | // private functions
224 | //
225 |
226 | // position footer
227 | private calculateFoorterMarginTop(pageHeight: number): number {
228 | return pageHeight - pageHeight / 6;
229 | }
230 |
231 | // footer stuff
232 | private buildFooter(pageCount: number = 5): void {
233 | const footerSection = this.footer.nativeElement;
234 | footerSection.horizontalAlignment = "center";
235 | footerSection.orientation = "horizontal";
236 | footerSection.marginTop = this.footerMarginTop;
237 | footerSection.height = this.FOOTER_HEIGHT;
238 | footerSection.width = this.pageWidth;
239 |
240 | if (app.ios) {
241 | footerSection.clipToBounds = false;
242 | }
243 |
244 | let index = 0;
245 | this.indicators = [];
246 | while (index < pageCount) {
247 | this.indicators.push({ active: false });
248 | index++;
249 | }
250 | }
251 |
252 | private setupPanel(slide: ISlideMap) {
253 | this.direction = direction.none;
254 | this.transitioning = false;
255 | this.currentSlide.slide.layout.off("pan");
256 | this.currentSlide = slide;
257 |
258 | // sets up each slide so that they are positioned to transition either way.
259 | this.positionSlides(this.currentSlide);
260 |
261 | //if (this.disablePan === false) {
262 | this.applyGestures();
263 | //}
264 |
265 | if (this.pageIndicators) {
266 | this.setActivePageIndicator(this.currentSlide.index);
267 | }
268 |
269 | this.changed.next(this.currentSlide.index);
270 |
271 | if (this.currentSlide.index === this.slides.length - 1) {
272 | this.finished.next(null);
273 | }
274 | }
275 |
276 | private positionSlides(slide: ISlideMap) {
277 | // sets up each slide so that they are positioned to transition either way.
278 | if (slide.left != null && slide.left.slide != null) {
279 | slide.left.slide.layout.translateX = -this.pageWidth * 2;
280 | }
281 | slide.slide.layout.translateX = -this.pageWidth;
282 | if (slide.right != null && slide.right.slide != null) {
283 | slide.right.slide.layout.translateX = 0;
284 | }
285 | }
286 |
287 | private showRightSlide(
288 | slideMap: ISlideMap,
289 | offset: number = this.pageWidth,
290 | endingVelocity: number = 32,
291 | duration: number = 300
292 | ): AnimationModule.AnimationPromise {
293 | let animationDuration: number;
294 | animationDuration = duration; // default value
295 |
296 | let transition = new Array();
297 |
298 | transition.push({
299 | target: slideMap.right.slide.layout,
300 | translate: { x: -this.pageWidth, y: 0 },
301 | duration: animationDuration,
302 | curve: AnimationCurve.easeOut
303 | });
304 | transition.push({
305 | target: slideMap.slide.layout,
306 | translate: { x: -this.pageWidth * 2, y: 0 },
307 | duration: animationDuration,
308 | curve: AnimationCurve.easeOut
309 | });
310 | let animationSet = new AnimationModule.Animation(transition, false);
311 |
312 | return animationSet.play();
313 | }
314 |
315 | private showLeftSlide(
316 | slideMap: ISlideMap,
317 | offset: number = this.pageWidth,
318 | endingVelocity: number = 32,
319 | duration: number = 300
320 | ): AnimationModule.AnimationPromise {
321 | let animationDuration: number;
322 | animationDuration = duration; // default value
323 | let transition = new Array();
324 |
325 | transition.push({
326 | target: slideMap.left.slide.layout,
327 | translate: { x: -this.pageWidth, y: 0 },
328 | duration: animationDuration,
329 | curve: AnimationCurve.easeOut
330 | });
331 | transition.push({
332 | target: slideMap.slide.layout,
333 | translate: { x: 0, y: 0 },
334 | duration: animationDuration,
335 | curve: AnimationCurve.easeOut
336 | });
337 | let animationSet = new AnimationModule.Animation(transition, false);
338 |
339 | return animationSet.play();
340 | }
341 |
342 | public applyGestures(): void {
343 | this.currentSlide.slide.layout.on(
344 | "tap",
345 | (args: gestures.GestureEventData): void => this.tap.next(args)
346 | );
347 |
348 | this.currentSlide.slide.layout.on(
349 | "doubleTap",
350 | (args: gestures.GestureEventData): void => {
351 | if (this.zoomEnabled) {
352 | this.onDoubleTap(args);
353 | }
354 | }
355 | );
356 |
357 | this.currentSlide.slide.layout.on(
358 | "pinch",
359 | (args: gestures.PinchGestureEventData): void => {
360 | if (this.zoomEnabled) {
361 | this.onPinch(args);
362 | }
363 | }
364 | );
365 |
366 | this.currentSlide.slide.layout.on(
367 | "pan",
368 | (args: gestures.PanGestureEventData): void => {
369 | if (this.zoomEnabled && this.currentScale !== 1) {
370 | this.onPan(args);
371 | } else {
372 | this.onSwipe(args);
373 | }
374 | }
375 | );
376 | }
377 |
378 | public onSwipe(args: gestures.PanGestureEventData) {
379 | let previousDelta = -1; //hack to get around ios firing pan event after release
380 | let endingVelocity = 0;
381 | let startTime, deltaTime;
382 | this.transitioning = false;
383 |
384 | if (args.state === gestures.GestureStateTypes.began) {
385 | startTime = Date.now();
386 | previousDelta = 0;
387 | endingVelocity = 250;
388 |
389 | //this.triggerStartEvent();
390 | } else if (args.state === gestures.GestureStateTypes.ended) {
391 | deltaTime = Date.now() - startTime;
392 | // if velocityScrolling is enabled then calculate the velocitty
393 |
394 | // swiping left to right.
395 | if (args.deltaX > this.pageWidth / this.swipeSpeed) {
396 | if (this.hasPrevious) {
397 | this.transitioning = true;
398 | this.showLeftSlide(
399 | this.currentSlide,
400 | args.deltaX,
401 | endingVelocity
402 | ).then(() => {
403 | this.setupPanel(this.currentSlide.left);
404 |
405 | //this.triggerChangeEventLeftToRight();
406 | });
407 | } else {
408 | //We're at the start
409 | //Notify no more slides
410 | //this.triggerCancelEvent(cancellationReason.noPrevSlides);
411 | }
412 | return;
413 | }
414 | // swiping right to left
415 | else if (args.deltaX < -this.pageWidth / this.swipeSpeed) {
416 | if (this.hasNext) {
417 | this.transitioning = true;
418 | this.showRightSlide(
419 | this.currentSlide,
420 | args.deltaX,
421 | endingVelocity
422 | ).then(() => {
423 | this.setupPanel(this.currentSlide.right);
424 |
425 | // Notify changed
426 | //this.triggerChangeEventRightToLeft();
427 |
428 | if (!this.hasNext) {
429 | // Notify finsihed
430 | // this.notify({
431 | // eventName: SlideContainer.FINISHED_EVENT,
432 | // object: this
433 | // });
434 | }
435 | });
436 | } else {
437 | // We're at the end
438 | // Notify no more slides
439 | //this.triggerCancelEvent(cancellationReason.noMoreSlides);
440 | }
441 | return;
442 | }
443 |
444 | if (this.transitioning === false) {
445 | //Notify cancelled
446 | //this.triggerCancelEvent(cancellationReason.user);
447 | this.transitioning = true;
448 | this.currentSlide.slide.layout.animate({
449 | translate: { x: -this.pageWidth, y: 0 },
450 | duration: 200,
451 | curve: AnimationCurve.easeOut
452 | });
453 | if (this.hasNext) {
454 | this.currentSlide.right.slide.layout.animate({
455 | translate: { x: 0, y: 0 },
456 | duration: 200,
457 | curve: AnimationCurve.easeOut
458 | });
459 | if (app.ios)
460 | //for some reason i have to set these in ios or there is some sort of bounce back.
461 | this.currentSlide.right.slide.layout.translateX = 0;
462 | }
463 | if (this.hasPrevious) {
464 | this.currentSlide.left.slide.layout.animate({
465 | translate: { x: -this.pageWidth * 2, y: 0 },
466 | duration: 200,
467 | curve: AnimationCurve.easeOut
468 | });
469 | if (app.ios)
470 | this.currentSlide.left.slide.layout.translateX = -this.pageWidth;
471 | }
472 | if (app.ios)
473 | this.currentSlide.slide.layout.translateX = -this.pageWidth;
474 |
475 | this.transitioning = false;
476 | }
477 | } else {
478 | if (
479 | !this.transitioning &&
480 | previousDelta !== args.deltaX &&
481 | args.deltaX != null &&
482 | args.deltaX < 0
483 | ) {
484 | if (this.hasNext) {
485 | this.direction = direction.left;
486 | this.currentSlide.slide.layout.translateX =
487 | args.deltaX - this.pageWidth;
488 | this.currentSlide.right.slide.layout.translateX = args.deltaX;
489 | }
490 | } else if (
491 | !this.transitioning &&
492 | previousDelta !== args.deltaX &&
493 | args.deltaX != null &&
494 | args.deltaX > 0
495 | ) {
496 | if (this.hasPrevious) {
497 | this.direction = direction.right;
498 | this.currentSlide.slide.layout.translateX =
499 | args.deltaX - this.pageWidth;
500 | this.currentSlide.left.slide.layout.translateX =
501 | -(this.pageWidth * 2) + args.deltaX;
502 | }
503 | }
504 |
505 | if (args.deltaX !== 0) {
506 | previousDelta = args.deltaX;
507 | }
508 | }
509 | }
510 |
511 | public onDoubleTap(args: gestures.GestureEventData) {
512 | args.view.animate({
513 | translate: { x: -this.pageWidth, y: 0 },
514 | scale: { x: 1, y: 1 },
515 | curve: "easeOut",
516 | duration: 300
517 | });
518 |
519 | this.currentScale = 1;
520 | }
521 |
522 | public onPinch(args: gestures.PinchGestureEventData) {
523 | let item = args.view;
524 |
525 | if (args.state === gestures.GestureStateTypes.began) {
526 | const newOriginX = args.getFocusX() - item.translateX;
527 | const newOriginY = args.getFocusY() - item.translateY;
528 |
529 | const oldOriginX = item.originX * item.getMeasuredWidth();
530 | const oldOriginY = item.originY * item.getMeasuredHeight();
531 |
532 | item.translateX += (oldOriginX - newOriginX) * (1 - item.scaleX);
533 | item.translateY += (oldOriginY - newOriginY) * (1 - item.scaleY);
534 |
535 | item.originX = newOriginX / item.getMeasuredWidth();
536 | item.originY = newOriginY / item.getMeasuredHeight();
537 |
538 | this.currentScale = item.scaleX;
539 | } else if (args.scale && args.scale !== 1) {
540 | let newScale = this.currentScale * args.scale;
541 | newScale = Math.min(8, newScale);
542 | newScale = Math.max(1, newScale);
543 |
544 | item.scaleX = newScale;
545 | item.scaleY = newScale;
546 |
547 | this.currentScale = newScale;
548 | }
549 | }
550 |
551 | public onPan(args: gestures.PanGestureEventData) {
552 | let item = args.view;
553 |
554 | if (args.state === 1) {
555 | this.currentDeltaX = 0;
556 | this.currentDeltaY = 0;
557 | } else if (args.state === 2) {
558 | item.translateX += args.deltaX - this.currentDeltaX;
559 | item.translateY += args.deltaY - this.currentDeltaY;
560 |
561 | this.currentDeltaX = args.deltaX;
562 | this.currentDeltaY = args.deltaY;
563 | }
564 | }
565 |
566 | private buildSlideMap(slides: SlideComponent[]) {
567 | this._slideMap = [];
568 | slides.forEach((slide: SlideComponent, index: number) => {
569 | this._slideMap.push({
570 | slide: slide,
571 | index: index
572 | });
573 | });
574 | this._slideMap.forEach((mapping: ISlideMap, index: number) => {
575 | if (this._slideMap[index - 1] != null)
576 | mapping.left = this._slideMap[index - 1];
577 | if (this._slideMap[index + 1] != null)
578 | mapping.right = this._slideMap[index + 1];
579 | });
580 |
581 | if (this.loop) {
582 | this._slideMap[0].left = this._slideMap[this._slideMap.length - 1];
583 | this._slideMap[this._slideMap.length - 1].right = this._slideMap[0];
584 | }
585 | return this._slideMap[0];
586 | }
587 |
588 | public GoToSlide(
589 | num: number,
590 | traverseDuration: number = 50,
591 | landingDuration: number = 200
592 | ): void {
593 | if (this.currentSlide.index == num) return;
594 |
595 | var duration: number = landingDuration;
596 | if (Math.abs(num - this.currentSlide.index) != 1)
597 | duration = traverseDuration;
598 |
599 | if (this.currentSlide.index < num)
600 | this.nextSlide(duration).then(() => this.GoToSlide(num));
601 | else this.previousSlide(duration).then(() => this.GoToSlide(num));
602 | }
603 |
604 | public nextSlide(duration?: number): Promise {
605 | if (!this.hasNext) {
606 | //this.triggerCancelEvent(cancellationReason.noMoreSlides);
607 | return;
608 | }
609 |
610 | this.direction = direction.left;
611 | this.transitioning = true;
612 | // this.triggerStartEvent();
613 | return this.showRightSlide(this.currentSlide, null, null, duration).then(
614 | () => {
615 | this.setupPanel(this.currentSlide.right);
616 | //this.triggerChangeEventRightToLeft();
617 | }
618 | );
619 | }
620 |
621 | public previousSlide(duration?: number): Promise {
622 | if (!this.hasPrevious) {
623 | //this.triggerCancelEvent(cancellationReason.noPrevSlides);
624 | return;
625 | }
626 |
627 | this.direction = direction.right;
628 | this.transitioning = true;
629 | //this.triggerStartEvent();
630 | return this.showLeftSlide(this.currentSlide, null, null, duration).then(
631 | () => {
632 | this.setupPanel(this.currentSlide.left);
633 |
634 | //this.triggerChangeEventLeftToRight();
635 | }
636 | );
637 | }
638 | }
639 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "org.nativescript.nativescriptpackagr",
8 | "tns-ios": {
9 | "version": "4.2.0"
10 | },
11 | "tns-android": {
12 | "version": "4.2.0"
13 | }
14 | },
15 | "scripts": {
16 | "build": "ng-packagr -p lib/package.json && cp README.md dist && cp LICENSE dist",
17 | "ios": "tns run ios --syncAllFiles",
18 | "android": "tns run android --syncAllFiles"
19 | },
20 | "dependencies": {
21 | "@angular/animations": "~6.0.0",
22 | "@angular/common": "~6.0.0",
23 | "@angular/compiler": "~6.0.0",
24 | "@angular/core": "~6.0.0",
25 | "@angular/forms": "~6.0.0",
26 | "@angular/http": "~6.0.0",
27 | "@angular/platform-browser": "~6.0.0",
28 | "@angular/platform-browser-dynamic": "~6.0.0",
29 | "@angular/router": "~6.0.0",
30 | "nativescript-angular": "~6.0.0",
31 | "nativescript-theme-core": "~1.0.4",
32 | "nativescript-ngx-slides": "file:./lib/",
33 | "reflect-metadata": "~0.1.8",
34 | "rxjs": "~6.1.0",
35 | "tns-core-modules": "^4.2.0",
36 | "zone.js": "^0.8.26"
37 | },
38 | "devDependencies": {
39 | "@angular/compiler-cli": "^6.0.6",
40 | "nativescript-dev-typescript": "~0.7.0",
41 | "ng-packagr": "^3.0.1",
42 | "typescript": "~2.7.2"
43 | }
44 | }
--------------------------------------------------------------------------------
/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Needed for autocompletion and compilation.
2 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es5",
5 | "experimentalDecorators": true,
6 | "emitDecoratorMetadata": true,
7 | "noEmitHelpers": true,
8 | "noEmitOnError": true,
9 | "lib": [
10 | "es6",
11 | "dom",
12 | "es2015.iterable"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "~/*": [
17 | "app/*"
18 | ],
19 | "nativescript-ngx-slides": [
20 | "./lib/index.ts"
21 | ],
22 | "*": [
23 | "./node_modules/tns-core-modules/*",
24 | "./node_modules/*"
25 | ]
26 | }
27 | },
28 | "exclude": [
29 | "node_modules",
30 | "platforms"
31 | ]
32 | }
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { relative, resolve, join } = require("path");
2 |
3 | const webpack = require("webpack");
4 | const nsWebpack = require("nativescript-dev-webpack");
5 | const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
6 | const CleanWebpackPlugin = require("clean-webpack-plugin");
7 | const CopyWebpackPlugin = require("copy-webpack-plugin");
8 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
9 | const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
10 | const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
11 |
12 | module.exports = env => {
13 | const platform = env && (env.android && "android" || env.ios && "ios");
14 | if (!platform) {
15 | throw new Error("You need to provide a target platform!");
16 | }
17 |
18 | const platforms = ["ios", "android"];
19 | const projectRoot = __dirname;
20 | // Default destination inside platforms//...
21 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform));
22 | const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";
23 |
24 | const {
25 | // The 'appPath' and 'appResourcesPath' values are fetched from
26 | // the nsconfig.json configuration file
27 | // when bundling with `tns run android|ios --bundle`.
28 | appPath = "app",
29 | appResourcesPath = "app/App_Resources",
30 |
31 | // Aot, snapshot, uglify and report can be enabled by providing
32 | // the `--env.snapshot`, `--env.uglify` or `--env.report` flags
33 | // when running 'tns run android|ios'
34 | aot,
35 | snapshot,
36 | uglify,
37 | report,
38 | } = env;
39 | const ngToolsWebpackOptions = { tsConfigPath: join(__dirname, "tsconfig.json") };
40 |
41 | const appFullPath = resolve(projectRoot, appPath);
42 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
43 |
44 | const config = {
45 | context: appFullPath,
46 | watchOptions: {
47 | ignored: [
48 | appResourcesFullPath,
49 | // Don't watch hidden files
50 | "**/.*",
51 | ]
52 | },
53 | target: nativescriptTarget,
54 | entry: {
55 | bundle: aot ?
56 | `./${nsWebpack.getAotEntryModule(appFullPath)}` :
57 | `./${nsWebpack.getEntryModule(appFullPath)}`,
58 | vendor: "./vendor",
59 | },
60 | output: {
61 | pathinfo: true,
62 | path: dist,
63 | libraryTarget: "commonjs2",
64 | filename: "[name].js",
65 | },
66 | resolve: {
67 | extensions: [".ts", ".js", ".scss", ".css"],
68 | // Resolve {N} system modules from tns-core-modules
69 | modules: [
70 | "node_modules/tns-core-modules",
71 | "node_modules",
72 | ],
73 | alias: {
74 | '~': appFullPath
75 | },
76 | // don't resolve symlinks to symlinked modules
77 | symlinks: false
78 | },
79 | resolveLoader: {
80 | // don't resolve symlinks to symlinked loaders
81 | symlinks: false
82 | },
83 | node: {
84 | // Disable node shims that conflict with NativeScript
85 | "http": false,
86 | "timers": false,
87 | "setImmediate": false,
88 | "fs": "empty",
89 | },
90 | module: {
91 | rules: [
92 | { test: /\.html$|\.xml$/, use: "raw-loader" },
93 |
94 | // tns-core-modules reads the app.css and its imports using css-loader
95 | {
96 | test: /[\/|\\]app\.css$/,
97 | use: {
98 | loader: "css-loader",
99 | options: { minimize: false, url: false },
100 | }
101 | },
102 | {
103 | test: /[\/|\\]app\.scss$/,
104 | use: [
105 | { loader: "css-loader", options: { minimize: false, url: false } },
106 | "sass-loader"
107 | ]
108 | },
109 |
110 | // Angular components reference css files and their imports using raw-loader
111 | { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
112 | { test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
113 |
114 | // Compile TypeScript files with ahead-of-time compiler.
115 | { test: /.ts$/, use: [
116 | "nativescript-dev-webpack/moduleid-compat-loader",
117 | { loader: "@ngtools/webpack", options: ngToolsWebpackOptions },
118 | ]},
119 | ],
120 | },
121 | plugins: [
122 | // Vendor libs go to the vendor.js chunk
123 | new webpack.optimize.CommonsChunkPlugin({
124 | name: ["vendor"],
125 | }),
126 | // Define useful constants like TNS_WEBPACK
127 | new webpack.DefinePlugin({
128 | "global.TNS_WEBPACK": "true",
129 | }),
130 | // Remove all files from the out dir.
131 | new CleanWebpackPlugin([ `${dist}/**/*` ]),
132 | // Copy native app resources to out dir.
133 | new CopyWebpackPlugin([
134 | {
135 | from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
136 | to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
137 | context: projectRoot
138 | },
139 | ]),
140 | // Copy assets to out dir. Add your own globs as needed.
141 | new CopyWebpackPlugin([
142 | { from: "fonts/**" },
143 | { from: "**/*.jpg" },
144 | { from: "**/*.png" },
145 | { from: "**/*.xml" },
146 | ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
147 | // Generate a bundle starter script and activate it in package.json
148 | new nsWebpack.GenerateBundleStarterPlugin([
149 | "./vendor",
150 | "./bundle",
151 | ]),
152 | // Support for web workers since v3.2
153 | new NativeScriptWorkerPlugin(),
154 | // AngularCompilerPlugin with augmented NativeScript filesystem to handle platform specific resource resolution.
155 | new nsWebpack.NativeScriptAngularCompilerPlugin(
156 | Object.assign({
157 | entryModule: resolve(appPath, "app.module#AppModule"),
158 | skipCodeGeneration: !aot,
159 | platformOptions: {
160 | platform,
161 | platforms,
162 | // ignore: ["App_Resources"]
163 | },
164 | }, ngToolsWebpackOptions)
165 | ),
166 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
167 | new nsWebpack.WatchStateLoggerPlugin(),
168 | ],
169 | };
170 | if (report) {
171 | // Generate report files for bundles content
172 | config.plugins.push(new BundleAnalyzerPlugin({
173 | analyzerMode: "static",
174 | openAnalyzer: false,
175 | generateStatsFile: true,
176 | reportFilename: resolve(projectRoot, "report", `report.html`),
177 | statsFilename: resolve(projectRoot, "report", `stats.json`),
178 | }));
179 | }
180 | if (snapshot) {
181 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
182 | chunk: "vendor",
183 | projectRoot,
184 | webpackConfig: config,
185 | targetArchs: ["arm", "arm64", "ia32"],
186 | tnsJavaClassesOptions: { packages: ["tns-core-modules" ] },
187 | useLibs: false
188 | }));
189 | }
190 | if (uglify) {
191 | config.plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true }));
192 |
193 | // Work around an Android issue by setting compress = false
194 | const compress = platform !== "android";
195 | config.plugins.push(new UglifyJsPlugin({
196 | uglifyOptions: {
197 | mangle: { reserved: nsWebpack.uglifyMangleExcludes }, // Deprecated. Remove if using {N} 4+.
198 | compress,
199 | }
200 | }));
201 | }
202 | return config;
203 | };
204 |
--------------------------------------------------------------------------------