├── .gitignore
├── .prettierrc
├── LICENSE
├── README.md
├── demo-angular
├── App_Resources
│ ├── Android
│ │ ├── app.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── res
│ │ │ ├── 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-20.png
│ │ │ ├── icon-20@2x.png
│ │ │ ├── icon-20@3x.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-XR.png
│ │ │ ├── Default-Landscape-XS-Max.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Landscape@3x.png
│ │ │ ├── Default-Portrait-XR.png
│ │ │ ├── Default-Portrait-XS-Max.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.AspectFill@3x.png
│ │ └── LaunchScreen.Center.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-Center.png
│ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ └── LaunchScreen.Center@3x.png
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── build.xcconfig
├── LICENSE
├── angular.json
├── hooks
│ ├── before-livesync
│ │ └── nativescript-angular-sync.js
│ ├── before-prepare
│ │ └── nativescript-dev-typescript.js
│ └── before-watch
│ │ └── nativescript-dev-typescript.js
├── nsconfig.json
├── package.json
├── src
│ ├── app.css
│ ├── app
│ │ ├── app-routing.module.ts
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ └── item
│ │ │ ├── item-detail.component.html
│ │ │ ├── item-detail.component.ts
│ │ │ ├── item.service.ts
│ │ │ ├── item.ts
│ │ │ ├── items.component.html
│ │ │ └── items.component.ts
│ ├── images
│ │ ├── nativescript.png
│ │ ├── nativescript.svg
│ │ ├── spider.1.svg
│ │ └── spider.svg
│ ├── main.ts
│ └── package.json
├── tsconfig.json
├── tsconfig.tns.json
├── tsfmt.json
└── webpack.config.js
├── demo
├── app
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── app.gradle
│ │ │ └── src
│ │ │ │ └── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── res
│ │ │ │ ├── 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-20.png
│ │ │ │ ├── icon-20@2x.png
│ │ │ │ ├── icon-20@3x.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-XR.png
│ │ │ │ ├── Default-Landscape-XS-Max.png
│ │ │ │ ├── Default-Landscape.png
│ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ ├── Default-Portrait-XR.png
│ │ │ │ ├── Default-Portrait-XS-Max.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.AspectFill@3x.png
│ │ │ └── LaunchScreen.Center.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ │ └── LaunchScreen.Center@3x.png
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── build.xcconfig
│ ├── app.css
│ ├── app.js
│ ├── images
│ │ ├── nativescript.png
│ │ ├── nativescript.svg
│ │ ├── spider-test.svg
│ │ └── spider.svg
│ ├── main-page.js
│ ├── main-page.xml
│ ├── main-view-model.js
│ ├── package.json
│ └── references.d.ts
├── jsconfig.json
├── package.json
└── webpack.config.js
├── src
├── .npmignore
├── angular
│ ├── index.d.ts
│ ├── index.js
│ ├── index.js.map
│ ├── index.ts
│ ├── nativescript-svg-directives.d.ts
│ ├── nativescript-svg-directives.js
│ ├── nativescript-svg-directives.js.map
│ ├── nativescript-svg-directives.ts
│ ├── nativescript-svg-module.d.ts
│ ├── nativescript-svg-module.js
│ ├── nativescript-svg-module.js.map
│ ├── nativescript-svg-module.ts
│ └── package.json
├── hooks
│ └── before-livesync
│ │ └── nativescript-angular-sync.js
├── package-lock.json
├── package.json
├── platforms
│ ├── android
│ │ └── androidsvg-release.aar
│ └── ios
│ │ └── Podfile
├── references.d.ts
├── svg.android.d.ts
├── svg.android.ts
├── svg.common.d.ts
├── svg.common.ts
├── svg.d.ts
├── svg.ios.d.ts
├── svg.ios.ts
└── tsconfig.json
└── tslint.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # Demo application build files
2 | demo/platforms/*
3 | demo/lib/*
4 |
5 | *.DS_Store
6 |
7 | src/**/*.js
8 | /*.js
9 | demo/app/**.js
10 | demo/node_modules/
11 | node_modules/
12 |
13 | .vscode
14 | .idea
15 | demo/.DS_Store
16 | demo/app/.DS_Store
17 | .DS_Store
18 | .npmrc
19 | *.js
20 | *.js.map
21 | *.log
22 | src/*.d.ts
23 | !src/index.d.ts
24 | !src/references.d.ts
25 | !src/scripts/*.js
26 | !seed-tests/*.js
27 | seed-tests/seed-copy/**/*.*
28 | seed-tests/seed-copy-new-git-repo/**/*.*
29 | !demo/karma.conf.js
30 | !demo/app/tests/*.js
31 | demo/*.d.ts
32 | !demo/references.d.ts
33 | demo/lib
34 | demo/platforms
35 | node_modules
36 | publish/src
37 | publish/package
38 | demo/report/report.html
39 | demo/report/stats.json
40 | !demo/webpack.config.js
41 | !demo/karma.conf.js
42 |
43 | ## demo-vue app
44 | !demo-vue/**/*.js
45 |
46 | ## demo-angular app
47 | src/angular/*.js
48 | demo-angular/platforms
49 | demo-angular/hooks
50 | demo-angular/node_modules
51 | !demo-angular/webpack.config.js
52 |
53 | *.tgz
54 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true
4 | }
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | nativescript-svg
4 | Copyright (c) 2016, PeopleWare
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 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.npmjs.com/package/@teammaestro/nativescript-svg)
2 | [](https://www.npmjs.com/package/@teammaestro/nativescript-svg)
3 | [](http://opensource.org/licenses/MIT)
4 |
5 | # NativeScript SVG
6 |
7 | ## Install
8 |
9 | `tns plugin add @teammaestro/nativescript-svg`
10 |
11 | ## Usage
12 |
13 | You use it in the same way you use Image source.
14 |
15 | | Android Library | iOS CocoaPod |
16 | | ------------------------------------------------------------- | ---------------------------------------------------- |
17 | | [pents90 svg-android](https://github.com/pents90/svg-android) | [SVGKit by SVGKit](https://github.com/SVGKit/SVGKit) |
18 |
19 | ** there are limitations: ** - saveToFile ins't working
20 |
21 | ### Quick start
22 |
23 | ```js
24 | var ImageSourceSVGModule = require('@teammaestro/nativescript-svg');
25 | var svgFile = new ImageSourceSVGModule.ImageSourceSVG();
26 |
27 | var loaded = svgFile.fromResource('foxie');
28 |
29 | var path = '//somepath/file.svg';
30 | loaded = svgFile.loadFromFile(path);
31 |
32 | var url = 'http://somepath/file.svg';
33 | svgFile
34 | .fromUrl(url)
35 | .then(loaded => {
36 | console.log('object loaded');
37 | })
38 | .catch(e => {
39 | console.log('error');
40 | });
41 | ```
42 |
43 | ## API
44 |
45 | ##### ImageSourceSVGModule.fromResource(name: string): ImageSourceSVG
46 |
47 | - Loads this instance from the specified resource name.
48 |
49 | ##### ImageSourceSVGModule.fromFile(path: string): ImageSourceSVG
50 |
51 | - Creates a new ImageSourceSVG instance and loads it from the specified file.
52 |
53 | ##### ImageSourceSVGModule.fromData(data: any): ImageSourceSVG
54 |
55 | - Creates a new ImageSourceSVG instance and loads it from the specified resource name.
56 |
57 | ##### ImageSourceSVGModule.fromBase64(source: string): ImageSourceSVG
58 |
59 | - Creates a new ImageSourceSVG instance and loads it from the specified resource name.
60 |
61 | ##### ImageSourceSVGModule.fromBase64(source: string): ImageSourceSVG
62 |
63 | - Creates a new ImageSourceSVG instance and loads it from the specified resource name.
64 |
65 | ##### ImageSourceSVGModule.fromUrl(url: string): Promise:ImageSourceSVG
66 |
67 | - Downloads the image from the provided Url and creates a new ImageSourceSVG instance from it.
68 |
69 | ---
70 |
71 | You can call every method in two ways, for example:
72 |
73 | ```
74 | //from the svg file object
75 | svgFile.loadFromResource(name: string): boolean // synchronously
76 | svgFile.fromResource(name: string): ImageSourceSVG //asynchronously
77 | ```
78 |
79 | or
80 |
81 | ```
82 | //from the svg module api
83 | ImageSourceSVGModule.fromResource(name: string): ImageSourceSVG
84 | ```
85 |
86 | Since ver 1.1 Implement a similar image tag to be used as for example:
87 |
88 | ```xml
89 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | ```
101 |
102 | ### Roadmap
103 |
104 | ver 1.6 implement an SVGImage tag that can support svg tags.
105 |
106 | ```
107 |
108 |
109 |
110 |
111 | ```
112 |
113 | ver 1.5 Change api dependency from pents90/svg-android to Pixplicity/sharp
114 |
115 | ### Release note
116 |
117 | v1.3.4 -- Angular 4 support, please check example code
118 |
119 | v1.3.0 -- NS 3+ implementation and it will work with angular if you call registerElement before using it. Thanks to @tbozhikov
120 |
121 | v1.1.4 -- Fix svg & demo
122 |
123 | v1.1.3 -- Fix SVGImage for iOS - SVGKFastImageView issue#3
124 |
125 | v1.1.0 -- Implemented a similar image tag to render svg images.
126 |
127 | v1.0.11 -- Major fix for load library issue and demo include.
128 |
129 | v1.0.9 -- load from URL on Android and IOS included.
130 |
131 | v1.0.7 -- Fix svg.common override issue.
132 |
133 | v1.0.5 -- fix for npm package lib not including the .js files.
134 |
135 | v1.0.2 -- the base64 encondig on Android included - IOS pending.
136 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // implementation 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | // If you want to add something to be applied before applying plugins' include.gradle files
9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10 | // create a file named before-plugins.gradle in the current directory and place it there
11 |
12 | android {
13 | defaultConfig {
14 | generatedDensities = []
15 | }
16 | aaptOptions {
17 | additionalParameters "--no-version-vectors"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/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 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "icon-29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "icon-40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "icon-20.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "icon-20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "icon-29.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "icon-29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "icon-40.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "icon-40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "icon-76.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "icon-76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "icon-83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "icon-1024.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2688h",
7 | "filename" : "Default-Portrait-XS-Max.png",
8 | "minimum-system-version" : "12.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "2688h",
16 | "filename" : "Default-Landscape-XS-Max.png",
17 | "minimum-system-version" : "12.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "1792h",
25 | "filename" : "Default-Portrait-XR.png",
26 | "minimum-system-version" : "12.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "1792h",
34 | "filename" : "Default-Landscape-XR.png",
35 | "minimum-system-version" : "12.0",
36 | "orientation" : "landscape",
37 | "scale" : "2x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "2436h",
43 | "filename" : "Default-1125h.png",
44 | "minimum-system-version" : "11.0",
45 | "orientation" : "portrait",
46 | "scale" : "3x"
47 | },
48 | {
49 | "extent" : "full-screen",
50 | "idiom" : "iphone",
51 | "subtype" : "2436h",
52 | "filename" : "Default-Landscape-X.png",
53 | "minimum-system-version" : "11.0",
54 | "orientation" : "landscape",
55 | "scale" : "3x"
56 | },
57 | {
58 | "extent" : "full-screen",
59 | "idiom" : "iphone",
60 | "subtype" : "736h",
61 | "filename" : "Default-736h@3x.png",
62 | "minimum-system-version" : "8.0",
63 | "orientation" : "portrait",
64 | "scale" : "3x"
65 | },
66 | {
67 | "extent" : "full-screen",
68 | "idiom" : "iphone",
69 | "subtype" : "736h",
70 | "filename" : "Default-Landscape@3x.png",
71 | "minimum-system-version" : "8.0",
72 | "orientation" : "landscape",
73 | "scale" : "3x"
74 | },
75 | {
76 | "extent" : "full-screen",
77 | "idiom" : "iphone",
78 | "subtype" : "667h",
79 | "filename" : "Default-667h@2x.png",
80 | "minimum-system-version" : "8.0",
81 | "orientation" : "portrait",
82 | "scale" : "2x"
83 | },
84 | {
85 | "orientation" : "portrait",
86 | "idiom" : "iphone",
87 | "filename" : "Default@2x.png",
88 | "extent" : "full-screen",
89 | "minimum-system-version" : "7.0",
90 | "scale" : "2x"
91 | },
92 | {
93 | "extent" : "full-screen",
94 | "idiom" : "iphone",
95 | "subtype" : "retina4",
96 | "filename" : "Default-568h@2x.png",
97 | "minimum-system-version" : "7.0",
98 | "orientation" : "portrait",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "filename" : "Default-Portrait.png",
105 | "extent" : "full-screen",
106 | "minimum-system-version" : "7.0",
107 | "scale" : "1x"
108 | },
109 | {
110 | "orientation" : "landscape",
111 | "idiom" : "ipad",
112 | "filename" : "Default-Landscape.png",
113 | "extent" : "full-screen",
114 | "minimum-system-version" : "7.0",
115 | "scale" : "1x"
116 | },
117 | {
118 | "orientation" : "portrait",
119 | "idiom" : "ipad",
120 | "filename" : "Default-Portrait@2x.png",
121 | "extent" : "full-screen",
122 | "minimum-system-version" : "7.0",
123 | "scale" : "2x"
124 | },
125 | {
126 | "orientation" : "landscape",
127 | "idiom" : "ipad",
128 | "filename" : "Default-Landscape@2x.png",
129 | "extent" : "full-screen",
130 | "minimum-system-version" : "7.0",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "iphone",
136 | "filename" : "Default.png",
137 | "extent" : "full-screen",
138 | "scale" : "1x"
139 | },
140 | {
141 | "orientation" : "portrait",
142 | "idiom" : "iphone",
143 | "filename" : "Default@2x.png",
144 | "extent" : "full-screen",
145 | "scale" : "2x"
146 | },
147 | {
148 | "orientation" : "portrait",
149 | "idiom" : "iphone",
150 | "filename" : "Default-568h@2x.png",
151 | "extent" : "full-screen",
152 | "subtype" : "retina4",
153 | "scale" : "2x"
154 | },
155 | {
156 | "orientation" : "portrait",
157 | "idiom" : "ipad",
158 | "extent" : "to-status-bar",
159 | "scale" : "1x"
160 | },
161 | {
162 | "orientation" : "portrait",
163 | "idiom" : "ipad",
164 | "filename" : "Default-Portrait.png",
165 | "extent" : "full-screen",
166 | "scale" : "1x"
167 | },
168 | {
169 | "orientation" : "landscape",
170 | "idiom" : "ipad",
171 | "extent" : "to-status-bar",
172 | "scale" : "1x"
173 | },
174 | {
175 | "orientation" : "landscape",
176 | "idiom" : "ipad",
177 | "filename" : "Default-Landscape.png",
178 | "extent" : "full-screen",
179 | "scale" : "1x"
180 | },
181 | {
182 | "orientation" : "portrait",
183 | "idiom" : "ipad",
184 | "extent" : "to-status-bar",
185 | "scale" : "2x"
186 | },
187 | {
188 | "orientation" : "portrait",
189 | "idiom" : "ipad",
190 | "filename" : "Default-Portrait@2x.png",
191 | "extent" : "full-screen",
192 | "scale" : "2x"
193 | },
194 | {
195 | "orientation" : "landscape",
196 | "idiom" : "ipad",
197 | "extent" : "to-status-bar",
198 | "scale" : "2x"
199 | },
200 | {
201 | "orientation" : "landscape",
202 | "idiom" : "ipad",
203 | "filename" : "Default-Landscape@2x.png",
204 | "extent" : "full-screen",
205 | "scale" : "2x"
206 | }
207 | ],
208 | "info" : {
209 | "version" : 1,
210 | "author" : "xcode"
211 | }
212 | }
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/demo-angular/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 | "filename" : "LaunchScreen.AspectFill@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png
--------------------------------------------------------------------------------
/demo-angular/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 | "filename" : "LaunchScreen.Center@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png
--------------------------------------------------------------------------------
/demo-angular/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 |
--------------------------------------------------------------------------------
/demo-angular/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 |
--------------------------------------------------------------------------------
/demo-angular/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. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/demo-angular/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-2019 Progress Software Corporation
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.
202 |
--------------------------------------------------------------------------------
/demo-angular/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "cli": {
6 | "defaultCollection": "@nativescript/schematics"
7 | },
8 | "projects": {
9 | "hello-world": {
10 | "root": "",
11 | "sourceRoot": "src",
12 | "projectType": "application",
13 | "prefix": "ns"
14 | }
15 | },
16 | "defaultProject": "hello-world"
17 | }
18 |
--------------------------------------------------------------------------------
/demo-angular/hooks/before-livesync/nativescript-angular-sync.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-angular/hooks/before-livesync");
2 |
--------------------------------------------------------------------------------
/demo-angular/hooks/before-prepare/nativescript-dev-typescript.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-dev-typescript/lib/before-prepare.js");
2 |
--------------------------------------------------------------------------------
/demo-angular/hooks/before-watch/nativescript-dev-typescript.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-dev-typescript/lib/watch.js");
2 |
--------------------------------------------------------------------------------
/demo-angular/nsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "appResourcesPath": "App_Resources",
3 | "appPath": "src"
4 | }
5 |
--------------------------------------------------------------------------------
/demo-angular/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "nativescript": {
3 | "id": "org.nativescript.test",
4 | "tns-android": {
5 | "version": "5.2.1"
6 | },
7 | "tns-ios": {
8 | "version": "5.2.0"
9 | }
10 | },
11 | "description": "NativeScript Application",
12 | "license": "SEE LICENSE IN ",
13 | "repository": "",
14 | "dependencies": {
15 | "@angular/animations": "~7.2.0",
16 | "@angular/common": "~7.2.0",
17 | "@angular/compiler": "~7.2.0",
18 | "@angular/core": "~7.2.0",
19 | "@angular/forms": "~7.2.0",
20 | "@angular/http": "~7.2.0",
21 | "@angular/platform-browser": "~7.2.0",
22 | "@angular/platform-browser-dynamic": "~7.2.0",
23 | "@angular/router": "~7.2.0",
24 | "nativescript-angular": "~7.2.1",
25 | "nativescript-theme-core": "~1.0.4",
26 | "reflect-metadata": "~0.1.12",
27 | "rxjs": "~6.3.0",
28 | "@teammaestro/nativescript-svg": "file:../src",
29 | "tns-core-modules": "~5.2.0",
30 | "zone.js": "~0.8.26"
31 | },
32 | "devDependencies": {
33 | "@angular/compiler-cli": "~7.2.0",
34 | "@nativescript/schematics": "~0.5.0",
35 | "@ngtools/webpack": "~7.2.0",
36 | "nativescript-dev-typescript": "~0.8.0",
37 | "nativescript-dev-webpack": "~0.20.0"
38 | },
39 | "gitHead": "f548ec926e75201ab1b7c4a3a7ceefe7a4db15af",
40 | "readme": "NativeScript Application"
41 | }
42 |
--------------------------------------------------------------------------------
/demo-angular/src/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 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { NativeScriptRouterModule } from 'nativescript-angular/router';
3 | import { Routes } from '@angular/router';
4 |
5 | import { ItemsComponent } from './item/items.component';
6 | import { ItemDetailComponent } from './item/item-detail.component';
7 |
8 | const routes: Routes = [
9 | { path: '', redirectTo: '/items', pathMatch: 'full' },
10 | { path: 'items', component: ItemsComponent },
11 | { path: 'item/:id', component: ItemDetailComponent }
12 | ];
13 |
14 | @NgModule({
15 | imports: [NativeScriptRouterModule.forRoot(routes)],
16 | exports: [NativeScriptRouterModule]
17 | })
18 | export class AppRoutingModule {}
19 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'ns-app',
5 | moduleId: module.id,
6 | templateUrl: './app.component.html'
7 | })
8 | export class AppComponent {}
9 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptModule } from 'nativescript-angular/nativescript.module';
3 | import { AppRoutingModule } from './app-routing.module';
4 | import { AppComponent } from './app.component';
5 | import { ItemsComponent } from './item/items.component';
6 | import { ItemDetailComponent } from './item/item-detail.component';
7 | import { NativeScriptSvgModule } from '@teammaestro/nativescript-svg/angular';
8 |
9 | @NgModule({
10 | bootstrap: [AppComponent],
11 | imports: [NativeScriptModule, AppRoutingModule, NativeScriptSvgModule],
12 | declarations: [AppComponent, ItemsComponent, ItemDetailComponent],
13 | providers: [],
14 | schemas: [NO_ERRORS_SCHEMA]
15 | })
16 | /*
17 | Pass your application module to the bootstrapModule function located in main.ts to start your app
18 | */
19 | export class AppModule {}
20 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/item-detail.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/item-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ActivatedRoute } from '@angular/router';
3 |
4 | import { Item } from './item';
5 | import { ItemService } from './item.service';
6 |
7 | @Component({
8 | selector: 'ns-details',
9 | moduleId: module.id,
10 | templateUrl: './item-detail.component.html'
11 | })
12 | export class ItemDetailComponent implements OnInit {
13 | item: Item;
14 |
15 | constructor(
16 | private itemService: ItemService,
17 | private route: ActivatedRoute
18 | ) {}
19 |
20 | ngOnInit(): void {
21 | const id = +this.route.snapshot.params.id;
22 | this.item = this.itemService.getItem(id);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/item.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { Item } from './item';
4 |
5 | @Injectable({
6 | providedIn: 'root'
7 | })
8 | export class ItemService {
9 | private items = new Array- (
10 | { id: 1, name: 'Ter Stegen', role: 'Goalkeeper' },
11 | { id: 3, name: 'Piqué', role: 'Defender' },
12 | { id: 4, name: 'I. Rakitic', role: 'Midfielder' },
13 | { id: 5, name: 'Sergio', role: 'Midfielder' },
14 | { id: 6, name: 'Denis Suárez', role: 'Midfielder' },
15 | { id: 7, name: 'Arda', role: 'Midfielder' },
16 | { id: 8, name: 'A. Iniesta', role: 'Midfielder' },
17 | { id: 9, name: 'Suárez', role: 'Forward' },
18 | { id: 10, name: 'Messi', role: 'Forward' },
19 | { id: 11, name: 'Neymar', role: 'Forward' },
20 | { id: 12, name: 'Rafinha', role: 'Midfielder' },
21 | { id: 13, name: 'Cillessen', role: 'Goalkeeper' },
22 | { id: 14, name: 'Mascherano', role: 'Defender' },
23 | { id: 17, name: 'Paco Alcácer', role: 'Forward' },
24 | { id: 18, name: 'Jordi Alba', role: 'Defender' },
25 | { id: 19, name: 'Digne', role: 'Defender' },
26 | { id: 20, name: 'Sergi Roberto', role: 'Midfielder' },
27 | { id: 21, name: 'André Gomes', role: 'Midfielder' },
28 | { id: 22, name: 'Aleix Vidal', role: 'Midfielder' },
29 | { id: 23, name: 'Umtiti', role: 'Defender' },
30 | { id: 24, name: 'Mathieu', role: 'Defender' },
31 | { id: 25, name: 'Masip', role: 'Goalkeeper' }
32 | );
33 |
34 | getItems(): Array
- {
35 | return this.items;
36 | }
37 |
38 | getItem(id: number): Item {
39 | return this.items.filter(item => item.id === id)[0];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/item.ts:
--------------------------------------------------------------------------------
1 | export interface Item {
2 | id: number;
3 | name: string;
4 | role: string;
5 | }
6 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/items.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo-angular/src/app/item/items.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | import { Item } from './item';
4 | import { ItemService } from './item.service';
5 |
6 | @Component({
7 | selector: 'ns-items',
8 | moduleId: module.id,
9 | templateUrl: './items.component.html'
10 | })
11 | export class ItemsComponent implements OnInit {
12 | items: Array
- ;
13 |
14 | // This pattern makes use of Angular’s dependency injection implementation to
15 | // inject an instance of the ItemService service into this class.
16 | // Angular knows about this service because it is included in your app’s main NgModule,
17 | // defined in app.module.ts.
18 | constructor(private itemService: ItemService) {}
19 |
20 | ngOnInit(): void {
21 | this.items = this.itemService.getItems();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/demo-angular/src/images/nativescript.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo-angular/src/images/nativescript.png
--------------------------------------------------------------------------------
/demo-angular/src/images/nativescript.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/demo-angular/src/images/spider.1.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
63 |
64 |
--------------------------------------------------------------------------------
/demo-angular/src/images/spider.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
63 |
64 |
--------------------------------------------------------------------------------
/demo-angular/src/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/app.module";
5 |
6 | // A traditional NativeScript application starts by initializing global objects,
7 | // setting up global CSS rules, creating, and navigating to the main page.
8 | // Angular applications need to take care of their own initialization:
9 | // modules, components, directives, routes, DI providers.
10 | // A NativeScript Angular app needs to make both paradigms work together,
11 | // so we provide a wrapper platform object, platformNativeScriptDynamic,
12 | // that sets up a NativeScript application and can bootstrap the Angular framework.
13 | platformNativeScriptDynamic().bootstrapModule(AppModule);
14 |
--------------------------------------------------------------------------------
/demo-angular/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "main.js",
3 | "android": {
4 | "v8Flags": "--expose_gc"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo-angular/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 | "src/*"
18 | ]
19 | }
20 | },
21 | "exclude": [
22 | "node_modules",
23 | "platforms"
24 | ]
25 | }
--------------------------------------------------------------------------------
/demo-angular/tsconfig.tns.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig",
3 | "compilerOptions": {
4 | "module": "es2015",
5 | "moduleResolution": "node"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo-angular/tsfmt.json:
--------------------------------------------------------------------------------
1 | {
2 | "indentSize": 4,
3 | "tabSize": 4
4 | }
5 |
--------------------------------------------------------------------------------
/demo-angular/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep, dirname } = 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 { nsReplaceBootstrap } = require("nativescript-dev-webpack/transformers/ns-replace-bootstrap");
7 | const { nsReplaceLazyLoader } = require("nativescript-dev-webpack/transformers/ns-replace-lazy-loader");
8 | const { nsSupportHmrNg } = require("nativescript-dev-webpack/transformers/ns-support-hmr-ng");
9 | const { getMainModulePath } = require("nativescript-dev-webpack/utils/ast-utils");
10 | const CleanWebpackPlugin = require("clean-webpack-plugin");
11 | const CopyWebpackPlugin = require("copy-webpack-plugin");
12 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
13 | const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
14 | const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
15 | const { AngularCompilerPlugin } = require("@ngtools/webpack");
16 | const hashSalt = Date.now().toString();
17 |
18 | module.exports = env => {
19 | // Add your custom Activities, Services and other Android app components here.
20 | const appComponents = [
21 | "tns-core-modules/ui/frame",
22 | "tns-core-modules/ui/frame/activity",
23 | ];
24 |
25 | const platform = env && (env.android && "android" || env.ios && "ios");
26 | if (!platform) {
27 | throw new Error("You need to provide a target platform!");
28 | }
29 |
30 | const projectRoot = __dirname;
31 |
32 | // Default destination inside platforms//...
33 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
34 | const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";
35 |
36 | const {
37 | // The 'appPath' and 'appResourcesPath' values are fetched from
38 | // the nsconfig.json configuration file
39 | // when bundling with `tns run android|ios --bundle`.
40 | appPath = "src",
41 | appResourcesPath = "App_Resources",
42 |
43 | // You can provide the following flags when running 'tns run android|ios'
44 | aot, // --env.aot
45 | snapshot, // --env.snapshot
46 | uglify, // --env.uglify
47 | report, // --env.report
48 | sourceMap, // --env.sourceMap
49 | hmr, // --env.hmr,
50 | } = env;
51 |
52 | const externals = nsWebpack.getConvertedExternals(env.externals);
53 | const appFullPath = resolve(projectRoot, appPath);
54 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
55 | const tsConfigName = "tsconfig.tns.json";
56 | const entryModule = `${nsWebpack.getEntryModule(appFullPath)}.ts`;
57 | const entryPath = `.${sep}${entryModule}`;
58 | const ngCompilerTransformers = [];
59 | const additionalLazyModuleResources = [];
60 | if (aot) {
61 | ngCompilerTransformers.push(nsReplaceBootstrap);
62 | }
63 |
64 | if (hmr) {
65 | ngCompilerTransformers.push(nsSupportHmrNg);
66 | }
67 |
68 | // when "@angular/core" is external, it's not included in the bundles. In this way, it will be used
69 | // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
70 | // fixes https://github.com/NativeScript/nativescript-cli/issues/4024
71 | if (env.externals && env.externals.indexOf("@angular/core") > -1) {
72 | const appModuleRelativePath = getMainModulePath(resolve(appFullPath, entryModule), tsConfigName);
73 | if (appModuleRelativePath) {
74 | const appModuleFolderPath = dirname(resolve(appFullPath, appModuleRelativePath));
75 | // include the lazy loader inside app module
76 | ngCompilerTransformers.push(nsReplaceLazyLoader);
77 | // include the new lazy loader path in the allowed ones
78 | additionalLazyModuleResources.push(appModuleFolderPath);
79 | }
80 | }
81 |
82 | const ngCompilerPlugin = new AngularCompilerPlugin({
83 | hostReplacementPaths: nsWebpack.getResolver([platform, "tns"]),
84 | platformTransformers: ngCompilerTransformers.map(t => t(() => ngCompilerPlugin, resolve(appFullPath, entryModule))),
85 | mainPath: resolve(appPath, entryModule),
86 | tsConfigPath: join(__dirname, tsConfigName),
87 | skipCodeGeneration: !aot,
88 | sourceMap: !!sourceMap,
89 | additionalLazyModuleResources: additionalLazyModuleResources
90 | });
91 |
92 | const config = {
93 | mode: uglify ? "production" : "development",
94 | context: appFullPath,
95 | externals,
96 | watchOptions: {
97 | ignored: [
98 | appResourcesFullPath,
99 | // Don't watch hidden files
100 | "**/.*",
101 | ]
102 | },
103 | target: nativescriptTarget,
104 | entry: {
105 | bundle: entryPath,
106 | },
107 | output: {
108 | pathinfo: false,
109 | path: dist,
110 | libraryTarget: "commonjs2",
111 | filename: "[name].js",
112 | globalObject: "global",
113 | hashSalt
114 | },
115 | resolve: {
116 | extensions: [".ts", ".js", ".scss", ".css"],
117 | // Resolve {N} system modules from tns-core-modules
118 | modules: [
119 | resolve(__dirname, "node_modules/tns-core-modules"),
120 | resolve(__dirname, "node_modules"),
121 | "node_modules/tns-core-modules",
122 | "node_modules",
123 | ],
124 | alias: {
125 | '~': appFullPath
126 | },
127 | symlinks: true
128 | },
129 | resolveLoader: {
130 | symlinks: false
131 | },
132 | node: {
133 | // Disable node shims that conflict with NativeScript
134 | "http": false,
135 | "timers": false,
136 | "setImmediate": false,
137 | "fs": "empty",
138 | "__dirname": false,
139 | },
140 | devtool: sourceMap ? "inline-source-map" : "none",
141 | optimization: {
142 | splitChunks: {
143 | cacheGroups: {
144 | vendor: {
145 | name: "vendor",
146 | chunks: "all",
147 | test: (module, chunks) => {
148 | const moduleName = module.nameForCondition ? module.nameForCondition() : '';
149 | return /[\\/]node_modules[\\/]/.test(moduleName) ||
150 | appComponents.some(comp => comp === moduleName);
151 | },
152 | enforce: true,
153 | },
154 | }
155 | },
156 | minimize: !!uglify,
157 | minimizer: [
158 | new UglifyJsPlugin({
159 | parallel: true,
160 | cache: true,
161 | uglifyOptions: {
162 | output: {
163 | comments: false,
164 | },
165 | compress: {
166 | // The Android SBG has problems parsing the output
167 | // when these options are enabled
168 | 'collapse_vars': platform !== "android",
169 | sequences: platform !== "android",
170 | }
171 | }
172 | })
173 | ],
174 | },
175 | module: {
176 | rules: [
177 | {
178 | test: new RegExp(entryPath),
179 | use: [
180 | // Require all Android app components
181 | platform === "android" && {
182 | loader: "nativescript-dev-webpack/android-app-components-loader",
183 | options: { modules: appComponents }
184 | },
185 |
186 | {
187 | loader: "nativescript-dev-webpack/bundle-config-loader",
188 | options: {
189 | angular: true,
190 | loadCss: !snapshot, // load the application css if in debug mode
191 | }
192 | },
193 | ].filter(loader => !!loader)
194 | },
195 |
196 | { test: /\.html$|\.xml$/, use: "raw-loader" },
197 |
198 | // tns-core-modules reads the app.css and its imports using css-loader
199 | {
200 | test: /[\/|\\]app\.css$/,
201 | use: [
202 | "nativescript-dev-webpack/style-hot-loader",
203 | { loader: "css-loader", options: { minimize: false, url: false } }
204 | ]
205 | },
206 | {
207 | test: /[\/|\\]app\.scss$/,
208 | use: [
209 | "nativescript-dev-webpack/style-hot-loader",
210 | { loader: "css-loader", options: { minimize: false, url: false } },
211 | "sass-loader"
212 | ]
213 | },
214 |
215 | // Angular components reference css files and their imports using raw-loader
216 | { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
217 | { test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
218 |
219 | {
220 | test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
221 | use: [
222 | "nativescript-dev-webpack/moduleid-compat-loader",
223 | "nativescript-dev-webpack/lazy-ngmodule-hot-loader",
224 | "@ngtools/webpack",
225 | ]
226 | },
227 |
228 | // Mark files inside `@angular/core` as using SystemJS style dynamic imports.
229 | // Removing this will cause deprecation warnings to appear.
230 | {
231 | test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
232 | parser: { system: true },
233 | },
234 | ],
235 | },
236 | plugins: [
237 | // Define useful constants like TNS_WEBPACK
238 | new webpack.DefinePlugin({
239 | "global.TNS_WEBPACK": "true",
240 | "process": undefined,
241 | }),
242 | // Remove all files from the out dir.
243 | new CleanWebpackPlugin([`${dist}/**/*`]),
244 | // Copy native app resources to out dir.
245 | new CopyWebpackPlugin([
246 | {
247 | from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
248 | to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
249 | context: projectRoot
250 | },
251 | ]),
252 | // Copy assets to out dir. Add your own globs as needed.
253 | new CopyWebpackPlugin([
254 | { from: { glob: "fonts/**" } },
255 | { from: { glob: "images/**" } },
256 | { from: { glob: "**/*.jpg" } },
257 | { from: { glob: "**/*.png" } },
258 | ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
259 | // Generate a bundle starter script and activate it in package.json
260 | new nsWebpack.GenerateBundleStarterPlugin([
261 | "./vendor",
262 | "./bundle",
263 | ]),
264 | // For instructions on how to set up workers with webpack
265 | // check out https://github.com/nativescript/worker-loader
266 | new NativeScriptWorkerPlugin(),
267 | ngCompilerPlugin,
268 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
269 | new nsWebpack.WatchStateLoggerPlugin(),
270 | ],
271 | };
272 |
273 |
274 | if (report) {
275 | // Generate report files for bundles content
276 | config.plugins.push(new BundleAnalyzerPlugin({
277 | analyzerMode: "static",
278 | openAnalyzer: false,
279 | generateStatsFile: true,
280 | reportFilename: resolve(projectRoot, "report", `report.html`),
281 | statsFilename: resolve(projectRoot, "report", `stats.json`),
282 | }));
283 | }
284 |
285 | if (snapshot) {
286 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
287 | chunk: "vendor",
288 | angular: true,
289 | requireModules: [
290 | "reflect-metadata",
291 | "@angular/platform-browser",
292 | "@angular/core",
293 | "@angular/common",
294 | "@angular/router",
295 | "nativescript-angular/platform-static",
296 | "nativescript-angular/router",
297 | ],
298 | projectRoot,
299 | webpackConfig: config,
300 | }));
301 | }
302 |
303 | if (hmr) {
304 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
305 | }
306 |
307 | return config;
308 | };
309 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // implementation 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | // If you want to add something to be applied before applying plugins' include.gradle files
9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10 | // create a file named before-plugins.gradle in the current directory and place it there
11 |
12 | android {
13 | defaultConfig {
14 | generatedDensities = []
15 | }
16 | aaptOptions {
17 | additionalParameters "--no-version-vectors"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/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 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
-
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "icon-29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "icon-40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "icon-20.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "icon-20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "icon-29.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "icon-29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "icon-40.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "icon-40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "icon-76.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "icon-76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "icon-83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "icon-1024.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2688h",
7 | "filename" : "Default-Portrait-XS-Max.png",
8 | "minimum-system-version" : "12.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "2688h",
16 | "filename" : "Default-Landscape-XS-Max.png",
17 | "minimum-system-version" : "12.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "1792h",
25 | "filename" : "Default-Portrait-XR.png",
26 | "minimum-system-version" : "12.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "1792h",
34 | "filename" : "Default-Landscape-XR.png",
35 | "minimum-system-version" : "12.0",
36 | "orientation" : "landscape",
37 | "scale" : "2x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "2436h",
43 | "filename" : "Default-1125h.png",
44 | "minimum-system-version" : "11.0",
45 | "orientation" : "portrait",
46 | "scale" : "3x"
47 | },
48 | {
49 | "extent" : "full-screen",
50 | "idiom" : "iphone",
51 | "subtype" : "2436h",
52 | "filename" : "Default-Landscape-X.png",
53 | "minimum-system-version" : "11.0",
54 | "orientation" : "landscape",
55 | "scale" : "3x"
56 | },
57 | {
58 | "extent" : "full-screen",
59 | "idiom" : "iphone",
60 | "subtype" : "736h",
61 | "filename" : "Default-736h@3x.png",
62 | "minimum-system-version" : "8.0",
63 | "orientation" : "portrait",
64 | "scale" : "3x"
65 | },
66 | {
67 | "extent" : "full-screen",
68 | "idiom" : "iphone",
69 | "subtype" : "736h",
70 | "filename" : "Default-Landscape@3x.png",
71 | "minimum-system-version" : "8.0",
72 | "orientation" : "landscape",
73 | "scale" : "3x"
74 | },
75 | {
76 | "extent" : "full-screen",
77 | "idiom" : "iphone",
78 | "subtype" : "667h",
79 | "filename" : "Default-667h@2x.png",
80 | "minimum-system-version" : "8.0",
81 | "orientation" : "portrait",
82 | "scale" : "2x"
83 | },
84 | {
85 | "orientation" : "portrait",
86 | "idiom" : "iphone",
87 | "filename" : "Default@2x.png",
88 | "extent" : "full-screen",
89 | "minimum-system-version" : "7.0",
90 | "scale" : "2x"
91 | },
92 | {
93 | "extent" : "full-screen",
94 | "idiom" : "iphone",
95 | "subtype" : "retina4",
96 | "filename" : "Default-568h@2x.png",
97 | "minimum-system-version" : "7.0",
98 | "orientation" : "portrait",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "filename" : "Default-Portrait.png",
105 | "extent" : "full-screen",
106 | "minimum-system-version" : "7.0",
107 | "scale" : "1x"
108 | },
109 | {
110 | "orientation" : "landscape",
111 | "idiom" : "ipad",
112 | "filename" : "Default-Landscape.png",
113 | "extent" : "full-screen",
114 | "minimum-system-version" : "7.0",
115 | "scale" : "1x"
116 | },
117 | {
118 | "orientation" : "portrait",
119 | "idiom" : "ipad",
120 | "filename" : "Default-Portrait@2x.png",
121 | "extent" : "full-screen",
122 | "minimum-system-version" : "7.0",
123 | "scale" : "2x"
124 | },
125 | {
126 | "orientation" : "landscape",
127 | "idiom" : "ipad",
128 | "filename" : "Default-Landscape@2x.png",
129 | "extent" : "full-screen",
130 | "minimum-system-version" : "7.0",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "iphone",
136 | "filename" : "Default.png",
137 | "extent" : "full-screen",
138 | "scale" : "1x"
139 | },
140 | {
141 | "orientation" : "portrait",
142 | "idiom" : "iphone",
143 | "filename" : "Default@2x.png",
144 | "extent" : "full-screen",
145 | "scale" : "2x"
146 | },
147 | {
148 | "orientation" : "portrait",
149 | "idiom" : "iphone",
150 | "filename" : "Default-568h@2x.png",
151 | "extent" : "full-screen",
152 | "subtype" : "retina4",
153 | "scale" : "2x"
154 | },
155 | {
156 | "orientation" : "portrait",
157 | "idiom" : "ipad",
158 | "extent" : "to-status-bar",
159 | "scale" : "1x"
160 | },
161 | {
162 | "orientation" : "portrait",
163 | "idiom" : "ipad",
164 | "filename" : "Default-Portrait.png",
165 | "extent" : "full-screen",
166 | "scale" : "1x"
167 | },
168 | {
169 | "orientation" : "landscape",
170 | "idiom" : "ipad",
171 | "extent" : "to-status-bar",
172 | "scale" : "1x"
173 | },
174 | {
175 | "orientation" : "landscape",
176 | "idiom" : "ipad",
177 | "filename" : "Default-Landscape.png",
178 | "extent" : "full-screen",
179 | "scale" : "1x"
180 | },
181 | {
182 | "orientation" : "portrait",
183 | "idiom" : "ipad",
184 | "extent" : "to-status-bar",
185 | "scale" : "2x"
186 | },
187 | {
188 | "orientation" : "portrait",
189 | "idiom" : "ipad",
190 | "filename" : "Default-Portrait@2x.png",
191 | "extent" : "full-screen",
192 | "scale" : "2x"
193 | },
194 | {
195 | "orientation" : "landscape",
196 | "idiom" : "ipad",
197 | "extent" : "to-status-bar",
198 | "scale" : "2x"
199 | },
200 | {
201 | "orientation" : "landscape",
202 | "idiom" : "ipad",
203 | "filename" : "Default-Landscape@2x.png",
204 | "extent" : "full-screen",
205 | "scale" : "2x"
206 | }
207 | ],
208 | "info" : {
209 | "version" : 1,
210 | "author" : "xcode"
211 | }
212 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/demo/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 | "filename" : "LaunchScreen.AspectFill@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png
--------------------------------------------------------------------------------
/demo/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 | "filename" : "LaunchScreen.Center@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png
--------------------------------------------------------------------------------
/demo/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 |
--------------------------------------------------------------------------------
/demo/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 |
--------------------------------------------------------------------------------
/demo/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. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/demo/app/app.css:
--------------------------------------------------------------------------------
1 | .title {
2 | font-size: 30;
3 | horizontal-align: center;
4 | margin: 20;
5 | }
6 |
7 | button {
8 | font-size: 42;
9 | horizontal-align: center;
10 | }
11 |
12 | .message {
13 | font-size: 20;
14 | color: #284848;
15 | horizontal-align: center;
16 | margin: 0 20;
17 | text-align: center;
18 | }
19 |
--------------------------------------------------------------------------------
/demo/app/app.js:
--------------------------------------------------------------------------------
1 | var application = require('tns-core-modules/application');
2 | application.start({ moduleName: 'main-page' });
3 |
--------------------------------------------------------------------------------
/demo/app/images/nativescript.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/demo/app/images/nativescript.png
--------------------------------------------------------------------------------
/demo/app/images/nativescript.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/demo/app/images/spider-test.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/app/images/spider.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
63 |
64 |
--------------------------------------------------------------------------------
/demo/app/main-page.js:
--------------------------------------------------------------------------------
1 | var createViewModel = require('./main-view-model').createViewModel;
2 |
3 | function onNavigatingTo(args) {
4 | var page = args.object;
5 | page.bindingContext = createViewModel();
6 | }
7 | exports.onNavigatingTo = onNavigatingTo;
8 |
--------------------------------------------------------------------------------
/demo/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/demo/app/main-view-model.js:
--------------------------------------------------------------------------------
1 | const Observable = require('tns-core-modules/data/observable').Observable;
2 | const SVG = require('@teammaestro/nativescript-svg');
3 | const svgParser = new SVG.ImageSourceSVG();
4 |
5 | function getMessage(counter) {
6 | if (counter <= 0) {
7 | return 'Hoorraaay! You unlocked the NativeScript clicker achievement!';
8 | } else {
9 | return counter + ' taps left';
10 | }
11 | }
12 |
13 | function createViewModel() {
14 | const loaded = svgParser.fromResource('images/spider-test.svg');
15 | if (loaded) {
16 | console.log('object loaded');
17 | } else {
18 | console.log('error');
19 | }
20 |
21 | // var loaded = svgParser.loadFromFile('~/images/spider-test.svg');
22 | const viewModel = new Observable();
23 | viewModel.counter = 42;
24 | viewModel.message = getMessage(viewModel.counter);
25 |
26 | viewModel.message2 = loaded ? 'there is object' : "there isn't object";
27 |
28 | viewModel.onTap = function() {
29 | // this.set("svgSrc", '~/images/nativescript.svg');
30 | this.counter--;
31 | this.set('message', getMessage(this.counter));
32 | };
33 |
34 | return viewModel;
35 | }
36 |
37 | exports.createViewModel = createViewModel;
38 |
--------------------------------------------------------------------------------
/demo/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "android": {
3 | "v8Flags": "--expose_gc",
4 | "markingMode": "none"
5 | },
6 | "main": "app.js",
7 | "name": "tns-template-hello-world",
8 | "version": "3.2.0"
9 | }
10 |
--------------------------------------------------------------------------------
/demo/app/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Enable smart suggestions and completions in Visual Studio Code JavaScript projects.
2 |
--------------------------------------------------------------------------------
/demo/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "paths": {
5 | "*": ["./node_modules/tns-core-modules/*", "./node_modules/*"],
6 | "~/*": ["app/*"]
7 | }
8 | },
9 | "include": ["app/**/*"]
10 | }
11 |
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "org.nativescript.demo3",
8 | "tns-ios": {
9 | "version": "5.3.0"
10 | }
11 | },
12 | "dependencies": {
13 | "@teammaestro/nativescript-svg": "file:../src",
14 | "tns-core-modules": "~5.3.1"
15 | },
16 | "devDependencies": {
17 | "nativescript-dev-webpack": "^0.21.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/demo/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep } = 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 | const hashSalt = Date.now().toString();
12 |
13 | module.exports = env => {
14 | // Add your custom Activities, Services and other android app components here.
15 | const appComponents = [
16 | "tns-core-modules/ui/frame",
17 | "tns-core-modules/ui/frame/activity",
18 | ];
19 |
20 | const platform = env && (env.android && "android" || env.ios && "ios");
21 | if (!platform) {
22 | throw new Error("You need to provide a target platform!");
23 | }
24 |
25 | const platforms = ["ios", "android"];
26 | const projectRoot = __dirname;
27 |
28 | // Default destination inside platforms//...
29 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
30 | const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";
31 |
32 | const {
33 | // The 'appPath' and 'appResourcesPath' values are fetched from
34 | // the nsconfig.json configuration file
35 | // when bundling with `tns run android|ios --bundle`.
36 | appPath = "app",
37 | appResourcesPath = "app/App_Resources",
38 |
39 | // You can provide the following flags when running 'tns run android|ios'
40 | snapshot, // --env.snapshot
41 | uglify, // --env.uglify
42 | report, // --env.report
43 | sourceMap, // --env.sourceMap
44 | hmr, // --env.hmr,
45 | unitTesting, // --env.unitTesting
46 | } = env;
47 | const externals = nsWebpack.getConvertedExternals(env.externals);
48 |
49 | const appFullPath = resolve(projectRoot, appPath);
50 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
51 |
52 | const entryModule = nsWebpack.getEntryModule(appFullPath);
53 | const entryPath = `.${sep}${entryModule}.js`;
54 | const entries = { bundle: entryPath };
55 | if (platform === "ios") {
56 | entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
57 | };
58 |
59 | const config = {
60 | mode: uglify ? "production" : "development",
61 | context: appFullPath,
62 | externals,
63 | watchOptions: {
64 | ignored: [
65 | appResourcesFullPath,
66 | // Don't watch hidden files
67 | "**/.*",
68 | ]
69 | },
70 | target: nativescriptTarget,
71 | entry: entries,
72 | output: {
73 | pathinfo: false,
74 | path: dist,
75 | libraryTarget: "commonjs2",
76 | filename: "[name].js",
77 | globalObject: "global",
78 | hashSalt
79 | },
80 | resolve: {
81 | extensions: [".js", ".scss", ".css"],
82 | // Resolve {N} system modules from tns-core-modules
83 | modules: [
84 | "node_modules/tns-core-modules",
85 | "node_modules",
86 | ],
87 | alias: {
88 | '~': appFullPath
89 | },
90 | // don't resolve symlinks to symlinked modules
91 | symlinks: false
92 | },
93 | resolveLoader: {
94 | // don't resolve symlinks to symlinked loaders
95 | symlinks: false
96 | },
97 | node: {
98 | // Disable node shims that conflict with NativeScript
99 | "http": false,
100 | "timers": false,
101 | "setImmediate": false,
102 | "fs": "empty",
103 | "__dirname": false,
104 | },
105 | devtool: sourceMap ? "inline-source-map" : "none",
106 | optimization: {
107 | runtimeChunk: "single",
108 | splitChunks: {
109 | cacheGroups: {
110 | vendor: {
111 | name: "vendor",
112 | chunks: "all",
113 | test: (module, chunks) => {
114 | const moduleName = module.nameForCondition ? module.nameForCondition() : '';
115 | return /[\\/]node_modules[\\/]/.test(moduleName) ||
116 | appComponents.some(comp => comp === moduleName);
117 |
118 | },
119 | enforce: true,
120 | },
121 | }
122 | },
123 | minimize: !!uglify,
124 | minimizer: [
125 | new UglifyJsPlugin({
126 | parallel: true,
127 | cache: true,
128 | uglifyOptions: {
129 | output: {
130 | comments: false,
131 | },
132 | compress: {
133 | // The Android SBG has problems parsing the output
134 | // when these options are enabled
135 | 'collapse_vars': platform !== "android",
136 | sequences: platform !== "android",
137 | }
138 | }
139 | })
140 | ],
141 | },
142 | module: {
143 | rules: [
144 | {
145 | test: nsWebpack.getEntryPathRegExp(appFullPath, entryPath),
146 | use: [
147 | // Require all Android app components
148 | platform === "android" && {
149 | loader: "nativescript-dev-webpack/android-app-components-loader",
150 | options: { modules: appComponents }
151 | },
152 |
153 | {
154 | loader: "nativescript-dev-webpack/bundle-config-loader",
155 | options: {
156 | loadCss: !snapshot, // load the application css if in debug mode
157 | unitTesting,
158 | appFullPath,
159 | projectRoot,
160 | }
161 | },
162 | ].filter(loader => !!loader)
163 | },
164 |
165 | {
166 | test: /-page\.js$/,
167 | use: "nativescript-dev-webpack/script-hot-loader"
168 | },
169 |
170 | {
171 | test: /\.(css|scss)$/,
172 | use: "nativescript-dev-webpack/style-hot-loader"
173 | },
174 |
175 | {
176 | test: /\.(html|xml)$/,
177 | use: "nativescript-dev-webpack/markup-hot-loader"
178 | },
179 |
180 | { test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
181 |
182 | {
183 | test: /\.css$/,
184 | use: { loader: "css-loader", options: { minimize: false, url: false } }
185 | },
186 |
187 | {
188 | test: /\.scss$/,
189 | use: [
190 | { loader: "css-loader", options: { minimize: false, url: false } },
191 | "sass-loader"
192 | ]
193 | },
194 | ]
195 | },
196 | plugins: [
197 | // Define useful constants like TNS_WEBPACK
198 | new webpack.DefinePlugin({
199 | "global.TNS_WEBPACK": "true",
200 | "process": undefined,
201 | }),
202 | // Remove all files from the out dir.
203 | new CleanWebpackPlugin([ `${dist}/**/*` ]),
204 | // Copy assets to out dir. Add your own globs as needed.
205 | new CopyWebpackPlugin([
206 | { from: { glob: "fonts/**" } },
207 | { from: { glob: "**/*.jpg" } },
208 | { from: { glob: "**/*.svg" } },
209 | { from: { glob: "**/*.png" } },
210 | ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
211 | // Generate a bundle starter script and activate it in package.json
212 | new nsWebpack.GenerateBundleStarterPlugin(
213 | // Don't include `runtime.js` when creating a snapshot. The plugin
214 | // configures the WebPack runtime to be generated inside the snapshot
215 | // module and no `runtime.js` module exist.
216 | (snapshot ? [] : ["./runtime"])
217 | .concat([
218 | "./vendor",
219 | "./bundle",
220 | ])
221 | ),
222 | // For instructions on how to set up workers with webpack
223 | // check out https://github.com/nativescript/worker-loader
224 | new NativeScriptWorkerPlugin(),
225 | new nsWebpack.PlatformFSPlugin({
226 | platform,
227 | platforms,
228 | }),
229 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
230 | new nsWebpack.WatchStateLoggerPlugin(),
231 | ],
232 | };
233 |
234 | // Copy the native app resources to the out dir
235 | // only if doing a full build (tns run/build) and not previewing (tns preview)
236 | if (!externals || externals.length === 0) {
237 | config.plugins.push(new CopyWebpackPlugin([
238 | {
239 | from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
240 | to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
241 | context: projectRoot
242 | },
243 | ]));
244 | }
245 |
246 | if (report) {
247 | // Generate report files for bundles content
248 | config.plugins.push(new BundleAnalyzerPlugin({
249 | analyzerMode: "static",
250 | openAnalyzer: false,
251 | generateStatsFile: true,
252 | reportFilename: resolve(projectRoot, "report", `report.html`),
253 | statsFilename: resolve(projectRoot, "report", `stats.json`),
254 | }));
255 | }
256 |
257 | if (snapshot) {
258 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
259 | chunk: "vendor",
260 | requireModules: [
261 | "tns-core-modules/bundle-entry-points",
262 | ],
263 | projectRoot,
264 | webpackConfig: config,
265 | }));
266 | }
267 |
268 | if (hmr) {
269 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
270 | }
271 |
272 |
273 | return config;
274 | };
275 |
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | # generated files
2 | .vs
3 | .vs/
4 | .sln
5 | *.sln
6 | demo/
7 | screens/
8 | node_modules/
9 | typings/
10 |
11 | *.ts
12 | !*.d.ts
13 | *.map
14 | tsconfig.json
15 | scripts/*
16 | platforms/android/*
17 | !platforms/android/include.gradle
18 | !platforms/android/*.aar
19 | !platforms/android/*.jar
20 | references.d.ts
21 |
--------------------------------------------------------------------------------
/src/angular/index.d.ts:
--------------------------------------------------------------------------------
1 | export * from './nativescript-svg-module';
2 |
--------------------------------------------------------------------------------
/src/angular/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | function __export(m) {
3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4 | }
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | __export(require("./nativescript-svg-module"));
7 | //# sourceMappingURL=index.js.map
--------------------------------------------------------------------------------
/src/angular/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;AAAA,+CAA0C"}
--------------------------------------------------------------------------------
/src/angular/index.ts:
--------------------------------------------------------------------------------
1 | export * from './nativescript-svg-module';
2 |
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-directives.d.ts:
--------------------------------------------------------------------------------
1 | export declare class SVGImageDirective {
2 | }
3 | export declare const DIRECTIVES: (typeof SVGImageDirective)[];
4 |
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-directives.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var core_1 = require("@angular/core");
4 | var SVGImageDirective = (function () {
5 | function SVGImageDirective() {
6 | }
7 | SVGImageDirective = __decorate([
8 | core_1.Directive({
9 | selector: 'SVGImage'
10 | })
11 | ], SVGImageDirective);
12 | return SVGImageDirective;
13 | }());
14 | exports.SVGImageDirective = SVGImageDirective;
15 | exports.DIRECTIVES = [SVGImageDirective];
16 | //# sourceMappingURL=nativescript-svg-directives.js.map
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-directives.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"nativescript-svg-directives.js","sourceRoot":"","sources":["nativescript-svg-directives.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAK1C;IAAA;IAAgC,CAAC;IAApB,iBAAiB;QAH7B,gBAAS,CAAC;YACT,QAAQ,EAAE,UAAU;SACrB,CAAC;OACW,iBAAiB,CAAG;IAAD,wBAAC;CAAA,AAAjC,IAAiC;AAApB,8CAAiB;AAEjB,QAAA,UAAU,GAAG,CAAC,iBAAiB,CAAC,CAAC"}
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-directives.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core'; // TODO: check require .Directive without hacks
2 |
3 | @Directive({
4 | selector: 'SVGImage'
5 | })
6 | export class SVGImageDirective {}
7 |
8 | export const DIRECTIVES = [SVGImageDirective];
9 |
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-module.d.ts:
--------------------------------------------------------------------------------
1 | export declare class NativeScriptSvgModule {
2 | }
3 |
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-module.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var core_1 = require("@angular/core");
4 | var element_registry_1 = require("nativescript-angular/element-registry");
5 | var nativescript_svg_directives_1 = require("./nativescript-svg-directives");
6 | var NativeScriptSvgModule = (function () {
7 | function NativeScriptSvgModule() {
8 | }
9 | NativeScriptSvgModule = __decorate([
10 | core_1.NgModule({
11 | declarations: [nativescript_svg_directives_1.DIRECTIVES],
12 | exports: [nativescript_svg_directives_1.DIRECTIVES]
13 | })
14 | ], NativeScriptSvgModule);
15 | return NativeScriptSvgModule;
16 | }());
17 | exports.NativeScriptSvgModule = NativeScriptSvgModule;
18 | element_registry_1.registerElement('SVGImage', function () { return require('../').SVGImage; });
19 | //# sourceMappingURL=nativescript-svg-module.js.map
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-module.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"nativescript-svg-module.js","sourceRoot":"","sources":["nativescript-svg-module.ts"],"names":[],"mappings":";;AAAA,sCAAyC;AACzC,0EAAwE;AAExE,6EAA2D;AAM3D;IAAA;IAAoC,CAAC;IAAxB,qBAAqB;QAJjC,eAAQ,CAAC;YACR,YAAY,EAAE,CAAC,wCAAU,CAAC;YAC1B,OAAO,EAAE,CAAC,wCAAU,CAAC;SACtB,CAAC;OACW,qBAAqB,CAAG;IAAD,4BAAC;CAAA,AAArC,IAAqC;AAAxB,sDAAqB;AAElC,kCAAe,CAAC,UAAU,EAAE,cAAM,OAAA,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAvB,CAAuB,CAAC,CAAC"}
--------------------------------------------------------------------------------
/src/angular/nativescript-svg-module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { registerElement } from 'nativescript-angular/element-registry';
3 |
4 | import { DIRECTIVES } from './nativescript-svg-directives';
5 |
6 | @NgModule({
7 | declarations: [DIRECTIVES],
8 | exports: [DIRECTIVES]
9 | })
10 | export class NativeScriptSvgModule {}
11 |
12 | registerElement('SVGImage', () => require('../').SVGImage);
13 |
--------------------------------------------------------------------------------
/src/angular/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-svg",
3 | "main": "index.js"
4 | }
5 |
--------------------------------------------------------------------------------
/src/hooks/before-livesync/nativescript-angular-sync.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-angular/hooks/before-livesync");
2 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@teammaestro/nativescript-svg",
3 | "version": "1.0.1",
4 | "description": "NativeScript SVG plugin",
5 | "main": "svg",
6 | "typings": "svg.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "android": "3.0.0",
10 | "ios": "3.0.0"
11 | }
12 | },
13 | "scripts": {
14 | "tsc": "tsc -skipLibCheck",
15 | "build": "npm i && tsc",
16 | "test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
17 | "test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
18 | "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude \"*demo*/platforms/**\"",
19 | "plugin.link": "npm link && cd ../demo && npm link nativescript-geolocation && cd ../src",
20 | "plugin.tscwatch": "npm run tsc -- -w",
21 | "demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios --syncAllFiles",
22 | "demo.android": "npm i && npm run tsc && cd ../demo && tns run android --syncAllFiles",
23 | "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
24 | "precommit": "lint-staged",
25 | "development.setup": "npm run setup && npm link && cd ../demo && npm link nativescript-svg && cd ../src",
26 | "generate.typings.ios": "cd ../demo && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" tns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" tns build ios && echo 'Now look for your library typings in demo/typings!'"
27 | },
28 | "lint-staged": {
29 | "*.ts, *.js, *.css, *.scss, *.md, *.html, *.xml": [
30 | "prettier --write",
31 | "git add"
32 | ]
33 | },
34 | "repository": {
35 | "type": "git",
36 | "url": "https://github.com/peoplewareDo/nativescript-svg.git"
37 | },
38 | "keywords": [
39 | "NativeScript",
40 | "JavaScript",
41 | "Android",
42 | "iOS",
43 | "svg"
44 | ],
45 | "author": {
46 | "name": "Victor Sosa",
47 | "email": "victor.sosa@peopleware.do"
48 | },
49 | "contributors": [
50 | {
51 | "name": "Brad Martin",
52 | "email": "bmartin@nstudio.io",
53 | "url": "https://github.com/bradmartin"
54 | }
55 | ],
56 | "bugs": {
57 | "url": "https://github.com/peoplewareDo/nativescript-svg/issues"
58 | },
59 | "license": "MIT",
60 | "homepage": "https://github.com/peoplewareDo/nativescript-svg",
61 | "readmeFilename": "README.md",
62 | "devDependencies": {
63 | "nativescript-angular": "~7.2.3",
64 | "@angular/core": "~7.2.0",
65 | "@angular/common": "~7.2.0",
66 | "@angular/compiler": "~7.2.0",
67 | "@angular/compiler-cli": "~7.2.0",
68 | "rxjs": "~6.4.0",
69 | "zone.js": "~0.8.4",
70 | "husky": "^1.3.1",
71 | "lint-staged": "^8.1.4",
72 | "prettier": "^1.16.4",
73 | "rimraf": "^2.6.3",
74 | "tns-core-modules": "~5.3.0",
75 | "tns-platform-declarations": "~5.3.0",
76 | "typescript": "~3.1.6",
77 | "tslint": "~5.14.0"
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/platforms/android/androidsvg-release.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bradmartin/nativescript-svg/b3ae8d6d491e570723552be915f23e24c0de8ca1/src/platforms/android/androidsvg-release.aar
--------------------------------------------------------------------------------
/src/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '3.x'
--------------------------------------------------------------------------------
/src/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src/svg.android.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import svg = require('./svg');
3 | import common = require('./svg.common');
4 | export declare class ImageSourceSVG implements svg.ImageSourceSVG {
5 | private nativeView;
6 | loadFromResource(name: string): boolean;
7 | fromResource(name: string): Promise;
8 | loadFromFile(path: string): boolean;
9 | fromFile(path: string): Promise;
10 | loadFromData(data: any): boolean;
11 | fromData(data: any): Promise;
12 | loadFromBase64(source: string): boolean;
13 | fromBase64(data: any): Promise;
14 | fromUrl(url: string): Promise;
15 | setNativeSource(source: any): boolean;
16 | saveToFile(path: string): boolean;
17 | toBase64String(format: string): string;
18 | readonly height: number;
19 | readonly width: number;
20 | }
21 | export declare class SVGImage extends common.SVGImage {
22 | constructor();
23 | createNativeView(): any;
24 | _setNativeImage(nativeImage: any): void;
25 | }
26 |
--------------------------------------------------------------------------------
/src/svg.android.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import svg = require('./svg');
4 | import common = require('./svg.common');
5 | import types = require('tns-core-modules/utils/types');
6 | import * as utilsModule from 'tns-core-modules/utils/utils';
7 | import * as fileSystemModule from 'tns-core-modules/file-system';
8 | import * as httpModule from 'tns-core-modules/http';
9 |
10 | let http: typeof httpModule;
11 | function ensureHttp() {
12 | if (!http) {
13 | http = require('http');
14 | }
15 | }
16 |
17 | global.moduleMerge(common, exports);
18 |
19 | let utils: typeof utilsModule;
20 | function ensureUtils() {
21 | if (!utils) {
22 | utils = require('utils/utils');
23 | }
24 | }
25 |
26 | let fs: typeof fileSystemModule;
27 | function ensureFS() {
28 | if (!fs) {
29 | fs = require('file-system');
30 | }
31 | }
32 |
33 | declare let com: any;
34 |
35 | export class ImageSourceSVG implements svg.ImageSourceSVG {
36 | private nativeView: any;
37 |
38 | public loadFromResource(name: string): boolean {
39 | this.nativeView = null;
40 |
41 | ensureUtils();
42 |
43 | const res = utils.ad.getApplicationContext().getResources();
44 | if (res) {
45 | const identifier: number = res.getIdentifier(
46 | name,
47 | 'drawable',
48 | utils.ad.getApplication().getPackageName()
49 | );
50 | if (0 < identifier) {
51 | // Load SVG
52 | this.nativeView = com.caverock.androidsvg.SVG.getFromResource(
53 | res,
54 | identifier
55 | );
56 | }
57 | }
58 |
59 | return this.nativeView != null;
60 | }
61 |
62 | public fromResource(name: string): Promise {
63 | return new Promise((resolve, reject) => {
64 | resolve(this.loadFromResource(name));
65 | });
66 | }
67 |
68 | public loadFromFile(path: string): boolean {
69 | ensureFS();
70 |
71 | let fileName = types.isString(path) ? path.trim() : '';
72 | if (fileName.indexOf('~/') === 0) {
73 | fileName = fs.path.join(
74 | fs.knownFolders.currentApp().path,
75 | fileName.replace('~/', '')
76 | );
77 | }
78 |
79 | this.nativeView = com.caverock.androidsvg.SVG.getFromInputStream(
80 | new java.io.FileInputStream(new java.io.File(fileName))
81 | );
82 | return this.nativeView != null;
83 | }
84 |
85 | public fromFile(path: string): Promise {
86 | return new Promise((resolve, reject) => {
87 | resolve(this.loadFromFile(path));
88 | });
89 | }
90 |
91 | public loadFromData(data: any): boolean {
92 | this.nativeView = com.caverock.androidsvg.SVG.getFromString(data);
93 | return this.nativeView != null;
94 | }
95 |
96 | public fromData(data: any): Promise {
97 | return new Promise((resolve, reject) => {
98 | resolve(this.loadFromData(data));
99 | });
100 | }
101 |
102 | public loadFromBase64(source: string): boolean {
103 | const bytes = android.util.Base64.decode(
104 | source,
105 | android.util.Base64.DEFAULT
106 | );
107 | this.nativeView = com.caverock.androidsvg.SVG.getFromString(
108 | new java.lang.String(bytes)
109 | );
110 | return this.nativeView != null;
111 | }
112 |
113 | public fromBase64(data: any): Promise {
114 | return new Promise((resolve, reject) => {
115 | resolve(this.loadFromBase64(data));
116 | });
117 | }
118 |
119 | public fromUrl(url: string): Promise {
120 | ensureHttp();
121 | const result = http.getString(url);
122 | return new Promise((resolve, reject) => {
123 | result
124 | .then(val => {
125 | this.setNativeSource(com.caverock.androidsvg.SVG.getFromString(val));
126 | resolve(true);
127 | })
128 | .catch(e => {
129 | reject(false);
130 | });
131 | });
132 | }
133 |
134 | public setNativeSource(source: any): boolean {
135 | this.nativeView = source;
136 | return source != null;
137 | }
138 |
139 | public saveToFile(path: string): boolean {
140 | // TODO to be implemented
141 | return false;
142 | }
143 |
144 | public toBase64String(format: string): string {
145 | if (!this.nativeView) {
146 | return null;
147 | }
148 |
149 | return android.util.Base64.encodeToString(
150 | format as any, // look into this and why it was setup as string arg
151 | android.util.Base64.DEFAULT
152 | );
153 | }
154 |
155 | get height(): number {
156 | if (this.nativeView) {
157 | return this.nativeView.getPitcture().getHeight();
158 | }
159 |
160 | return NaN;
161 | }
162 |
163 | get width(): number {
164 | if (this.nativeView) {
165 | return this.nativeView.getPitcture().getWidth();
166 | }
167 |
168 | return NaN;
169 | }
170 | }
171 |
172 | export class SVGImage extends common.SVGImage {
173 | constructor() {
174 | super();
175 | }
176 |
177 | public createNativeView() {
178 | return new com.caverock.androidsvg.SVGImageView(this._context);
179 | }
180 |
181 | public _setNativeImage(nativeImage: any) {
182 | this.nativeView.setSVG(nativeImage.nativeView);
183 | }
184 |
185 | [common.imageSourceProperty.setNative](value: any) {
186 | const image = value;
187 |
188 | if (!image || !image.nativeView) {
189 | return;
190 | }
191 |
192 | this._setNativeImage(image);
193 | }
194 | }
195 |
--------------------------------------------------------------------------------
/src/svg.common.d.ts:
--------------------------------------------------------------------------------
1 | import { View, Property } from 'tns-core-modules/ui/core/view';
2 | import * as definition from './svg';
3 | export declare const srcProperty: Property;
4 | export declare const imageSourceProperty: Property;
5 | export declare const isLoadingProperty: Property;
6 | export declare const loadModeProperty: Property;
7 | export declare class SVGImage extends View implements definition.SVGImage {
8 | src: any;
9 | imageSource: definition.ImageSourceSVG;
10 | isLoading: boolean;
11 | loadMode: 'sync' | 'async';
12 | constructor(options?: definition.Options);
13 | _createImageSourceFromSrc(): void;
14 | }
15 | export declare function fromResource(name: string): definition.ImageSourceSVG;
16 | export declare function fromFile(path: string): definition.ImageSourceSVG;
17 | export declare function fromData(data: any): definition.ImageSourceSVG;
18 | export declare function fromBase64(source: string): definition.ImageSourceSVG;
19 | export declare function fromNativeSource(source: any): definition.ImageSourceSVG;
20 | export declare function fromUrl(url: string): definition.ImageSourceSVG;
21 | export declare function fromFileOrResource(path: string): definition.ImageSourceSVG;
22 | export declare function isFileOrResourcePath(path: string): boolean;
23 |
--------------------------------------------------------------------------------
/src/svg.common.ts:
--------------------------------------------------------------------------------
1 | import { View, Property } from 'tns-core-modules/ui/core/view';
2 | import * as utils from 'tns-core-modules/utils/utils';
3 | import * as types from 'tns-core-modules/utils/types';
4 |
5 | // This is used for definition purposes only, it does not generate JavaScript for it.
6 | import * as definition from './svg';
7 |
8 | const SRC = 'src';
9 | const IMAGE_SOURCE = 'imageSource';
10 | const LOAD_MODE = 'loadMode';
11 | const SYNC = 'sync';
12 | const ASYNC = 'async';
13 | const ISLOADING = 'isLoading';
14 |
15 | export const srcProperty = new Property({
16 | name: SRC,
17 | defaultValue: undefined,
18 | valueChanged: (target, oldValue, newValue) =>
19 | target._createImageSourceFromSrc()
20 | });
21 | export const imageSourceProperty = new Property<
22 | SVGImage,
23 | definition.ImageSourceSVG
24 | >({ name: IMAGE_SOURCE, defaultValue: undefined });
25 | export const isLoadingProperty = new Property({
26 | name: ISLOADING,
27 | defaultValue: false
28 | });
29 | export const loadModeProperty = new Property({
30 | name: LOAD_MODE,
31 | defaultValue: SYNC
32 | });
33 |
34 | export class SVGImage extends View implements definition.SVGImage {
35 | src: any;
36 | imageSource: definition.ImageSourceSVG;
37 | isLoading: boolean;
38 | loadMode: 'sync' | 'async';
39 |
40 | constructor(options?: definition.Options) {
41 | // super(options);
42 | super();
43 | }
44 |
45 | /**
46 | * @internal
47 | */
48 | _createImageSourceFromSrc(): void {
49 | let value = this.src;
50 | if (types.isString(value)) {
51 | value = value.trim();
52 | this.imageSource = null;
53 | this['_url'] = value;
54 |
55 | // this._setValue(SVGImage.isLoadingProperty, true);
56 | this.isLoading = true;
57 |
58 | const source = new definition.ImageSourceSVG();
59 | const imageLoaded = () => {
60 | const currentValue = this.src;
61 | if (!types.isString(this.src) || value !== currentValue.trim()) {
62 | return;
63 | }
64 | this.imageSource = source;
65 | // imageSourceProperty.nativeValueChange(this, source);
66 | // this._setValue(SVGImage.isLoadingProperty, false);
67 | this.isLoading = false;
68 | };
69 | // WRONG IMplementation, it can't load data uri, just base xml encode
70 | if (utils.isDataURI(value)) {
71 | const base64Data = value.split(',')[1];
72 | if (types.isDefined(base64Data)) {
73 | if (this.loadMode === SYNC) {
74 | source.loadFromBase64(base64Data);
75 | imageLoaded();
76 | } else if (this.loadMode === ASYNC) {
77 | source.fromBase64(base64Data).then(imageLoaded);
78 | }
79 | }
80 | } else if (definition.isFileOrResourcePath(value)) {
81 | if (value.indexOf(utils.RESOURCE_PREFIX) === 0) {
82 | const resPath = value.substr(utils.RESOURCE_PREFIX.length);
83 | if (this.loadMode === SYNC) {
84 | source.loadFromResource(resPath);
85 | imageLoaded();
86 | } else if (this.loadMode === ASYNC) {
87 | this.imageSource = null;
88 | source.fromResource(resPath).then(imageLoaded);
89 | }
90 | } else {
91 | if (this.loadMode === SYNC) {
92 | source.loadFromFile(value);
93 | imageLoaded();
94 | } else if (this.loadMode === ASYNC) {
95 | this.imageSource = null;
96 | source.fromFile(value).then(imageLoaded);
97 | }
98 | }
99 | } else {
100 | this.imageSource = null;
101 | definition.fromUrl(value).then(r => {
102 | if (this['_url'] === value) {
103 | this.imageSource = r;
104 | // this._setValue(SVGImage.isLoadingProperty, false);
105 | this.isLoading = false;
106 | }
107 | });
108 | }
109 | } else if (value instanceof definition.ImageSourceSVG) {
110 | // Support binding the imageSource trough the src property
111 | this.imageSource = value;
112 | // this._setValue(SVGImage.isLoadingProperty, false);
113 | this.isLoading = false;
114 | } else {
115 | this.imageSource = definition.fromNativeSource(value);
116 | // this._setValue(SVGImage.isLoadingProperty, false);
117 | this.isLoading = false;
118 | }
119 | }
120 | }
121 |
122 | export function fromResource(name: string): definition.ImageSourceSVG {
123 | const image = new definition.ImageSourceSVG();
124 | return image.loadFromResource(name) ? image : null;
125 | }
126 |
127 | export function fromFile(path: string): definition.ImageSourceSVG {
128 | const image = new definition.ImageSourceSVG();
129 | return image.loadFromFile(path) ? image : null;
130 | }
131 |
132 | export function fromData(data: any): definition.ImageSourceSVG {
133 | const image = new definition.ImageSourceSVG();
134 | return image.loadFromData(data) ? image : null;
135 | }
136 |
137 | export function fromBase64(source: string): definition.ImageSourceSVG {
138 | const image = new definition.ImageSourceSVG();
139 | return image.loadFromBase64(source) ? image : null;
140 | }
141 |
142 | export function fromNativeSource(source: any): definition.ImageSourceSVG {
143 | const image = new definition.ImageSourceSVG();
144 | return image.setNativeSource(source) ? image : null;
145 | }
146 |
147 | export function fromUrl(url: string): definition.ImageSourceSVG {
148 | const image = new definition.ImageSourceSVG();
149 | return image.fromUrl(url) ? image : null;
150 | }
151 |
152 | export function fromFileOrResource(path: string): definition.ImageSourceSVG {
153 | if (!isFileOrResourcePath(path)) {
154 | throw new Error('Path "' + '" is not a valid file or resource.');
155 | }
156 |
157 | if (path.indexOf(utils.RESOURCE_PREFIX) === 0) {
158 | return fromResource(path.substr(utils.RESOURCE_PREFIX.length));
159 | }
160 | return fromFile(path);
161 | }
162 |
163 | export function isFileOrResourcePath(path: string): boolean {
164 | return utils.isFileOrResourcePath(path);
165 | }
166 |
167 | srcProperty.register(SVGImage);
168 | imageSourceProperty.register(SVGImage);
169 | loadModeProperty.register(SVGImage);
170 | isLoadingProperty.register(SVGImage);
171 |
--------------------------------------------------------------------------------
/src/svg.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Allows you to parse SVG files.
3 | */
4 |
5 | import { Property } from 'tns-core-modules/ui/core/dependency-observable';
6 | import { View } from 'tns-core-modules/ui/core/view';
7 |
8 | /**
9 | * Represents a class that provides functionality for loading svg(s).
10 | */
11 | export class SVGImage extends View {
12 | public static srcProperty: Property;
13 | public static imageSourceProperty: Property;
14 | public static isLoadingProperty: Property;
15 |
16 | /**
17 | * Gets or sets the image source of the image.
18 | */
19 | imageSource: ImageSourceSVG;
20 |
21 | /**
22 | * Gets or sets the source of the svg. This can be either an URL string or a native svg instance.
23 | */
24 | src: any;
25 |
26 | /**
27 | * Gets a value indicating if the svg is currently loading
28 | */
29 | isLoading: boolean;
30 |
31 | /**
32 | * Gets or sets the loading strategy for images on the local file system:
33 | * - **sync** *(default)* - blocks the UI if necessary to display immediately, good for small icons.
34 | * - **async** - will try to load in the background, may appear with short delay, good for large images.
35 | */
36 | loadMode: string; // "sync" | "async";
37 | }
38 |
39 | /**
40 | * Provides common options for creating a animation
41 | */
42 | export interface Options {
43 | /**
44 | * Gets or sets the URL of the svg
45 | */
46 | src: string;
47 | }
48 |
49 | /**
50 | * Encapsulates the common abstraction behind a platform specific object SVG that is used as a source for images.
51 | */
52 | export class ImageSourceSVG {
53 | /**
54 | * Gets the height of this instance. This is a read-only property.
55 | */
56 | height: number;
57 |
58 | /**
59 | * Gets the width of this instance. This is a read-only property.
60 | */
61 | width: number;
62 |
63 | /**
64 | * Loads this instance from the specified resource name.
65 | * @param name The name of the resource (without its extension).
66 | */
67 | loadFromResource(name: string): boolean;
68 |
69 | /**
70 | * Loads this instance from the specified resource name asynchronously.
71 | * @param name The name of the resource (without its extension).
72 | */
73 | fromResource(name: string): Promise;
74 |
75 | /**
76 | * Loads this instance from the specified file.
77 | * @param path The location of the file on the file system.
78 | */
79 | loadFromFile(path: string): boolean;
80 |
81 | /**
82 | * Loads this instance from the specified file asynchronously.
83 | * @param path The location of the file on the file system.
84 | */
85 | fromFile(path: string): Promise;
86 |
87 | /**
88 | * Loads this instance from the specified native image data.
89 | * @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
90 | */
91 | loadFromData(data: any): boolean;
92 |
93 | /**
94 | * Loads this instance from the specified native image data asynchronously.
95 | * @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
96 | */
97 | fromData(data: any): Promise;
98 |
99 | /**
100 | * Loads this instance from the specified native image data.
101 | * @param source The Base64 string to load the image from.
102 | */
103 | loadFromBase64(source: string): boolean;
104 |
105 | /**
106 | * Loads this instance from the specified native image data asynchronously.
107 | * @param source The Base64 string to load the image from.
108 | */
109 | fromBase64(source: string): Promise;
110 |
111 | /**
112 | * Loads this instance from the specified url asynchronously.
113 | * @param url string to load the image from.
114 | */
115 | fromUrl(url: string): Promise;
116 |
117 | /**
118 | * Sets the provided native source object.
119 | * This will update either the android or ios properties, depending on the target os.
120 | * @param source The native image object. Will be either a svg for Android or a UIImage for iOS.
121 | */
122 | setNativeSource(source: any): boolean;
123 |
124 | /**
125 | * Saves this instance to the specified file, using the provided image format and quality.
126 | * @param path The path of the file on the file system to save to.
127 | */
128 | saveToFile(path: string): boolean;
129 |
130 | /**
131 | * Converts the image to base64 encoded string, using the provided image format and quality.
132 | * @param format The format (encoding) of the image.
133 | */
134 | toBase64String(format: string): string;
135 | }
136 |
137 | /**
138 | * Creates a new ImageSourceSVG instance and loads it from the specified resource name.
139 | * @param name The name of the resource (without its extension).
140 | */
141 | export function fromResource(name: string): ImageSourceSVG;
142 |
143 | /**
144 | * Creates a new ImageSourceSVG instance and loads it from the specified file.
145 | * @param path The location of the file on the file system.
146 | */
147 | export function fromFile(path: string): ImageSourceSVG;
148 |
149 | /**
150 | * Creates a new ImageSourceSVG instance and loads it from the specified resource name.
151 | * @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
152 | */
153 | export function fromData(data: any): ImageSourceSVG;
154 |
155 | /**
156 | * Creates a new ImageSourceSVG instance and loads it from the specified resource name.
157 | * @param source The Base64 string to load the image from.
158 | */
159 | export function fromBase64(source: string): ImageSourceSVG;
160 |
161 | /**
162 | * Creates a new ImageSourceSVG instance and sets the provided native source object.
163 | * The native source object will update either the android or ios properties, depending on the target os.
164 | * @param source The native image object. Will be either a Bitmap for Android or a UIImage for iOS.
165 | */
166 | export function fromNativeSource(source: any): ImageSourceSVG;
167 |
168 | /**
169 | * Downloads the image from the provided Url and creates a new ImageSourceSVG instance from it.
170 | * @param url The link to the remote image object. This operation will download and decode the image.
171 | */
172 | export function fromUrl(url: string): Promise;
173 |
174 | /**
175 | * Creates a new ImageSourceSVG instance and loads it from the specified local file or resource(if spexified with "res://" prefix)
176 | * @param path The location of the file on the file system.
177 | */
178 | export function fromFileOrResource(path: string): ImageSourceSVG;
179 |
180 | /**
181 | * [Obsolete. Please use utils.isFileOrResourcePath instead!] Returns true if the specified path points to a resource or local file.
182 | * @param path The path.
183 | */
184 | export function isFileOrResourcePath(path: string): boolean;
185 |
--------------------------------------------------------------------------------
/src/svg.ios.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import svg = require('./svg');
3 | import common = require('./svg.common');
4 | export declare class ImageSourceSVG implements svg.ImageSourceSVG {
5 | private nativeView;
6 | loadFromResource(name: string): boolean;
7 | fromResource(name: string): Promise;
8 | loadFromFile(path: string): boolean;
9 | fromFile(path: string): Promise;
10 | loadFromData(data: any): boolean;
11 | fromData(data: any): Promise;
12 | loadFromBase64(source: string): boolean;
13 | fromBase64(source: string): Promise;
14 | private loadFromUrl;
15 | fromUrl(url: string): Promise;
16 | setNativeSource(source: any): boolean;
17 | saveToFile(path: string): boolean;
18 | toBase64String(format: string): string;
19 | readonly height: number;
20 | readonly width: number;
21 | }
22 | export declare class SVGImage extends common.SVGImage {
23 | private _imageSourceAffectsLayout;
24 | constructor();
25 | _setNativeImage(nativeImage: any): void;
26 | onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
27 | }
28 |
--------------------------------------------------------------------------------
/src/svg.ios.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import svg = require('./svg');
4 | import common = require('./svg.common');
5 | import types = require('tns-core-modules/utils/types');
6 | import fs = require('tns-core-modules/file-system');
7 |
8 | global.moduleMerge(common, exports);
9 | declare var SVGKImage: any;
10 |
11 | export class ImageSourceSVG implements svg.ImageSourceSVG {
12 | private nativeView: any;
13 |
14 | public loadFromResource(name: string): boolean {
15 | this.nativeView =
16 | SVGKImage.imageNamed(name) || SVGKImage.imageNamed(`${name}.svg`);
17 | return this.nativeView != null;
18 | }
19 |
20 | public fromResource(name: string): Promise {
21 | return new Promise((resolve, reject) => {
22 | try {
23 | (SVGKImage).imageAsynchronouslyNamed(
24 | name,
25 | (image, parseResult) => {
26 | if (image) {
27 | this.nativeView = image;
28 | resolve(true);
29 | } else {
30 | (SVGKImage).imageAsynchronouslyNamed(
31 | `${name}.svg`,
32 | (image, parseResult) => {
33 | this.nativeView = image;
34 | resolve(true);
35 | }
36 | );
37 | }
38 | }
39 | );
40 | } catch (ex) {
41 | reject(ex);
42 | }
43 | });
44 | }
45 |
46 | public loadFromFile(path: string): boolean {
47 | let fileName = types.isString(path) ? path.trim() : '';
48 |
49 | if (fileName.indexOf('~/') === 0) {
50 | fileName = fs.path.join(
51 | fs.knownFolders.currentApp().path,
52 | fileName.replace('~/', '')
53 | );
54 | }
55 |
56 | this.nativeView = SVGKImage.imageWithContentsOfFile(fileName);
57 | return this.nativeView != null;
58 | }
59 |
60 | public fromFile(path: string): Promise {
61 | return new Promise((resolve, reject) => {
62 | try {
63 | let fileName = types.isString(path) ? path.trim() : '';
64 |
65 | if (fileName.indexOf('~/') === 0) {
66 | fileName = fs.path.join(
67 | fs.knownFolders.currentApp().path,
68 | fileName.replace('~/', '')
69 | );
70 | }
71 |
72 | (SVGKImage).imageWithContentsOfFileAsynchronously(
73 | fileName,
74 | image => {
75 | this.nativeView = image;
76 | resolve(true);
77 | }
78 | );
79 | } catch (ex) {
80 | reject(ex);
81 | }
82 | });
83 | }
84 |
85 | public loadFromData(data: any): boolean {
86 | this.nativeView = SVGKImage.imageWithData(data);
87 | return this.nativeView != null;
88 | }
89 |
90 | public fromData(data: any): Promise {
91 | return new Promise((resolve, reject) => {
92 | try {
93 | (SVGKImage).imageWithDataAsynchronously(data, image => {
94 | this.nativeView = image;
95 | resolve(true);
96 | });
97 | } catch (ex) {
98 | reject(ex);
99 | }
100 | });
101 | }
102 |
103 | public loadFromBase64(source: string): boolean {
104 | if (types.isString(source)) {
105 | const data = NSData.alloc().initWithBase64EncodedStringOptions(
106 | source,
107 | NSDataBase64DecodingOptions.IgnoreUnknownCharacters
108 | );
109 | this.nativeView = SVGKImage.imageWithData(data);
110 | }
111 | return this.nativeView != null;
112 | }
113 |
114 | public fromBase64(source: string): Promise {
115 | return new Promise((resolve, reject) => {
116 | try {
117 | const data = NSData.alloc().initWithBase64EncodedStringOptions(
118 | source,
119 | NSDataBase64DecodingOptions.IgnoreUnknownCharacters
120 | );
121 | SVGKImage.imageWithDataAsynchronously(data, image => {
122 | this.nativeView = image;
123 | resolve(true);
124 | });
125 | } catch (ex) {
126 | reject(ex);
127 | }
128 | });
129 | }
130 |
131 | private loadFromUrl(url: string): boolean {
132 | this.nativeView = SVGKImage.imageWithContentsOfURL(
133 | NSURL.URLWithString(url)
134 | );
135 |
136 | return this.nativeView != null;
137 | }
138 |
139 | public fromUrl(url: string): Promise {
140 | return new Promise((resolve, reject) => {
141 | resolve(this.loadFromUrl(url));
142 | });
143 | }
144 |
145 | public setNativeSource(source: any): boolean {
146 | this.nativeView = source;
147 | return source != null;
148 | }
149 |
150 | public saveToFile(path: string): boolean {
151 | if (!this.nativeView) {
152 | return false;
153 | }
154 |
155 | const data = getImageData(this.nativeView);
156 |
157 | // if (data) {
158 | // // return data.writeToFileAtomically(path, true);
159 | // }
160 |
161 | return false;
162 | }
163 |
164 | public toBase64String(format: string): string {
165 | const res = null;
166 | if (!this.nativeView) {
167 | return res;
168 | }
169 |
170 | const data = getImageData(this.nativeView);
171 |
172 | // if (data) {
173 | // // res = data.base64EncodedStringWithOptions(NSDataBase64EncodingOptions.Encoding64CharacterLineLength);
174 | // }
175 |
176 | return res;
177 | }
178 |
179 | get height(): number {
180 | if (this.nativeView) {
181 | return this.nativeView.size.height;
182 | }
183 |
184 | return NaN;
185 | }
186 |
187 | get width(): number {
188 | if (this.nativeView) {
189 | return this.nativeView.size.width;
190 | }
191 |
192 | return NaN;
193 | }
194 | }
195 |
196 | function getImageData(instance: any) {
197 | const buffer = instance.source.stream;
198 | // TODO fix issue, wrong type
199 | throw new Error('Not supported operation');
200 | // return NSData.alloc().initWithBytes(buffer, NSDataBase64DecodingOptions.NSDataBase64DecodingIgnoreUnknownCharacters);
201 | }
202 |
203 | declare var SVGKFastImageView: any;
204 |
205 | export class SVGImage extends common.SVGImage {
206 | private _imageSourceAffectsLayout: boolean = true;
207 |
208 | constructor() {
209 | super();
210 |
211 | // TODO: Think of unified way of setting all the default values.
212 | this.nativeView = SVGKFastImageView.alloc().initWithSVGKImage(
213 | new SVGKImage()
214 | );
215 | // this._ios.contentMode = UIViewContentMode.UIViewContentModeScaleAspectFit;
216 | // this._ios.clipsToBounds = true;
217 | // this._ios.userInteractionEnabled = true;
218 | }
219 |
220 | public _setNativeImage(nativeImage: any) {
221 | this.nativeView.image = nativeImage.nativeView;
222 |
223 | if (this._imageSourceAffectsLayout) {
224 | this.requestLayout();
225 | }
226 | }
227 |
228 | public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
229 | const utils = require('utils/utils');
230 |
231 | // We don't call super because we measure native view with specific size.
232 | const width = utils.layout.getMeasureSpecSize(widthMeasureSpec);
233 | const widthMode = utils.layout.getMeasureSpecMode(widthMeasureSpec);
234 |
235 | const height = utils.layout.getMeasureSpecSize(heightMeasureSpec);
236 | const heightMode = utils.layout.getMeasureSpecMode(heightMeasureSpec);
237 |
238 | const nativeWidth = this.imageSource ? this.imageSource.width : 0;
239 | const nativeHeight = this.imageSource ? this.imageSource.height : 0;
240 |
241 | let measureWidth = Math.max(nativeWidth, this.effectiveMinWidth);
242 | let measureHeight = Math.max(nativeHeight, this.effectiveMinHeight);
243 |
244 | const finiteWidth: boolean = widthMode !== utils.layout.UNSPECIFIED;
245 | const finiteHeight: boolean = heightMode !== utils.layout.UNSPECIFIED;
246 |
247 | this._imageSourceAffectsLayout =
248 | widthMode !== utils.layout.EXACTLY || heightMode !== utils.layout.EXACTLY;
249 |
250 | if (
251 | nativeWidth !== 0 &&
252 | nativeHeight !== 0 &&
253 | (finiteWidth || finiteHeight)
254 | ) {
255 | const resultW = nativeWidth;
256 | const resultH = nativeHeight;
257 |
258 | measureWidth = finiteWidth ? Math.min(resultW, width) : resultW;
259 | measureHeight = finiteHeight ? Math.min(resultH, height) : resultH;
260 |
261 | const trace = require('trace');
262 |
263 | if (trace.enabled) {
264 | trace.write(
265 | 'nativeWidth: ' + nativeWidth + ', nativeHeight: ' + nativeHeight,
266 | trace.categories.Layout
267 | );
268 | }
269 | }
270 |
271 | const view = require('ui/core/view');
272 |
273 | const widthAndState = view.View.resolveSizeAndState(
274 | measureWidth,
275 | width,
276 | widthMode,
277 | 0
278 | );
279 | const heightAndState = view.View.resolveSizeAndState(
280 | measureHeight,
281 | height,
282 | heightMode,
283 | 0
284 | );
285 |
286 | this.setMeasuredDimension(widthAndState, heightAndState);
287 | }
288 |
289 | [common.imageSourceProperty.setNative](value: any) {
290 | const image = value;
291 |
292 | if (!image || !image.nativeView) {
293 | return;
294 | }
295 |
296 | this._setNativeImage(image);
297 | }
298 | }
299 |
--------------------------------------------------------------------------------
/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "moduleResolution": "node",
6 | "removeComments": true,
7 | "declaration": true,
8 | "experimentalDecorators": true,
9 | "sourceMap": true,
10 | "skipLibCheck": true,
11 | "noLib": false,
12 | "noEmitHelpers": true,
13 | "allowUnreachableCode": false,
14 | "allowUnusedLabels": false,
15 | "noEmitOnError": false,
16 | "noImplicitAny": false,
17 | "noImplicitReturns": true,
18 | "noImplicitUseStrict": false,
19 | "noFallthroughCasesInSwitch": true,
20 | "lib": ["es6", "dom"],
21 | "baseUrl": ".",
22 | "paths": {
23 | "*": ["./node_modules/tns-core-modules/*", "./node_modules/*"]
24 | }
25 | },
26 | "exclude": ["node_modules", "platforms"],
27 | "include": [
28 | "svg.android.ts",
29 | "svg.common.ts",
30 | "svg.ios.ts",
31 | "./angular/index.ts",
32 | "./angular/nativescript-svg-directives.ts",
33 | "./angular/nativescript-svg-module.ts"
34 | ],
35 | "compileOnSave": false
36 | }
37 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "class-name": true,
4 | "comment-format": [true, "check-space"],
5 | "indent": [true, "spaces"],
6 | "no-duplicate-variable": true,
7 | "no-eval": true,
8 | "prefer-const": true,
9 | "no-internal-module": true,
10 | "no-trailing-whitespace": true,
11 | "no-var-keyword": true,
12 | "one-line": [true, "check-open-brace", "check-whitespace"],
13 | "quotemark": [false, "single"],
14 | "semicolon": [true, "always"],
15 | "triple-equals": [true, "allow-null-check"],
16 | "typedef-whitespace": [
17 | true,
18 | {
19 | "call-signature": "nospace",
20 | "index-signature": "nospace",
21 | "parameter": "nospace",
22 | "property-declaration": "nospace",
23 | "variable-declaration": "nospace"
24 | }
25 | ],
26 | "variable-name": [true, "ban-keywords"],
27 | "whitespace": [
28 | true,
29 | "check-branch",
30 | "check-decl",
31 | "check-operator",
32 | "check-separator",
33 | "check-type"
34 | ]
35 | }
36 | }
37 |
--------------------------------------------------------------------------------