├── .github
├── issue_template.md
├── pull_request_template.md
└── workflows
│ └── build.yml
├── .gitignore
├── .prettierrc
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── demo-angular
├── .gitignore
├── 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-v29
│ │ │ └── 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
│ │ ├── 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
├── nativescript.config.ts
├── package.json
├── src
│ ├── app.css
│ ├── app
│ │ ├── app-routing.module.ts
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── landing-page
│ │ │ ├── landing-page.component.html
│ │ │ └── landing-page.component.ts
│ │ ├── page-two
│ │ │ ├── page-two.component.html
│ │ │ └── page-two.component.ts
│ │ └── services
│ │ │ ├── loading-indicator.service.ts
│ │ │ └── test-nav.service.ts
│ └── main.ts
├── tsconfig.json
└── webpack.config.js
├── demo
├── .npmrc
├── app
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── app.gradle
│ │ │ └── src
│ │ │ │ └── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ ├── logo.png
│ │ │ │ └── nstudio.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-nodpi
│ │ │ │ └── splash_screen.xml
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── checkmark.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── values-v21
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ └── iOS
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── icon-29.png
│ │ │ │ ├── icon-29@2x.png
│ │ │ │ ├── icon-29@3x.png
│ │ │ │ ├── icon-40.png
│ │ │ │ ├── icon-40@2x.png
│ │ │ │ ├── icon-40@3x.png
│ │ │ │ ├── icon-50.png
│ │ │ │ ├── icon-50@2x.png
│ │ │ │ ├── icon-57.png
│ │ │ │ ├── icon-57@2x.png
│ │ │ │ ├── icon-60@2x.png
│ │ │ │ ├── icon-60@3x.png
│ │ │ │ ├── icon-72.png
│ │ │ │ ├── icon-72@2x.png
│ │ │ │ ├── icon-76.png
│ │ │ │ ├── icon-76@2x.png
│ │ │ │ └── icon-83.5@2x.png
│ │ │ ├── Checkmark.imageset
│ │ │ │ ├── Checkmark.png
│ │ │ │ ├── Checkmark@2x.png
│ │ │ │ ├── Checkmark@3x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.launchimage
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default-667h@2x.png
│ │ │ │ ├── Default-736h@3x.png
│ │ │ │ ├── Default-Landscape.png
│ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ ├── Default-Portrait.png
│ │ │ │ ├── Default-Portrait@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ └── Default@2x.png
│ │ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ │ └── LaunchScreen.Center.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ └── LaunchScreen-Center@2x.png
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ ├── build.xcconfig
│ │ │ └── nstudio.png
│ ├── app-root.xml
│ ├── app.css
│ ├── app.ts
│ ├── main-page.android.css
│ ├── main-page.ios.css
│ ├── main-page.ts
│ ├── main-page.xml
│ ├── main-view-model.ts
│ └── tests
│ │ └── tests.js
├── karma.conf.js
├── nativescript.config.ts
├── package.json
├── references.d.ts
├── tsconfig.json
└── webpack.config.js
├── package.json
├── publish
├── pack.sh
├── package.json
└── publish.sh
├── screenshots
├── android
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ └── 4.png
└── ios
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ └── 4.png
├── src
├── .npmignore
├── index.d.ts
├── loading-indicator.android.ts
├── loading-indicator.common.ts
├── loading-indicator.ios.ts
├── package.json
├── platforms
│ ├── android
│ │ ├── AndroidManifest.xml
│ │ ├── nativescript_loading_indicator.aar
│ │ └── res
│ │ │ └── drawable
│ │ │ ├── circle_shape.xml
│ │ │ ├── circular_progress_bar.xml
│ │ │ └── circular_progress_bar_thick.xml
│ └── ios
│ │ └── Podfile
├── references.d.ts
├── scripts
│ └── build-native.js
├── tsconfig.json
└── typings
│ └── objc!MBProgressHUD.d.ts
└── tslint.json
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 | ### Make sure to check the demo app(s) for sample usage
2 |
3 | ### Make sure to check the existing issues in this repository
4 |
5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it
6 | Please, ensure your title is less than 63 characters long and starts with a capital
7 | letter.
8 |
9 | ### Which platform(s) does your issue occur on?
10 | - iOS/Android/Both
11 | - iOS/Android versions
12 | - emulator or device. What type of device?
13 |
14 | ### Please, provide the following version numbers that your issue occurs with:
15 |
16 | - CLI: (run `tns --version` to fetch it)
17 | - Cross-platform modules: (check the 'version' attribute in the
18 | `node_modules/tns-core-modules/package.json` file in your project)
19 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project)
20 | - Plugin(s): (look for the version numbers in the `package.json` file of your
21 | project and paste your dependencies and devDependencies here)
22 |
23 | ### Please, tell us how to recreate the issue in as much detail as possible.
24 | Describe the steps to reproduce it.
25 |
26 | ### Is there any code involved?
27 | - provide a code example to recreate the problem
28 | - (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
29 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 | ## PR Checklist
11 |
12 | - [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages.
13 | - [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
14 | - [ ] All existing tests are passing
15 | - [ ] Tests for the changes are included
16 |
17 | ## What is the current behavior?
18 |
19 |
20 | ## What is the new behavior?
21 |
22 |
23 | Fixes/Implements/Closes #[Issue Number].
24 |
25 |
26 |
27 |
36 |
37 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build CI
2 |
3 | # Trigger the workflow on push or pull request
4 | on: [push, pull_request]
5 |
6 | jobs:
7 | build:
8 | name: Build
9 |
10 | runs-on: macos-latest
11 | steps:
12 | - uses: actions/checkout@v1
13 |
14 | - name: Set Node.js 12.x
15 | uses: actions/setup-node@v1
16 | with:
17 | node-version: "12.x"
18 |
19 | - name: Build Plugin Source
20 | run: cd src && npm i && npm i -g typescript@4.1.0 && tsc
21 |
22 | - name: Lint
23 | run: cd src && npm run tslint
24 |
25 | - name: Setup JDK 1.8
26 | uses: actions/setup-java@v1
27 | with:
28 | java-version: 1.8
29 |
30 | - name: Install PIP
31 | run: |
32 | sudo pip install --upgrade pip
33 | sudo pip install six
34 |
35 | - name: Setup NativeScript CLI
36 | run: |
37 | echo no | npm i -g nativescript
38 | tns usage-reporting disable
39 | tns error-reporting disable
40 |
41 | - name: Build Android Demo App
42 | run: |
43 | cd demo
44 | tns build android --env.uglify
45 | - name: Build iOS Demo App
46 | run: |
47 | cd demo
48 | tns build ios --env.uglify
49 | - name: Build Android Angular Test App
50 | run: |
51 | cd demo-angular
52 | tns build android --env.uglify
53 | - name: Build iOS Angular Test App
54 | run: |
55 | cd demo-angular
56 | tns build ios --env.uglify
57 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .idea
3 | .DS_Store
4 | *.esm.json
5 | *.js
6 | *.js.map
7 | *.log
8 | src/*.d.ts
9 | !src/index.d.ts
10 | !src/references.d.ts
11 | !src/scripts/*.js
12 | !seed-tests/*.js
13 | seed-tests/seed-copy/**/*.*
14 | seed-tests/seed-copy-new-git-repo/**/*.*
15 | !demo/karma.conf.js
16 | !demo/app/tests/*.js
17 | demo/*.d.ts
18 | !demo/references.d.ts
19 | demo/lib
20 | demo/platforms
21 | node_modules
22 | publish/src
23 | publish/package
24 | demo/report/report.html
25 | demo/report/stats.json
26 | !demo-vue/app/app.js
27 | package-lock.json
28 |
29 | !demo/webpack.config.js
30 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true
4 | }
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Run Demo
2 |
3 | ```
4 | git clone https://github.com/nstudio/nativescript-loading-indicator.git
5 | cd nativescript-loading-indicator
6 | npm run setup // you will see some TypeScript warnings, this is normal, you can ignore :)
7 |
8 | npm run demo.ios
9 |
10 | // or...
11 |
12 | npm run demo.android
13 | ```
14 |
15 | ## Development Workflow
16 |
17 | - Make changes to plugin
18 | - Make changes in demo to test out those changes
19 | - Run `npm run demo.ios` or `npm run demo.android`
20 |
21 | ## Submitting Pull Requests
22 |
23 | **Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.**
24 |
25 | - Please rebase your branch against the current master
26 | - Make reference to possible [issues](https://github.com/nstudio/nativescript-loading-indicator/issues) on PR comment
27 |
28 | ## Submitting bug reports
29 |
30 | - Please detail the affected platform and version
31 | - Please be sure to state which version of node, npm, and NativeScript you're using
32 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Source management moved to [nstudio/nativescript-plugins](https://github.com/nstudio/nativescript-plugins/tree/main/packages/nativescript-loading-indicator)
2 | ---
3 |
4 | NativeScript Loading Indicator
5 |
6 |
7 | NativeScript-Loading-Indicator is a plugin for NativeScript which overlays a loading indicator on the current page. Can be used, for example, to prevent the UI being interacted with while data is being fetched from an API, while informing the user that something is happening.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | ---
20 |
21 | ## Installation
22 |
23 | ## NativeScript 7+:
24 |
25 | ```bash
26 | ns plugin add @nstudio/nativescript-loading-indicator
27 | ```
28 |
29 | ## NativeScript lower than 7:
30 |
31 | ```bash
32 | tns plugin add @nstudio/nativescript-loading-indicator@3.0.x
33 | ```
34 |
35 | ## Screenshots
36 |
37 | ### iOS
38 |
39 |
40 |
41 | | | | | |
42 | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
43 | | | | | |
44 |
45 |
49 |
50 |
51 |
52 | ### Android
53 |
54 |
55 |
56 | | | | | |
57 | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
58 | | | | | |
59 |
60 |
61 |
62 | ## Example
63 |
64 | #### TypeScript
65 |
66 | ```typescript
67 | import {
68 | LoadingIndicator,
69 | Mode,
70 | OptionsCommon,
71 | } from '@nstudio/nativescript-loading-indicator';
72 |
73 | const indicator = new LoadingIndicator();
74 |
75 | const options: OptionsCommon = {
76 | message: 'Loading...',
77 | details: 'Additional detail note!',
78 | progress: 0.65,
79 | margin: 10,
80 | dimBackground: true,
81 | color: '#4B9ED6', // color of indicator and labels
82 | // background box around indicator
83 | // hideBezel will override this if true
84 | backgroundColor: 'yellow',
85 | userInteractionEnabled: false, // default true. Set false so that the touches will fall through it.
86 | hideBezel: true, // default false, can hide the surrounding bezel
87 | mode: Mode.AnnularDeterminate, // see options below
88 | android: {
89 | view: someStackLayout.android, // Target view to show on top of (Defaults to entire window)
90 | cancelable: true,
91 | cancelListener: function (dialog) {
92 | console.log('Loading cancelled');
93 | },
94 | },
95 | ios: {
96 | view: someButton.ios, // Target view to show on top of (Defaults to entire window)
97 | square: false,
98 | },
99 | };
100 |
101 | indicator.show(options);
102 |
103 | // after some async event maybe or a timeout hide the indicator
104 | indicator.hide();
105 | ```
106 |
107 | #### javascript
108 |
109 | ```js
110 | const LoadingIndicator = require('@nstudio/nativescript-loading-indicator')
111 | .LoadingIndicator;
112 | const Mode = require('@nstudio/nativescript-loading-indicator').Mode;
113 |
114 | const loader = new LoadingIndicator();
115 |
116 | // optional options
117 | // android and ios have some platform specific options
118 | const options = {
119 | message: 'Loading...',
120 | details: 'Additional detail note!',
121 | progress: 0.65,
122 | margin: 10,
123 | dimBackground: true,
124 | color: '#4B9ED6', // color of indicator and labels
125 | // background box around indicator
126 | // hideBezel will override this if true
127 | backgroundColor: 'yellow',
128 | userInteractionEnabled: false, // default true. Set false so that the touches will fall through it.
129 | hideBezel: true, // default false, can hide the surrounding bezel
130 | mode: Mode.AnnularDeterminate, // see options below
131 | android: {
132 | view: android.view.View, // Target view to show on top of (Defaults to entire window)
133 | cancelable: true,
134 | cancelListener: function (dialog) {
135 | console.log('Loading cancelled');
136 | },
137 | },
138 | ios: {
139 | view: UIView, // Target view to show on top of (Defaults to entire window)
140 | },
141 | };
142 |
143 | loader.show(options); // options is optional
144 |
145 | // Do whatever it is you want to do while the loader is showing, then
146 |
147 | loader.hide();
148 | ```
149 |
150 | ### Common Options
151 |
152 | ```typescript
153 | export interface OptionsCommon {
154 | /**
155 | * Message in the loading indicator.
156 | */
157 | message?: string;
158 |
159 | /**
160 | * Details message in the loading indicator.
161 | */
162 | details?: string;
163 |
164 | /**
165 | * Color of the message text.
166 | */
167 | color?: string;
168 |
169 | /**
170 | * Background color of the loading indicator.
171 | */
172 | backgroundColor?: string;
173 |
174 | /**
175 | * Progress of the indicator when not using CustomView or Text Mode.
176 | */
177 | progress?: number;
178 |
179 | /**
180 | * Margin for the message/indicator to the edge of the bezel.
181 | */
182 | margin?: number;
183 |
184 | /**
185 | * Set true to allow user interaction.
186 | */
187 | userInteractionEnabled?: boolean;
188 |
189 | /**
190 | * Dim the background behind the indicator.
191 | */
192 | dimBackground?: boolean;
193 |
194 | /**
195 | * Hide bezel around indicator
196 | */
197 | hideBezel?: boolean;
198 |
199 | /**
200 | * The mode of the loading indicator.
201 | */
202 | mode?: Mode;
203 |
204 | /**
205 | * If `mode` is set to CustomView, then you can pass an image or view to show in the loading indicator.
206 | */
207 | customView?: any;
208 |
209 | /**
210 | * iOS specific configuration options.
211 | */
212 | ios?: OptionsIOS;
213 |
214 | /**
215 | * Android specific configuration options.
216 | */
217 | android?: OptionsAndroid;
218 | }
219 | ```
220 |
221 | #### Android Specific
222 |
223 | ```typescript
224 | export interface OptionsAndroid {
225 | /**
226 | * Native View instance to anchor the loading indicator to.
227 | */
228 | view?: android.view.View;
229 | max?: number;
230 | progressNumberFormat?: string;
231 | progressPercentFormat?: number;
232 | progressStyle?: number;
233 | secondaryProgress?: number;
234 | cancelable?: boolean;
235 | cancelListener?: (dialog: any) => void;
236 | elevation?: number;
237 | }
238 | ```
239 |
240 | #### iOS Specific
241 |
242 | ```typescript
243 | export interface OptionsIOS {
244 | /**
245 | * Native View instance to anchor the loading indicator to.
246 | */
247 | view?: UIView;
248 | square?: boolean;
249 | }
250 | ```
251 |
252 | ### Mode Enum
253 |
254 | ```typescript
255 | export enum Mode {
256 | Indeterminate = 0,
257 | Determinate = 1,
258 | DeterminateHorizontalBar = 2,
259 | AnnularDeterminate = 3,
260 | CustomView = 4,
261 | Text = 5,
262 | }
263 | ```
264 |
--------------------------------------------------------------------------------
/demo-angular/.gitignore:
--------------------------------------------------------------------------------
1 | # NativeScript
2 | hooks/
3 | node_modules/
4 | platforms/
5 |
6 | # NativeScript Template
7 | *.js.map
8 | *.js
9 | !webpack.config.js
10 |
11 | # Logs
12 | logs
13 | *.log
14 | npm-debug.log*
15 | yarn-debug.log*
16 | yarn-error.log*
17 |
18 | # General
19 | .DS_Store
20 | .AppleDouble
21 | .LSOverride
22 | .idea
23 | .cloud
24 | .project
25 | tmp/
26 | typings/
27 |
28 | # Visual Studio Code
29 | .vscode/*
30 | !.vscode/settings.json
31 | !.vscode/tasks.json
32 | !.vscode/launch.json
33 | !.vscode/extensions.json
34 |
--------------------------------------------------------------------------------
/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 | minSdkVersion 17
15 | generatedDensities = []
16 | }
17 | aaptOptions {
18 | additionalParameters "--no-version-vectors"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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 |
10 |
11 |
13 |
14 |
15 |
18 |
19 |
20 |
23 |
24 |
28 |
--------------------------------------------------------------------------------
/demo-angular/App_Resources/Android/src/main/res/values-v29/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/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 |
17 |
18 |
20 |
21 |
22 |
29 |
30 |
32 |
33 |
34 |
39 |
40 |
42 |
43 |
--------------------------------------------------------------------------------
/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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.
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 |
--------------------------------------------------------------------------------
/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 | "blank": {
10 | "root": "",
11 | "sourceRoot": "src",
12 | "projectType": "application",
13 | "prefix": "ns"
14 | }
15 | },
16 | "defaultProject": "blank"
17 | }
18 |
--------------------------------------------------------------------------------
/demo-angular/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'org.nativescript.demoangular',
5 | appResourcesPath: 'App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none',
9 | },
10 | appPath: 'src',
11 | } as NativeScriptConfig;
12 |
--------------------------------------------------------------------------------
/demo-angular/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "repository": "",
5 | "dependencies": {
6 | "@angular/animations": "~8.2.0",
7 | "@angular/common": "~8.2.0",
8 | "@angular/compiler": "~8.2.0",
9 | "@angular/core": "~8.2.0",
10 | "@angular/forms": "~8.2.0",
11 | "@angular/platform-browser": "~8.2.0",
12 | "@angular/platform-browser-dynamic": "~8.2.0",
13 | "@angular/router": "~8.2.0",
14 | "@nativescript/theme": "~2.2.1",
15 | "@nstudio/nativescript-loading-indicator": "file:../src",
16 | "reflect-metadata": "~0.1.12",
17 | "rxjs": "^6.4.0",
18 | "zone.js": "~0.9.1",
19 | "@nativescript/core": "~7.0.0",
20 | "@nativescript/angular": "10.0.0"
21 | },
22 | "devDependencies": {
23 | "@angular/compiler-cli": "~8.2.0",
24 | "@ngtools/webpack": "~8.2.0",
25 | "typescript": "~3.9.7",
26 | "@nativescript/webpack": "~3.0.4"
27 | },
28 | "gitHead": "fa98f785df3fba482e5e2a0c76f4be1fa6dc7a14",
29 | "readme": "NativeScript Application",
30 | "main": "main.js"
31 | }
32 |
--------------------------------------------------------------------------------
/demo-angular/src/app.css:
--------------------------------------------------------------------------------
1 | @import "~@nativescript/theme/css/core.css";
2 | @import "~@nativescript/theme/css/default.css";
3 |
4 | /*
5 | Place any CSS rules you want to apply on both iOS and Android here.
6 | This is where the vast majority of your CSS code goes.
7 | */
8 |
9 | /*
10 | The following CSS rule changes the font size of all Buttons that have the
11 | "-primary" class modifier.
12 | */
13 | Button.-primary {
14 | font-size: 18;
15 | }
16 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes } from '@angular/router';
3 | import { NativeScriptRouterModule } from '@nativescript/angular';
4 | import { LandingPageComponent } from './landing-page/landing-page.component';
5 | import { PageTwoComponent } from './page-two/page-two.component';
6 |
7 | const routes: Routes = [
8 | { path: '', redirectTo: '/landing-page', pathMatch: 'full' },
9 | { path: 'landing-page', component: LandingPageComponent },
10 | { path: 'page-two-page', component: PageTwoComponent },
11 | ];
12 |
13 | @NgModule({
14 | imports: [NativeScriptRouterModule.forRoot(routes)],
15 | exports: [NativeScriptRouterModule],
16 | })
17 | export class AppRoutingModule {}
18 |
--------------------------------------------------------------------------------
/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 | templateUrl: './app.component.html'
6 | })
7 | export class AppComponent {}
8 |
--------------------------------------------------------------------------------
/demo-angular/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2 | import { NativeScriptModule } from '@nativescript/angular';
3 | import { AppRoutingModule } from './app-routing.module';
4 | import { AppComponent } from './app.component';
5 | import { LandingPageComponent } from './landing-page/landing-page.component';
6 | import { PageTwoComponent } from './page-two/page-two.component';
7 | import { LoadingIndicatorService } from './services/loading-indicator.service';
8 | import { TestNavService } from './services/test-nav.service';
9 |
10 | // Uncomment and add to NgModule imports if you need to use two-way binding
11 | // import { NativeScriptFormsModule } from "nativescript-angular/forms";
12 |
13 | // Uncomment and add to NgModule imports if you need to use the HttpClient wrapper
14 | // import { NativeScriptHttpClientModule } from "nativescript-angular/http-client";
15 |
16 | @NgModule({
17 | bootstrap: [AppComponent],
18 | imports: [NativeScriptModule, AppRoutingModule],
19 | declarations: [AppComponent, LandingPageComponent, PageTwoComponent],
20 | providers: [LoadingIndicatorService, TestNavService],
21 | schemas: [NO_ERRORS_SCHEMA],
22 | })
23 | /*
24 | Pass your application module to the bootstrapModule function located in main.ts to start your app
25 | */
26 | export class AppModule {}
27 |
--------------------------------------------------------------------------------
/demo-angular/src/app/landing-page/landing-page.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
13 |
17 |
21 |
22 |
23 |
27 |
31 |
32 |
--------------------------------------------------------------------------------
/demo-angular/src/app/landing-page/landing-page.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Utils } from '@nativescript/core';
3 | import { LoadingIndicatorService } from '../services/loading-indicator.service';
4 | import { TestNavService } from '../services/test-nav.service';
5 |
6 | @Component({
7 | moduleId: module.id,
8 | selector: 'landing-page',
9 | templateUrl: 'landing-page.component.html',
10 | })
11 | export class LandingPageComponent {
12 | public changeTestText =
13 | 'Perform multiple calls to the show method with different options.';
14 | public duplicateTestText = 'Perform multiple calls to the show method.';
15 | public navigationTestText =
16 | 'Perform a service based navigation to a new page.';
17 |
18 | constructor(
19 | private loadingIndicatorService: LoadingIndicatorService,
20 | private testNavService: TestNavService
21 | ) {}
22 |
23 | public async onPressChangeWithNewColourTest() {
24 | this.loadingIndicatorService.show();
25 | await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
26 | this.loadingIndicatorService.show(undefined, { color: '#d400bc' });
27 | await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
28 | this.loadingIndicatorService.hide();
29 | }
30 |
31 | public async onPressNavigateInstantTest() {
32 | this.loadingIndicatorService.show('This should go away on the next page');
33 | this.testNavService.tryNav();
34 | }
35 |
36 | public async onPressNavigateDelayedTest() {
37 | this.loadingIndicatorService.show('This should go away on the next page');
38 | await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
39 | this.testNavService.tryNav();
40 | }
41 |
42 | public async onPressDuplicateWithNoTextTest() {
43 | this.duplicateShow();
44 | }
45 |
46 | public async onPressDuplicateWithSameTextTest() {
47 | this.duplicateShow('Same text', 'Same text');
48 | }
49 |
50 | public async onPressDuplicateWithNewTextTest() {
51 | this.duplicateShow(
52 | 'This message should be replaced',
53 | 'And only one spinner should show'
54 | );
55 | }
56 |
57 | private async duplicateShow(messageOne?: string, messageTwo?: string) {
58 | this.loadingIndicatorService.show(messageOne);
59 | await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
60 | this.loadingIndicatorService.show(messageTwo);
61 | await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
62 | this.loadingIndicatorService.hide();
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/demo-angular/src/app/page-two/page-two.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/demo-angular/src/app/page-two/page-two.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | moduleId: module.id,
5 | selector: 'page-two-page',
6 | templateUrl: 'page-two.component.html',
7 | })
8 | export class PageTwoComponent {}
9 |
--------------------------------------------------------------------------------
/demo-angular/src/app/services/loading-indicator.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import {
3 | LoadingIndicator,
4 | OptionsCommon,
5 | Mode,
6 | } from '@nstudio/nativescript-loading-indicator';
7 |
8 | @Injectable()
9 | export class LoadingIndicatorService {
10 | private loadingIndicator: LoadingIndicator;
11 |
12 | constructor() {
13 | this.loadingIndicator = new LoadingIndicator();
14 | }
15 |
16 | public show(message?: string, options?: any) {
17 | const defaultOptions: OptionsCommon = {
18 | message: message,
19 | dimBackground: true,
20 | color: '#000000',
21 | mode: Mode.Indeterminate,
22 | android: {
23 | cancelable: false,
24 | },
25 | ios: {
26 | square: false,
27 | },
28 | };
29 | this.loadingIndicator.show({
30 | ...defaultOptions,
31 | ...options,
32 | });
33 | }
34 |
35 | public hide() {
36 | this.loadingIndicator.hide();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/demo-angular/src/app/services/test-nav.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { RouterExtensions } from '@nativescript/angular';
3 | import { LoadingIndicatorService } from './loading-indicator.service';
4 |
5 | @Injectable()
6 | export class TestNavService {
7 | constructor(
8 | private loadingIndicatorService: LoadingIndicatorService,
9 | private nav: RouterExtensions
10 | ) {}
11 |
12 | public async tryNav() {
13 | try {
14 | await this.nav.navigate(['/page-two-page']);
15 | } catch (error) {
16 | console.error(error);
17 | } finally {
18 | this.loadingIndicatorService.hide();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/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';
3 | import { AppModule } from './app/app.module';
4 |
5 | platformNativeScriptDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/demo-angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "es2017",
5 | "experimentalDecorators": true,
6 | "emitDecoratorMetadata": true,
7 | "noEmitHelpers": true,
8 | "noEmitOnError": true,
9 | "skipLibCheck": true,
10 | "lib": ["es6", "dom", "es2015.iterable", "es2017"],
11 | "baseUrl": ".",
12 | "paths": {
13 | "~/*": ["src/*"],
14 | "*": ["./node_modules/*"]
15 | },
16 | "moduleResolution": "node",
17 | "removeComments": false
18 | },
19 | "exclude": ["node_modules", "platforms", "../src/node_modules"],
20 | "include": ["../src", "**/*"]
21 | }
22 |
--------------------------------------------------------------------------------
/demo-angular/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep, dirname } = require('path');
2 | const fs = require('fs');
3 |
4 | const webpack = require('webpack');
5 | const nsWebpack = require('@nativescript/webpack');
6 | const nativescriptTarget = require('@nativescript/webpack/nativescript-target');
7 | const {
8 | nsSupportHmrNg
9 | } = require('@nativescript/webpack/transformers/ns-support-hmr-ng');
10 | const { nsTransformNativeClassesNg } = require("@nativescript/webpack/transformers/ns-transform-native-classes-ng");
11 | const {
12 | getMainModulePath
13 | } = require('@nativescript/webpack/utils/ast-utils');
14 | const { getNoEmitOnErrorFromTSConfig, getCompilerOptionsFromTSConfig } = require("@nativescript/webpack/utils/tsconfig-utils");
15 | const { CleanWebpackPlugin } = require('clean-webpack-plugin');
16 | const CopyWebpackPlugin = require('copy-webpack-plugin');
17 | const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
18 | const {
19 | NativeScriptWorkerPlugin
20 | } = require('nativescript-worker-loader/NativeScriptWorkerPlugin');
21 | const TerserPlugin = require('terser-webpack-plugin');
22 | const {
23 | getAngularCompilerPlugin
24 | } = require('@nativescript/webpack/plugins/NativeScriptAngularCompilerPlugin');
25 | const hashSalt = Date.now().toString();
26 |
27 | module.exports = env => {
28 | // Add your custom Activities, Services and other Android app components here.
29 | const appComponents = [
30 | "@nativescript/core/ui/frame", "@nativescript/core/ui/frame/activity"
31 | ];
32 |
33 | const platform = env && ((env.android && 'android') || (env.ios && 'ios'));
34 | if (!platform) {
35 | throw new Error('You need to provide a target platform!');
36 | }
37 |
38 | const AngularCompilerPlugin = getAngularCompilerPlugin(platform);
39 | const projectRoot = __dirname;
40 |
41 | // Default destination inside platforms//...
42 | const dist = resolve(
43 | projectRoot,
44 | nsWebpack.getAppPath(platform, projectRoot)
45 | );
46 |
47 | const {
48 | // The 'appPath' and 'appResourcesPath' values are fetched from
49 | // the nsconfig.json configuration file
50 | // when bundling with `tns run android|ios --bundle`.
51 | appPath = 'src',
52 | appResourcesPath = 'App_Resources',
53 |
54 | // You can provide the following flags when running 'tns run android|ios'
55 | snapshot, // --env.snapshot,
56 | production, // --env.production
57 | uglify, // --env.uglify
58 | report, // --env.report
59 | sourceMap, // --env.sourceMap
60 | hiddenSourceMap, // --env.hiddenSourceMap
61 | hmr, // --env.hmr,
62 | unitTesting, // --env.unitTesting
63 | testing, // --env.testing
64 | verbose, // --env.verbose
65 | ci, // --env.ci
66 | snapshotInDocker, // --env.snapshotInDocker
67 | skipSnapshotTools, // --env.skipSnapshotTools
68 | compileSnapshot // --env.compileSnapshot
69 | } = env;
70 |
71 | const useLibs = compileSnapshot;
72 | const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
73 | const externals = nsWebpack.getConvertedExternals(env.externals);
74 | const appFullPath = resolve(projectRoot, appPath);
75 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
76 | let tsConfigName = 'tsconfig.json';
77 | let tsConfigTnsName = 'tsconfig.tns.json';
78 | let tsConfigPath = resolve(projectRoot, tsConfigName);
79 | const tsConfigTnsPath = resolve(projectRoot, tsConfigTnsName);
80 | if (fs.existsSync(tsConfigTnsPath)) {
81 | // still support shared angular app configurations
82 | tsConfigName = tsConfigTnsName;
83 | tsConfigPath = tsConfigTnsPath;
84 | }
85 | const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
86 | const entryPath = `.${sep}${entryModule}`;
87 | const entries = { bundle: entryPath };
88 | const areCoreModulesExternal =
89 | Array.isArray(env.externals) &&
90 | env.externals.some(e => e.indexOf('@nativescript') > -1);
91 | if (platform === 'ios' && !areCoreModulesExternal && !testing) {
92 | entries['tns_modules/@nativescript/core/inspector_modules'] =
93 | 'inspector_modules';
94 | }
95 |
96 | const compilerOptions = getCompilerOptionsFromTSConfig(tsConfigPath);
97 | nsWebpack.processTsPathsForScopedModules({ compilerOptions });
98 | nsWebpack.processTsPathsForScopedAngular({ compilerOptions });
99 |
100 | const ngCompilerTransformers = [nsTransformNativeClassesNg];
101 | const additionalLazyModuleResources = [];
102 |
103 | const copyIgnore = { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] };
104 | const copyTargets = [
105 | { from: 'assets/**', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
106 | { from: 'fonts/**', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
107 | ];
108 |
109 | if (!production) {
110 | // for development purposes only
111 | // for example, include mock json folder
112 | // copyTargets.push({ from: 'tools/mockdata', to: 'assets/mockdata' });
113 |
114 | if (hmr) {
115 | ngCompilerTransformers.push(nsSupportHmrNg);
116 | }
117 | }
118 |
119 | // when "@angular/core" is external, it's not included in the bundles. In this way, it will be used
120 | // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
121 | // fixes https://github.com/NativeScript/nativescript-cli/issues/4024
122 | if (env.externals && env.externals.indexOf('@angular/core') > -1) {
123 | const appModuleRelativePath = getMainModulePath(
124 | resolve(appFullPath, entryModule),
125 | tsConfigName
126 | );
127 | if (appModuleRelativePath) {
128 | const appModuleFolderPath = dirname(
129 | resolve(appFullPath, appModuleRelativePath)
130 | );
131 | // include the new lazy loader path in the allowed ones
132 | additionalLazyModuleResources.push(appModuleFolderPath);
133 | }
134 | }
135 |
136 | const ngCompilerPlugin = new AngularCompilerPlugin({
137 | hostReplacementPaths: nsWebpack.getResolver([platform, 'tns']),
138 | platformTransformers: ngCompilerTransformers.map(t =>
139 | t(() => ngCompilerPlugin, resolve(appFullPath, entryModule), projectRoot)
140 | ),
141 | mainPath: join(appFullPath, entryModule),
142 | tsConfigPath,
143 | skipCodeGeneration: false,
144 | sourceMap: !!isAnySourceMapEnabled,
145 | additionalLazyModuleResources: additionalLazyModuleResources,
146 | compilerOptions: { paths: compilerOptions.paths }
147 | });
148 |
149 | let sourceMapFilename = nsWebpack.getSourceMapFilename(
150 | hiddenSourceMap,
151 | __dirname,
152 | dist
153 | );
154 |
155 | const itemsToClean = [`${dist}/**/*`];
156 | if (platform === 'android') {
157 | itemsToClean.push(
158 | `${join(
159 | projectRoot,
160 | 'platforms',
161 | 'android',
162 | 'app',
163 | 'src',
164 | 'main',
165 | 'assets',
166 | 'snapshots'
167 | )}`
168 | );
169 | itemsToClean.push(
170 | `${join(
171 | projectRoot,
172 | 'platforms',
173 | 'android',
174 | 'app',
175 | 'build',
176 | 'configurations',
177 | 'nativescript-android-snapshot'
178 | )}`
179 | );
180 | }
181 |
182 | const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);
183 |
184 | nsWebpack.processAppComponents(appComponents, platform);
185 | const config = {
186 | mode: production ? 'production' : 'development',
187 | context: appFullPath,
188 | externals,
189 | watchOptions: {
190 | ignored: [
191 | appResourcesFullPath,
192 | // Don't watch hidden files
193 | '**/.*'
194 | ]
195 | },
196 | target: nativescriptTarget,
197 | entry: entries,
198 | output: {
199 | pathinfo: false,
200 | path: dist,
201 | sourceMapFilename,
202 | libraryTarget: 'commonjs2',
203 | filename: '[name].js',
204 | globalObject: 'global',
205 | hashSalt
206 | },
207 | resolve: {
208 | extensions: ['.ts', '.js', '.scss', '.css'],
209 | // Resolve {N} system modules from @nativescript/core
210 | modules: [
211 | resolve(__dirname, 'node_modules/@nativescript/core'),
212 | resolve(__dirname, 'node_modules'),
213 | 'node_modules/@nativescript/core',
214 | 'node_modules'
215 | ],
216 | alias: {
217 | '~/package.json': resolve(projectRoot, 'package.json'),
218 | '~': appFullPath,
219 | "tns-core-modules": "@nativescript/core",
220 | "nativescript-angular": "@nativescript/angular"
221 | },
222 | symlinks: true
223 | },
224 | resolveLoader: {
225 | symlinks: false
226 | },
227 | node: {
228 | // Disable node shims that conflict with NativeScript
229 | http: false,
230 | timers: false,
231 | setImmediate: false,
232 | fs: 'empty',
233 | __dirname: false
234 | },
235 | devtool: hiddenSourceMap
236 | ? 'hidden-source-map'
237 | : sourceMap
238 | ? 'inline-source-map'
239 | : 'none',
240 | optimization: {
241 | runtimeChunk: 'single',
242 | noEmitOnErrors: noEmitOnErrorFromTSConfig,
243 | splitChunks: {
244 | cacheGroups: {
245 | vendor: {
246 | name: 'vendor',
247 | chunks: 'all',
248 | test: (module, chunks) => {
249 | const moduleName = module.nameForCondition
250 | ? module.nameForCondition()
251 | : '';
252 | return (
253 | /[\\/]node_modules[\\/]/.test(moduleName) ||
254 | appComponents.some(comp => comp === moduleName)
255 | );
256 | },
257 | enforce: true
258 | }
259 | }
260 | },
261 | minimize: !!uglify,
262 | minimizer: [
263 | new TerserPlugin({
264 | parallel: true,
265 | cache: !ci,
266 | sourceMap: isAnySourceMapEnabled,
267 | terserOptions: {
268 | output: {
269 | comments: false,
270 | semicolons: !isAnySourceMapEnabled
271 | },
272 | compress: {
273 | // The Android SBG has problems parsing the output
274 | // when these options are enabled
275 | collapse_vars: platform !== 'android',
276 | sequences: platform !== 'android',
277 | // custom
278 | drop_console: true,
279 | drop_debugger: true,
280 | ecma: 6,
281 | keep_infinity: platform === 'android', // for Chrome/V8
282 | reduce_funcs: platform !== 'android', // for Chrome/V8
283 | global_defs: {
284 | __UGLIFIED__: true
285 | }
286 | },
287 | // custom
288 | ecma: 6,
289 | safari10: platform !== 'android'
290 | }
291 | })
292 | ]
293 | },
294 | module: {
295 | rules: [
296 | {
297 | include: join(appFullPath, entryPath),
298 | use: [
299 | // Require all Android app components
300 | platform === 'android' && {
301 | loader: '@nativescript/webpack/helpers/android-app-components-loader',
302 | options: { modules: appComponents }
303 | },
304 |
305 | {
306 | loader: '@nativescript/webpack/bundle-config-loader',
307 | options: {
308 | angular: true,
309 | loadCss: !snapshot, // load the application css if in debug mode
310 | unitTesting,
311 | appFullPath,
312 | projectRoot,
313 | ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
314 | }
315 | }
316 | ].filter(loader => !!loader)
317 | },
318 |
319 | { test: /\.html$|\.xml$/, use: 'raw-loader' },
320 |
321 | {
322 | test: /[\/|\\]app\.css$/,
323 | use: [
324 | '@nativescript/webpack/helpers/style-hot-loader',
325 | {
326 | loader: "@nativescript/webpack/helpers/css2json-loader",
327 | options: { useForImports: true }
328 | },
329 | ],
330 | },
331 | {
332 | test: /[\/|\\]app\.scss$/,
333 | use: [
334 | '@nativescript/webpack/helpers/style-hot-loader',
335 | {
336 | loader: "@nativescript/webpack/helpers/css2json-loader",
337 | options: { useForImports: true }
338 | },
339 | 'sass-loader',
340 | ],
341 | },
342 |
343 | // Angular components reference css files and their imports using raw-loader
344 | { test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: 'raw-loader' },
345 | {
346 | test: /\.scss$/,
347 | exclude: /[\/|\\]app\.scss$/,
348 | use: ['raw-loader', 'resolve-url-loader', 'sass-loader']
349 | },
350 |
351 | {
352 | test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
353 | use: [
354 | '@nativescript/webpack/helpers/moduleid-compat-loader',
355 | '@nativescript/webpack/helpers/lazy-ngmodule-hot-loader',
356 | '@ngtools/webpack'
357 | ]
358 | },
359 |
360 | // Mark files inside `@angular/core` as using SystemJS style dynamic imports.
361 | // Removing this will cause deprecation warnings to appear.
362 | {
363 | test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
364 | parser: { system: true }
365 | }
366 | ]
367 | },
368 | plugins: [
369 | // Define useful constants like TNS_WEBPACK
370 | new webpack.DefinePlugin({
371 | 'global.TNS_WEBPACK': 'true',
372 | 'global.isAndroid': platform === 'android',
373 | 'global.isIOS': platform === 'ios',
374 | process: 'global.process'
375 | }),
376 | // Remove all files from the out dir.
377 | new CleanWebpackPlugin({
378 | cleanOnceBeforeBuildPatterns: itemsToClean,
379 | verbose: !!verbose
380 | }),
381 | // Copy assets
382 | new CopyWebpackPlugin({
383 | patterns: copyTargets,
384 | }),
385 | new nsWebpack.GenerateNativeScriptEntryPointsPlugin('bundle'),
386 | // For instructions on how to set up workers with webpack
387 | // check out https://github.com/nativescript/worker-loader
388 | new NativeScriptWorkerPlugin(),
389 | ngCompilerPlugin,
390 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
391 | new nsWebpack.WatchStateLoggerPlugin()
392 | ]
393 | };
394 |
395 | if (report) {
396 | // Generate report files for bundles content
397 | config.plugins.push(
398 | new BundleAnalyzerPlugin({
399 | analyzerMode: 'static',
400 | openAnalyzer: false,
401 | generateStatsFile: true,
402 | reportFilename: resolve(projectRoot, 'report', `report.html`),
403 | statsFilename: resolve(projectRoot, 'report', `stats.json`)
404 | })
405 | );
406 | }
407 |
408 | if (snapshot) {
409 | config.plugins.push(
410 | new nsWebpack.NativeScriptSnapshotPlugin({
411 | chunk: 'vendor',
412 | angular: true,
413 | requireModules: [
414 | 'reflect-metadata',
415 | '@angular/platform-browser',
416 | '@angular/core',
417 | '@angular/common',
418 | '@angular/router',
419 | '@nativescript/angular'
420 | ],
421 | projectRoot,
422 | webpackConfig: config,
423 | snapshotInDocker,
424 | skipSnapshotTools,
425 | useLibs
426 | })
427 | );
428 | }
429 |
430 | if (!production && hmr) {
431 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
432 | }
433 |
434 | return config;
435 | };
--------------------------------------------------------------------------------
/demo/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | }
12 | aaptOptions {
13 | additionalParameters "--no-version-vectors"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/nstudio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/nstudio.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "57x57",
35 | "idiom" : "iphone",
36 | "filename" : "icon-57.png",
37 | "scale" : "1x"
38 | },
39 | {
40 | "size" : "57x57",
41 | "idiom" : "iphone",
42 | "filename" : "icon-57@2x.png",
43 | "scale" : "2x"
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" : "29x29",
59 | "idiom" : "ipad",
60 | "filename" : "icon-29.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "40x40",
71 | "idiom" : "ipad",
72 | "filename" : "icon-40.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-40@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "50x50",
83 | "idiom" : "ipad",
84 | "filename" : "icon-50.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "50x50",
89 | "idiom" : "ipad",
90 | "filename" : "icon-50@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "72x72",
95 | "idiom" : "ipad",
96 | "filename" : "icon-72.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "72x72",
101 | "idiom" : "ipad",
102 | "filename" : "icon-72@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "icon-76.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "icon-76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "icon-83.5@2x.png",
121 | "scale" : "2x"
122 | }
123 | ],
124 | "info" : {
125 | "version" : 1,
126 | "author" : "xcode"
127 | }
128 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Checkmark.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "idiom": "universal",
5 | "filename": "checkmark.png",
6 | "scale": "1x"
7 | },
8 | {
9 | "idiom": "universal",
10 | "filename": "checkmark@2x.png",
11 | "scale": "2x"
12 | },
13 | {
14 | "idiom": "universal",
15 | "filename": "checkmark@3x.png",
16 | "scale": "3x"
17 | }
18 | ],
19 | "info": {
20 | "version": 1,
21 | "author": "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/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" : "736h",
7 | "filename" : "Default-736h@3x.png",
8 | "minimum-system-version" : "8.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "736h",
16 | "filename" : "Default-Landscape@3x.png",
17 | "minimum-system-version" : "8.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "667h",
25 | "filename" : "Default-667h@2x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "filename" : "Default@2x.png",
34 | "extent" : "full-screen",
35 | "minimum-system-version" : "7.0",
36 | "scale" : "2x"
37 | },
38 | {
39 | "extent" : "full-screen",
40 | "idiom" : "iphone",
41 | "subtype" : "retina4",
42 | "filename" : "Default-568h@2x.png",
43 | "minimum-system-version" : "7.0",
44 | "orientation" : "portrait",
45 | "scale" : "2x"
46 | },
47 | {
48 | "orientation" : "portrait",
49 | "idiom" : "ipad",
50 | "filename" : "Default-Portrait.png",
51 | "extent" : "full-screen",
52 | "minimum-system-version" : "7.0",
53 | "scale" : "1x"
54 | },
55 | {
56 | "orientation" : "landscape",
57 | "idiom" : "ipad",
58 | "filename" : "Default-Landscape.png",
59 | "extent" : "full-screen",
60 | "minimum-system-version" : "7.0",
61 | "scale" : "1x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "ipad",
66 | "filename" : "Default-Portrait@2x.png",
67 | "extent" : "full-screen",
68 | "minimum-system-version" : "7.0",
69 | "scale" : "2x"
70 | },
71 | {
72 | "orientation" : "landscape",
73 | "idiom" : "ipad",
74 | "filename" : "Default-Landscape@2x.png",
75 | "extent" : "full-screen",
76 | "minimum-system-version" : "7.0",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "iphone",
82 | "filename" : "Default.png",
83 | "extent" : "full-screen",
84 | "scale" : "1x"
85 | },
86 | {
87 | "orientation" : "portrait",
88 | "idiom" : "iphone",
89 | "filename" : "Default@2x.png",
90 | "extent" : "full-screen",
91 | "scale" : "2x"
92 | },
93 | {
94 | "orientation" : "portrait",
95 | "idiom" : "iphone",
96 | "filename" : "Default-568h@2x.png",
97 | "extent" : "full-screen",
98 | "subtype" : "retina4",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "extent" : "to-status-bar",
105 | "scale" : "1x"
106 | },
107 | {
108 | "orientation" : "portrait",
109 | "idiom" : "ipad",
110 | "filename" : "Default-Portrait.png",
111 | "extent" : "full-screen",
112 | "scale" : "1x"
113 | },
114 | {
115 | "orientation" : "landscape",
116 | "idiom" : "ipad",
117 | "extent" : "to-status-bar",
118 | "scale" : "1x"
119 | },
120 | {
121 | "orientation" : "landscape",
122 | "idiom" : "ipad",
123 | "filename" : "Default-Landscape.png",
124 | "extent" : "full-screen",
125 | "scale" : "1x"
126 | },
127 | {
128 | "orientation" : "portrait",
129 | "idiom" : "ipad",
130 | "extent" : "to-status-bar",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "ipad",
136 | "filename" : "Default-Portrait@2x.png",
137 | "extent" : "full-screen",
138 | "scale" : "2x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "extent" : "to-status-bar",
144 | "scale" : "2x"
145 | },
146 | {
147 | "orientation" : "landscape",
148 | "idiom" : "ipad",
149 | "filename" : "Default-Landscape@2x.png",
150 | "extent" : "full-screen",
151 | "scale" : "2x"
152 | }
153 | ],
154 | "info" : {
155 | "version" : 1,
156 | "author" : "xcode"
157 | }
158 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.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 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/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/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.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 |
--------------------------------------------------------------------------------
/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 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
6 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/nstudio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/demo/app/App_Resources/iOS/nstudio.png
--------------------------------------------------------------------------------
/demo/app/app-root.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/demo/app/app.css:
--------------------------------------------------------------------------------
1 | @import '~nativescript-theme-core/css/core.light.css';
2 |
3 | Page {
4 | background: linear-gradient(tobottom, #f0f2f0, #000c40);
5 | }
6 |
7 | ActionBar {
8 | background-color: #f0f2f0;
9 | color: #444;
10 | }
11 |
12 | .btn-tide {
13 | background-color: #642b73;
14 | color: white;
15 | }
16 |
17 | .btn-burning {
18 | background-color: #ff4b2b;
19 | color: white;
20 | }
21 |
--------------------------------------------------------------------------------
/demo/app/app.ts:
--------------------------------------------------------------------------------
1 | import { Application } from '@nativescript/core';
2 | Application.run({ moduleName: 'app-root' });
3 |
--------------------------------------------------------------------------------
/demo/app/main-page.android.css:
--------------------------------------------------------------------------------
1 | button {
2 | padding: 4;
3 | margin: 10 0;
4 | width: 90%;
5 | }
6 |
--------------------------------------------------------------------------------
/demo/app/main-page.ios.css:
--------------------------------------------------------------------------------
1 | button {
2 | font-size: 16;
3 | padding: 6;
4 | margin: 10 0;
5 | width: 90%;
6 | border-radius: 3;
7 | }
8 |
--------------------------------------------------------------------------------
/demo/app/main-page.ts:
--------------------------------------------------------------------------------
1 | import { LoadingTest } from './main-view-model';
2 |
3 | export function navigatedTo(args) {
4 | const page = args.object;
5 | page.bindingContext = new LoadingTest(page);
6 | }
7 |
--------------------------------------------------------------------------------
/demo/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/demo/app/main-view-model.ts:
--------------------------------------------------------------------------------
1 | import { Dialogs, Observable, Page, Utils } from '@nativescript/core';
2 | import {
3 | LoadingIndicator,
4 | Mode,
5 | } from '@nstudio/nativescript-loading-indicator';
6 |
7 | export class LoadingTest extends Observable {
8 | private indicator: LoadingIndicator;
9 | private stackView: any;
10 | private _testTarget: boolean;
11 |
12 | constructor(page: Page) {
13 | super();
14 | // uncomment - test target view
15 | // this.stackView = page.getViewById('stackView');
16 | this.indicator = new LoadingIndicator();
17 | }
18 |
19 | nStudioIconTap() {
20 | Dialogs.confirm({
21 | message:
22 | 'nStudio, LLC. specializes in custom software applications ranging from mobile, web, desktop, server and more. Would you like to visit nstudio.io?',
23 | okButtonText: 'Yes',
24 | cancelButtonText: 'Close',
25 | }).then((result) => {
26 | if (result) {
27 | Utils.openUrl('https://nstudio.io');
28 | }
29 | });
30 | }
31 |
32 | public showLoader() {
33 | this.indicator.show({
34 | message: 'Loading test...',
35 | });
36 |
37 | setTimeout(() => {
38 | this.indicator.show({
39 | message: 'TextMode',
40 | mode: Mode.Text,
41 | });
42 | }, 2000);
43 |
44 | setTimeout(() => {
45 | this.indicator.show({
46 | message: 'Updating',
47 | mode: Mode.Indeterminate,
48 | });
49 | this.demoProgress('red');
50 | }, 3000);
51 |
52 | // to test target view
53 | // uncomment - then can toggle this method to show/hide in target
54 | // if (!this._testTarget) {
55 | // this._testTarget = true;
56 | // this.indicator.show({
57 | // message: 'Loading test...',
58 | // ios: {
59 | // view: this.stackView.ios
60 | // }
61 | // });
62 | // } else {
63 | // this._testTarget = false;
64 | // this.indicator.hide();
65 | // }
66 | }
67 |
68 | public showLoaderNoBezel() {
69 | this.indicator.show({
70 | message: 'Loading, no bezel!',
71 | color: '#38ef7d',
72 | hideBezel: true,
73 | });
74 | this.demoLoader();
75 | }
76 |
77 | public showLoaderMsgAndDetails() {
78 | this.indicator.show({
79 | message: 'One moment',
80 | details: 'Updating data...',
81 | });
82 | setTimeout(() => {
83 | this.indicator.show({
84 | details: 'Transferring secret codes...',
85 | });
86 | this.demoLoader();
87 | }, 1000);
88 | }
89 |
90 | public showLoaderSquare() {
91 | this.indicator.show({ ios: { square: true } });
92 | this.demoLoader();
93 | }
94 |
95 | public showLoaderMargin() {
96 | this.indicator.show({
97 | message: 'Message offset margin...',
98 | margin: 30,
99 | });
100 | this.demoLoader();
101 | }
102 |
103 | public showLoaderDimBg() {
104 | this.indicator.show({
105 | dimBackground: true,
106 | message: 'Dimmed the background.',
107 | color: '#3F5EFB',
108 | });
109 | this.demoLoader();
110 | }
111 |
112 | public showLoaderColor() {
113 | this.indicator.show({
114 | color: '#8A2BE2',
115 | backgroundColor: '#4B9ED6',
116 | });
117 | this.demoLoader();
118 | }
119 |
120 | public showLoaderIndeterminate() {
121 | this.indicator.show({
122 | message: 'Indeterminate Mode',
123 | backgroundColor: '#3F5EFB',
124 | color: '#fff000',
125 | mode: Mode.Indeterminate,
126 | });
127 |
128 | setTimeout(() => {
129 | this.indicator.hide();
130 | }, 3500);
131 | }
132 |
133 | public showLoaderDeterminate() {
134 | this.indicator.show({
135 | message: 'Determinate Mode',
136 | backgroundColor: '#3F5EFB',
137 | color: '#fff000',
138 | mode: Mode.Determinate,
139 | });
140 |
141 | setTimeout(() => {
142 | this.indicator.hide();
143 | }, 3500);
144 | }
145 |
146 | public showLoaderAnnularDeterminate() {
147 | this.indicator.show({
148 | message: 'Annular Determinate Mode',
149 | color: '#38ef7d',
150 | backgroundColor: '#000',
151 | mode: Mode.AnnularDeterminate,
152 | });
153 |
154 | setTimeout(() => {
155 | this.indicator.hide();
156 | }, 3500);
157 | }
158 |
159 | public showLoaderDeterminateHorizontalBar() {
160 | const mode = Mode.DeterminateHorizontalBar;
161 | const color = '#FF0099';
162 |
163 | this.indicator.show({
164 | message: 'Determinate Horizontal Bar Mode',
165 | color,
166 | backgroundColor: '#240b36',
167 | mode,
168 | });
169 |
170 | setTimeout(() => {
171 | this.indicator.show({ progress: 0.15, color, mode });
172 | }, 500);
173 | setTimeout(() => {
174 | this.indicator.show({ progress: 0.35, color, mode });
175 | }, 1500);
176 | setTimeout(() => {
177 | this.indicator.show({ progress: 0.65, color, mode });
178 | }, 2500);
179 | setTimeout(() => {
180 | this.indicator.show({ progress: 0.85, color, mode });
181 | }, 3000);
182 | setTimeout(() => {
183 | this.indicator.show({ progress: 0.99, color, mode });
184 | }, 3750);
185 | setTimeout(() => {
186 | this.indicator.show({ progress: 1, color, mode });
187 | this.indicator.hide();
188 | }, 4500);
189 | }
190 |
191 | public showLoaderModeText() {
192 | this.indicator.show({
193 | message: 'Text only',
194 | mode: Mode.Text,
195 | });
196 | this.demoLoader();
197 | }
198 |
199 | public showLoaderModeCustom() {
200 | this.indicator.show({
201 | message: 'Completed',
202 | details: 'Go wild!',
203 | customView: 'checkmark.png',
204 | mode: Mode.CustomView,
205 | });
206 | this.demoLoader();
207 | }
208 |
209 | public showLoaderCancel() {
210 | let interval;
211 | this.indicator.show({
212 | mode: Mode.Determinate,
213 | android: {
214 | cancelable: true,
215 | cancelListener: (dialog) => {
216 | console.log('cancelled');
217 | clearInterval(interval);
218 | },
219 | },
220 | });
221 |
222 | let count = 0;
223 |
224 | interval = setInterval(() => {
225 | count += 1;
226 | this.indicator.show({ progress: count / 100 });
227 | if (count === 100) {
228 | clearInterval(interval);
229 | this.indicator.hide();
230 | }
231 | }, 500);
232 | }
233 |
234 | private demoLoader() {
235 | setTimeout(() => {
236 | this.indicator.hide();
237 | }, 3000);
238 | }
239 |
240 | private demoProgress(color = '#333') {
241 | setTimeout(() => {
242 | this.indicator.show({ progress: 0.15, color });
243 | }, 500);
244 | setTimeout(() => {
245 | this.indicator.show({ progress: 0.35, color });
246 | }, 1500);
247 | setTimeout(() => {
248 | this.indicator.show({ progress: 0.65, color });
249 | }, 2500);
250 | setTimeout(() => {
251 | this.indicator.show({ progress: 0.85, color });
252 | }, 4000);
253 | setTimeout(() => {
254 | this.indicator.show({ progress: 0.99, color });
255 | }, 4500);
256 | setTimeout(() => {
257 | this.indicator.show({ progress: 1, color });
258 | this.indicator.hide();
259 | }, 5000);
260 | }
261 | }
262 |
--------------------------------------------------------------------------------
/demo/app/tests/tests.js:
--------------------------------------------------------------------------------
1 | var LoadingIndicator = require("nativescript-loading-indicator").LoadingIndicator;
2 | var loadingIndicator = new LoadingIndicator();
3 |
4 | describe("greet function", function() {
5 | it("exists", function() {
6 | expect(loadingIndicator.greet).toBeDefined();
7 | });
8 |
9 | it("returns a string", function() {
10 | expect(loadingIndicator.greet()).toEqual("Hello, NS");
11 | });
12 | });
--------------------------------------------------------------------------------
/demo/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function (config) {
2 | const options = {
3 |
4 | // base path that will be used to resolve all patterns (eg. files, exclude)
5 | basePath: '',
6 |
7 |
8 | // frameworks to use
9 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
10 | frameworks: ["jasmine"],
11 |
12 |
13 | // list of files / patterns to load in the browser
14 | files: ['app/tests/**/*.*'],
15 |
16 |
17 | // list of files to exclude
18 | exclude: [
19 | ],
20 |
21 |
22 | // preprocess matching files before serving them to the browser
23 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
24 | preprocessors: {
25 | },
26 |
27 |
28 | // test results reporter to use
29 | // possible values: 'dots', 'progress'
30 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
31 | reporters: ['progress'],
32 |
33 |
34 | // web server port
35 | port: 9876,
36 |
37 |
38 | // enable / disable colors in the output (reporters and logs)
39 | colors: true,
40 |
41 |
42 | // level of logging
43 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
44 | logLevel: config.LOG_INFO,
45 |
46 |
47 | // enable / disable watching file and executing tests whenever any file changes
48 | autoWatch: true,
49 |
50 |
51 | // start these browsers
52 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
53 | browsers: [],
54 |
55 | customLaunchers: {
56 | android: {
57 | base: 'NS',
58 | platform: 'android'
59 | },
60 | ios: {
61 | base: 'NS',
62 | platform: 'ios'
63 | },
64 | ios_simulator: {
65 | base: 'NS',
66 | platform: 'ios',
67 | arguments: ['--emulator']
68 | }
69 | },
70 |
71 | // Continuous Integration mode
72 | // if true, Karma captures browsers, runs the tests and exits
73 | singleRun: false
74 | };
75 |
76 | setWebpackPreprocessor(config, options);
77 | setWebpack(config, options);
78 |
79 | config.set(options);
80 | }
81 |
82 | function setWebpackPreprocessor(config, options) {
83 | if (config && config.bundle) {
84 | if (!options.preprocessors) {
85 | options.preprocessors = {};
86 | }
87 |
88 | options.files.forEach(file => {
89 | if (!options.preprocessors[file]) {
90 | options.preprocessors[file] = [];
91 | }
92 | options.preprocessors[file].push('webpack');
93 | });
94 | }
95 | }
96 |
97 | function setWebpack(config, options) {
98 | if (config && config.bundle) {
99 | const env = {};
100 | env[config.platform] = true;
101 | env.sourceMap = config.debugBrk;
102 | env.appPath = config.appPath;
103 | options.webpack = require('./webpack.config')(env);
104 | delete options.webpack.entry;
105 | delete options.webpack.output.libraryTarget;
106 | const invalidPluginsForUnitTesting = ["GenerateBundleStarterPlugin", "GenerateNativeScriptEntryPointsPlugin"];
107 | options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/demo/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'org.nativescript.demo',
5 | appResourcesPath: 'app/App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none',
9 | },
10 | appPath: 'app',
11 | } as NativeScriptConfig;
12 |
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "@nativescript/core": "~7.0.3",
4 | "nativescript-theme-core": "^1.0.4",
5 | "nativescript-unit-test-runner": "0.7.0",
6 | "@nstudio/nativescript-loading-indicator": "file:../src"
7 | },
8 | "devDependencies": {
9 | "jasmine-core": "^2.5.2",
10 | "karma": "4.1.0",
11 | "karma-jasmine": "2.0.1",
12 | "karma-nativescript-launcher": "^0.4.0",
13 | "nativescript-css-loader": "~0.26.1",
14 | "tslint": "~6.1.3",
15 | "typescript": "~3.9.7",
16 | "karma-webpack": "3.0.5",
17 | "@nativescript/types": "~7.0.3",
18 | "@nativescript/webpack": "~3.0.4"
19 | },
20 | "scripts": {
21 | "build.plugin": "cd ../src && npm run build",
22 | "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**' --exclude '**/platforms/**'"
23 | },
24 | "main": "app.js"
25 | }
26 |
--------------------------------------------------------------------------------
/demo/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "module": "esnext",
5 | "declaration": false,
6 | "removeComments": false,
7 | "noLib": false,
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "lib": ["es6", "dom", "es2017"],
11 | "pretty": true,
12 | "allowUnreachableCode": false,
13 | "allowUnusedLabels": false,
14 | "noEmitHelpers": true,
15 | "noEmitOnError": false,
16 | "noImplicitAny": false,
17 | "noImplicitReturns": true,
18 | "noImplicitUseStrict": false,
19 | "noFallthroughCasesInSwitch": true,
20 | "baseUrl": ".",
21 | "paths": {
22 | "*": ["./node_modules/*"],
23 | "~/*": ["app/*"]
24 | },
25 | "moduleResolution": "node"
26 | },
27 | "include": ["../src", "**/*"],
28 | "exclude": ["../src/node_modules", "node_modules", "platforms"],
29 | "compileOnSave": false
30 | }
31 |
--------------------------------------------------------------------------------
/demo/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep } = require("path");
2 | const fs = require('fs');
3 |
4 | const webpack = require("webpack");
5 | const nsWebpack = require("@nativescript/webpack");
6 | const nativescriptTarget = require("@nativescript/webpack/nativescript-target");
7 | const { getNoEmitOnErrorFromTSConfig } = require("@nativescript/webpack/utils/tsconfig-utils");
8 | const { CleanWebpackPlugin } = require("clean-webpack-plugin");
9 | const CopyWebpackPlugin = require("copy-webpack-plugin");
10 | const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
11 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
12 | const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
13 | const TerserPlugin = require("terser-webpack-plugin");
14 | const hashSalt = Date.now().toString();
15 |
16 | module.exports = env => {
17 | // Add your custom Activities, Services and other Android app components here.
18 | const appComponents = env.appComponents || [];
19 | appComponents.push(...[
20 | "@nativescript/core/ui/frame",
21 | "@nativescript/core/ui/frame/activity",
22 | ]);
23 |
24 | const platform = env && (env.android && "android" || env.ios && "ios" || env.platform);
25 | if (!platform) {
26 | throw new Error("You need to provide a target platform!");
27 | }
28 |
29 | const platforms = ["ios", "android"];
30 | const projectRoot = __dirname;
31 |
32 | if (env.platform) {
33 | platforms.push(env.platform);
34 | }
35 |
36 | // Default destination inside platforms//...
37 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
38 |
39 | const {
40 | // The 'appPath' and 'appResourcesPath' values are fetched from
41 | // the nsconfig.json configuration file.
42 | appPath = "src",
43 | appResourcesPath = "App_Resources",
44 |
45 | // You can provide the following flags when running 'tns run android|ios'
46 | snapshot, // --env.snapshot
47 | production, // --env.production
48 | uglify, // --env.uglify
49 | report, // --env.report
50 | sourceMap, // --env.sourceMap
51 | hiddenSourceMap, // --env.hiddenSourceMap
52 | hmr, // --env.hmr,
53 | unitTesting, // --env.unitTesting,
54 | testing, // --env.testing
55 | verbose, // --env.verbose
56 | snapshotInDocker, // --env.snapshotInDocker
57 | skipSnapshotTools, // --env.skipSnapshotTools
58 | compileSnapshot // --env.compileSnapshot
59 | } = env;
60 |
61 | const useLibs = compileSnapshot;
62 | const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
63 | const externals = nsWebpack.getConvertedExternals(env.externals);
64 |
65 | let appFullPath = resolve(projectRoot, appPath);
66 | if (!fs.existsSync(appFullPath)) {
67 | // some apps use 'app' directory
68 | appFullPath = resolve(projectRoot, 'app');
69 | }
70 | const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot });
71 | let coreModulesPackageName = "tns-core-modules";
72 | const alias = env.alias || {};
73 | alias['~/package.json'] = resolve(projectRoot, 'package.json');
74 | alias['~'] = appFullPath;
75 |
76 | if (hasRootLevelScopedModules) {
77 | coreModulesPackageName = "@nativescript/core";
78 | alias["tns-core-modules"] = coreModulesPackageName;
79 | }
80 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
81 |
82 | const copyIgnore = { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] };
83 |
84 | const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
85 | const entryPath = `.${sep}${entryModule}.ts`;
86 | const entries = env.entries || {};
87 | entries.bundle = entryPath;
88 |
89 | const tsConfigPath = resolve(projectRoot, "tsconfig.json");
90 |
91 | const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("@nativescript") > -1);
92 | if (platform === "ios" && !areCoreModulesExternal && !testing) {
93 | entries["tns_modules/@nativescript/core/inspector_modules"] = "inspector_modules";
94 | };
95 |
96 | let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
97 |
98 | const itemsToClean = [`${dist}/**/*`];
99 | if (platform === "android") {
100 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "src", "main", "assets", "snapshots")}`);
101 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
102 | }
103 |
104 | const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigPath);
105 |
106 | nsWebpack.processAppComponents(appComponents, platform);
107 | const config = {
108 | mode: production ? "production" : "development",
109 | context: appFullPath,
110 | externals,
111 | watchOptions: {
112 | ignored: [
113 | appResourcesFullPath,
114 | // Don't watch hidden files
115 | "**/.*",
116 | ]
117 | },
118 | target: nativescriptTarget,
119 | entry: entries,
120 | output: {
121 | pathinfo: false,
122 | path: dist,
123 | sourceMapFilename,
124 | libraryTarget: "commonjs2",
125 | filename: "[name].js",
126 | globalObject: "global",
127 | hashSalt
128 | },
129 | resolve: {
130 | extensions: [".ts", ".js", ".scss", ".css"],
131 | // Resolve {N} system modules from @nativescript/core
132 | modules: [
133 | resolve(__dirname, `node_modules/${coreModulesPackageName}`),
134 | resolve(__dirname, "node_modules"),
135 | `node_modules/${coreModulesPackageName}`,
136 | "node_modules",
137 | ],
138 | alias,
139 | // resolve symlinks to symlinked modules
140 | symlinks: true
141 | },
142 | resolveLoader: {
143 | // don't resolve symlinks to symlinked loaders
144 | symlinks: false
145 | },
146 | node: {
147 | // Disable node shims that conflict with NativeScript
148 | "http": false,
149 | "timers": false,
150 | "setImmediate": false,
151 | "fs": "empty",
152 | "__dirname": false,
153 | },
154 | devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
155 | optimization: {
156 | runtimeChunk: "single",
157 | noEmitOnErrors: noEmitOnErrorFromTSConfig,
158 | splitChunks: {
159 | cacheGroups: {
160 | vendor: {
161 | name: "vendor",
162 | chunks: "all",
163 | test: (module, chunks) => {
164 | const moduleName = module.nameForCondition ? module.nameForCondition() : '';
165 | return /[\\/]node_modules[\\/]/.test(moduleName) ||
166 | appComponents.some(comp => comp === moduleName);
167 |
168 | },
169 | enforce: true,
170 | },
171 | }
172 | },
173 | minimize: !!uglify,
174 | minimizer: [
175 | new TerserPlugin({
176 | parallel: true,
177 | cache: true,
178 | sourceMap: isAnySourceMapEnabled,
179 | terserOptions: {
180 | output: {
181 | comments: false,
182 | semicolons: !isAnySourceMapEnabled
183 | },
184 | compress: {
185 | // The Android SBG has problems parsing the output
186 | // when these options are enabled
187 | 'collapse_vars': platform !== "android",
188 | sequences: platform !== "android",
189 | }
190 | }
191 | })
192 | ],
193 | },
194 | module: {
195 | rules: [
196 | {
197 | include: join(appFullPath, entryPath),
198 | use: [
199 | // Require all Android app components
200 | platform === "android" && {
201 | loader: "@nativescript/webpack/helpers/android-app-components-loader",
202 | options: { modules: appComponents }
203 | },
204 |
205 | {
206 | loader: "@nativescript/webpack/bundle-config-loader",
207 | options: {
208 | loadCss: !snapshot, // load the application css if in debug mode
209 | unitTesting,
210 | appFullPath,
211 | projectRoot,
212 | ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
213 | }
214 | },
215 | ].filter(loader => !!loader)
216 | },
217 |
218 | {
219 | test: /\.(ts|css|scss|html|xml)$/,
220 | use: "@nativescript/webpack/hmr/hot-loader"
221 | },
222 |
223 | { test: /\.(html|xml)$/, use: "@nativescript/webpack/helpers/xml-namespace-loader" },
224 |
225 | {
226 | test: /\.css$/,
227 | use: "@nativescript/webpack/helpers/css2json-loader"
228 | },
229 |
230 | {
231 | test: /\.scss$/,
232 | use: [
233 | "@nativescript/webpack/helpers/css2json-loader",
234 | "sass-loader"
235 | ]
236 | },
237 |
238 | {
239 | test: /\.ts$/,
240 | use: {
241 | loader: "ts-loader",
242 | options: {
243 | configFile: tsConfigPath,
244 | // https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#faster-builds
245 | // https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#hot-module-replacement
246 | transpileOnly: true,
247 | allowTsInNodeModules: true,
248 | compilerOptions: {
249 | sourceMap: isAnySourceMapEnabled,
250 | declaration: false
251 | },
252 | getCustomTransformers: (program) => ({
253 | before: [
254 | require("@nativescript/webpack/transformers/ns-transform-native-classes").default
255 | ]
256 | })
257 | },
258 | }
259 | },
260 | ]
261 | },
262 | plugins: [
263 | // Define useful constants like TNS_WEBPACK
264 | new webpack.DefinePlugin({
265 | "global.TNS_WEBPACK": "true",
266 | "global.isAndroid": platform === 'android',
267 | "global.isIOS": platform === 'ios',
268 | "process": "global.process",
269 | }),
270 | // Remove all files from the out dir.
271 | new CleanWebpackPlugin({
272 | cleanOnceBeforeBuildPatterns: itemsToClean,
273 | verbose: !!verbose
274 | }),
275 | // Copy assets
276 | new CopyWebpackPlugin({
277 | patterns: [
278 | { from: 'assets/**', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
279 | { from: 'fonts/**', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
280 | { from: '**/*.jpg', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
281 | { from: '**/*.png', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } },
282 | ],
283 | }),
284 | new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
285 | // For instructions on how to set up workers with webpack
286 | // check out https://github.com/nativescript/worker-loader
287 | new NativeScriptWorkerPlugin(),
288 | new nsWebpack.PlatformFSPlugin({
289 | platform,
290 | platforms,
291 | }),
292 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
293 | new nsWebpack.WatchStateLoggerPlugin(),
294 | // https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#faster-builds
295 | // https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#hot-module-replacement
296 | new ForkTsCheckerWebpackPlugin({
297 | async: false,
298 | typescript: {
299 | configFile: tsConfigPath,
300 | memoryLimit: 4096,
301 | diagnosticOptions: {
302 | syntactic: true,
303 | semantic: true
304 | }
305 | }
306 | })
307 | ],
308 | };
309 |
310 | if (report) {
311 | // Generate report files for bundles content
312 | config.plugins.push(new BundleAnalyzerPlugin({
313 | analyzerMode: "static",
314 | openAnalyzer: false,
315 | generateStatsFile: true,
316 | reportFilename: resolve(projectRoot, "report", `report.html`),
317 | statsFilename: resolve(projectRoot, "report", `stats.json`),
318 | }));
319 | }
320 |
321 | if (snapshot) {
322 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
323 | chunk: "vendor",
324 | requireModules: [
325 | "@nativescript/core/bundle-entry-points",
326 | ],
327 | projectRoot,
328 | webpackConfig: config,
329 | snapshotInDocker,
330 | skipSnapshotTools,
331 | useLibs
332 | }));
333 | }
334 |
335 | if (hmr) {
336 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
337 | }
338 |
339 | return config;
340 | };
341 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "ci.base.setup": "npm i -g typescript@3.9.7 && echo no | npm i -g nativescript && tns usage-reporting disable && tns error-reporting disable && cd src && npm i && tsc",
4 | "ci.pip.install": "sudo pip install --upgrade pip && sudo pip install six",
5 | "ci.tslint": "cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint",
6 | "ci.vanilla.android.build": "cd demo && tns build android --env.uglify",
7 | "ci.vanilla.ios.build": "cd demo && tns build ios --env.uglify"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/publish/pack.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SOURCE_DIR=../src
4 | TO_SOURCE_DIR=src
5 | PACK_DIR=package
6 | ROOT_DIR=..
7 | PUBLISH=--publish
8 |
9 | install() {
10 | npm i
11 | }
12 |
13 | pack() {
14 |
15 | echo 'Clearing /src and /package...'
16 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
17 | node_modules/.bin/rimraf "$PACK_DIR"
18 |
19 | # copy src
20 | echo 'Copying src...'
21 | node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR"
22 |
23 | # copy README & LICENSE to src
24 | echo 'Copying README and LICENSE to /src...'
25 | node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE
26 | node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md
27 |
28 | # compile package and copy files required by npm
29 | echo 'Building /src...'
30 | cd "$TO_SOURCE_DIR"
31 | node_modules/.bin/tsc
32 | cd ..
33 |
34 | echo 'Creating package...'
35 | # create package dir
36 | mkdir "$PACK_DIR"
37 |
38 | # create the package
39 | cd "$PACK_DIR"
40 | npm pack ../"$TO_SOURCE_DIR"
41 |
42 | # delete source directory used to create the package
43 | cd ..
44 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
45 | }
46 |
47 | install && pack
48 |
--------------------------------------------------------------------------------
/publish/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-publish",
3 | "version": "1.0.0",
4 | "description": "Publish helper",
5 | "devDependencies": {
6 | "ncp": "^2.0.0",
7 | "rimraf": "^2.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/publish/publish.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PACK_DIR=package
4 |
5 | publish() {
6 | cd $PACK_DIR
7 | echo 'Publishing to npm...'
8 | npm publish *.tgz
9 | }
10 |
11 | ./pack.sh && publish
12 |
--------------------------------------------------------------------------------
/screenshots/android/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/android/1.png
--------------------------------------------------------------------------------
/screenshots/android/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/android/2.png
--------------------------------------------------------------------------------
/screenshots/android/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/android/3.png
--------------------------------------------------------------------------------
/screenshots/android/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/android/4.png
--------------------------------------------------------------------------------
/screenshots/ios/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/ios/1.png
--------------------------------------------------------------------------------
/screenshots/ios/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/ios/2.png
--------------------------------------------------------------------------------
/screenshots/ios/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/ios/3.png
--------------------------------------------------------------------------------
/screenshots/ios/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/screenshots/ios/4.png
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | *.map
2 | *.ts
3 | !*.d.ts
4 | tsconfig.json
5 | scripts/*
6 | platforms/android/*
7 | !platforms/android/include.gradle
8 | !platforms/android/*.aar
9 | !platforms/android/*.jar
10 | *.tgz
--------------------------------------------------------------------------------
/src/index.d.ts:
--------------------------------------------------------------------------------
1 | export class LoadingIndicator {
2 | show(options?: OptionsCommon): any;
3 | hide(targetView?: any, attemptTimeout?: number): void;
4 | }
5 |
6 | export interface OptionsCommon {
7 | /**
8 | * Message in the loading indicator.
9 | */
10 | message?: string;
11 |
12 | /**
13 | * Details message in the loading indicator.
14 | */
15 | details?: string;
16 |
17 | /**
18 | * Color of the message text.
19 | */
20 | color?: string;
21 |
22 | /**
23 | * Background color of the loading indicator.
24 | */
25 | backgroundColor?: string;
26 |
27 | /**
28 | * Progress of the indicator when not using CustomView or Text Mode.
29 | */
30 | progress?: number;
31 |
32 | /**
33 | * Margin for the message/indicator to the edge of the bezel.
34 | */
35 | margin?: number;
36 |
37 | /**
38 | * Set true to allow user interaction.
39 | */
40 | userInteractionEnabled?: boolean;
41 |
42 | /**
43 | * Dim the background behind the indicator.
44 | */
45 | dimBackground?: boolean;
46 |
47 | /**
48 | * Hide bezel around indicator
49 | */
50 | hideBezel?: boolean;
51 |
52 | /**
53 | * The mode of the loading indicator.
54 | */
55 | mode?: Mode;
56 |
57 | /**
58 | * If `mode` is set to CustomView, then you can pass an image or view to show in the loading indicator.
59 | */
60 | customView?: any;
61 |
62 | /**
63 | * iOS specific configuration options.
64 | */
65 | ios?: OptionsIOS;
66 |
67 | /**
68 | * Android specific configuration options.
69 | */
70 | android?: OptionsAndroid;
71 | }
72 |
73 | export interface OptionsIOS {
74 | /**
75 | * Native View instance to anchor the loading indicator to.
76 | */
77 | view?: UIView;
78 | square?: boolean;
79 | }
80 |
81 | export interface OptionsAndroid {
82 | /**
83 | * Native View instance to anchor the loading indicator to.
84 | */
85 | view?: android.view.View;
86 | max?: number;
87 | progressNumberFormat?: string;
88 | progressPercentFormat?: number;
89 | progressStyle?: number;
90 | secondaryProgress?: number;
91 | cancelable?: boolean;
92 | cancelListener?: (dialog: any) => void;
93 | elevation?: number;
94 | }
95 |
96 | export enum Mode {
97 | Indeterminate = 0,
98 | Determinate = 1,
99 | DeterminateHorizontalBar = 2,
100 | AnnularDeterminate = 3,
101 | CustomView = 4,
102 | Text = 5,
103 | }
104 |
--------------------------------------------------------------------------------
/src/loading-indicator.common.ts:
--------------------------------------------------------------------------------
1 | export interface OptionsCommon {
2 | /**
3 | * Message in the loading indicator.
4 | */
5 | message?: string;
6 |
7 | /**
8 | * Details message in the loading indicator.
9 | */
10 | details?: string;
11 |
12 | /**
13 | * Color of the message text.
14 | */
15 | color?: string;
16 |
17 | /**
18 | * Background color of the loading indicator.
19 | */
20 | backgroundColor?: string;
21 |
22 | /**
23 | * Progress of the indicator when not using CustomView or Text Mode.
24 | */
25 | progress?: number;
26 |
27 | /**
28 | * Margin for the message/indicator to the edge of the bezel.
29 | */
30 | margin?: number;
31 |
32 | /**
33 | * Set true to allow user interaction.
34 | */
35 | userInteractionEnabled?: boolean;
36 |
37 | /**
38 | * Dim the background behind the indicator.
39 | */
40 | dimBackground?: boolean;
41 |
42 | /**
43 | * Hide bezel around indicator
44 | */
45 | hideBezel?: boolean;
46 |
47 | /**
48 | * The mode of the loading indicator.
49 | */
50 | mode?: Mode;
51 |
52 | /**
53 | * If `mode` is set to CustomView, then you can pass an image or view to show in the loading indicator.
54 | */
55 | customView?: any;
56 |
57 | /**
58 | * iOS specific configuration options.
59 | */
60 | ios?: OptionsIOS;
61 |
62 | /**
63 | * Android specific configuration options.
64 | */
65 | android?: OptionsAndroid;
66 | }
67 |
68 | export interface OptionsIOS {
69 | /**
70 | * Native View instance to anchor the loading indicator to.
71 | */
72 | view?: UIView;
73 | square?: boolean;
74 | }
75 |
76 | export interface OptionsAndroid {
77 | /**
78 | * Native View instance to anchor the loading indicator to.
79 | */
80 | view?: android.view.View;
81 | max?: number;
82 | progressNumberFormat?: string;
83 | progressPercentFormat?: number;
84 | progressStyle?: number;
85 | secondaryProgress?: number;
86 | cancelable?: boolean;
87 | cancelListener?: (dialog: any) => void;
88 | elevation?: number;
89 | }
90 |
91 | export enum Mode {
92 | Indeterminate = 0,
93 | Determinate = 1,
94 | DeterminateHorizontalBar = 2,
95 | AnnularDeterminate = 3,
96 | CustomView = 4,
97 | Text = 5
98 | }
99 |
--------------------------------------------------------------------------------
/src/loading-indicator.ios.ts:
--------------------------------------------------------------------------------
1 | import { Color } from '@nativescript/core';
2 | import { Mode, OptionsCommon } from './loading-indicator.common';
3 |
4 | export * from './loading-indicator.common';
5 |
6 | export class LoadingIndicator {
7 | private _hud: MBProgressHUD;
8 | // iOS allows indicator to be shown on specific views if desired
9 | // fallback to entire window
10 | private _targetView: any; // UIView
11 |
12 | show(options?: OptionsCommon) {
13 | if (typeof options === 'undefined') options = {};
14 |
15 | if (typeof this._hud === 'undefined') {
16 | // use specific target, fallback to entire window
17 | this._targetView =
18 | options.ios && options.ios.view
19 | ? options.ios.view
20 | : this._getRootWindow();
21 | this._hud = MBProgressHUD.showHUDAddedToAnimated(this._targetView, true);
22 | }
23 | // ios specific
24 | if (options.ios && options.ios.square) this._hud.square = true;
25 |
26 | // options
27 | if (options.message) {
28 | this._hud.label.text = options.message;
29 | // allow line breaking
30 | this._hud.label.numberOfLines = 0;
31 | }
32 |
33 | if (options.progress) {
34 | this._hud.progress = options.progress;
35 | }
36 |
37 | if (options.mode) {
38 | (this._hud as any).mode = options.mode; // casting bc we use a custom enum and not MBProgessHUD enum for mode
39 | } else {
40 | (this._hud as any).mode = Mode.Indeterminate;
41 | }
42 |
43 | if (options.dimBackground) {
44 | this._hud.backgroundView.style = MBProgressHUDBackgroundStyle.SolidColor;
45 | this._hud.backgroundView.color = new Color('#000').ios;
46 | this._hud.backgroundView.alpha = 0.3;
47 | }
48 |
49 | if (options.margin) this._hud.margin = options.margin;
50 |
51 | if (options.userInteractionEnabled)
52 | this._hud.userInteractionEnabled = options.userInteractionEnabled;
53 |
54 | if (options.backgroundColor) {
55 | this._hud.bezelView.blurEffectStyle = UIBlurEffectStyle.Regular;
56 | this._hud.bezelView.backgroundColor = new Color(
57 | options.backgroundColor
58 | ).ios;
59 | }
60 |
61 | if (options.color) {
62 | // make activity and main label same color
63 | this._hud.contentColor = new Color(options.color).ios; // setting this seems to enforce coloring the activity indicator correctly
64 | this._hud.label.textColor = new Color(options.color).ios;
65 | }
66 |
67 | if (options.details) {
68 | this._hud.detailsLabel.text = options.details;
69 | // detail label same color with 80% opacity of that color
70 | // TODO: allow specific control
71 | this._hud.detailsLabel.textColor =
72 | options && options.color
73 | ? new Color(options.color).ios
74 | : new Color('#333').ios;
75 | this._hud.detailsLabel.alpha = 0.8;
76 | }
77 |
78 | if (options.hideBezel) {
79 | this._hud.backgroundColor = UIColor.clearColor;
80 | this._hud.bezelView.style = MBProgressHUDBackgroundStyle.SolidColor;
81 | this._hud.bezelView.backgroundColor = UIColor.clearColor;
82 | }
83 |
84 | // handle mode setting for custom view Mode
85 | if (
86 | this._hud.mode &&
87 | (this._hud as any).mode === Mode.CustomView && // casting to any for custom enum we map to
88 | options.customView
89 | ) {
90 | if (options.customView instanceof UIImage) {
91 | this._hud.customView = UIImageView.alloc().initWithImage(
92 | options.customView
93 | );
94 | } else if (options.customView instanceof UIView) {
95 | this._hud.customView = options.customView;
96 | } else if (typeof options.customView === 'string') {
97 | this._hud.customView = UIImageView.alloc().initWithImage(
98 | UIImage.imageNamed(options.customView)
99 | );
100 | }
101 | }
102 |
103 | return this._hud;
104 | }
105 |
106 | hide(targetView?: any) {
107 | targetView = targetView || this._targetView || this._getRootWindow();
108 | MBProgressHUD.hideHUDForViewAnimated(targetView, true);
109 | this._hud = undefined;
110 | }
111 |
112 | private _getRootWindow() {
113 | return UIApplication.sharedApplication.windows[0];
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nstudio/nativescript-loading-indicator",
3 | "version": "4.1.0",
4 | "description": "A NativeScript plugin for showing an overlayed loading indicator.",
5 | "main": "loading-indicator",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "android": "2.5.0",
10 | "ios": "2.5.0"
11 | }
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/nstudio/nativescript-loading-indicator.git"
16 | },
17 | "scripts": {
18 | "tsc": "tsc -skipLibCheck",
19 | "build": "npm run tsc && npm run build.native",
20 | "build.native": "node scripts/build-native.js",
21 | "postclone": "npm run npm-i && node scripts/postclone.js && cd ../demo && npm run npm-i && npx rimraf -- package-lock.json && cd ../src",
22 | "npm-i": "npm i --legacy-peer-deps",
23 | "test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
24 | "test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
25 | "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\" --exclude '**/platforms/**' --exclude \"**/typings/**\"",
26 | "demo.ios": "npm run tsc && cd ../demo && tns run ios",
27 | "demo.android": "npm run tsc && cd ../demo && tns run android",
28 | "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
29 | "demo-angular.ios": "npm run npm-i && cd ../demo-angular && tns run ios",
30 | "demo-angular.android": "npm run npm-i && cd ../demo-angular && tns run android",
31 | "demo-angular.reset": "cd ../demo-angular && npx rimraf -- hooks node_modules platforms package-lock.json",
32 | "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-loading-indicator && tns plugin add ../src",
33 | "clean": "npm run demo.reset && npx rimraf node_modules package-lock.json && npm run npm-i",
34 | "ci.tslint": "npm run npm-i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**' --exclude '**/typings/**'",
35 | "prepack": "npm run build.native",
36 | "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!'"
37 | },
38 | "lint-staged": {
39 | "**/*.{js, css, ts, json, scss, html, xml, md}": [
40 | "prettier --write",
41 | "git add"
42 | ]
43 | },
44 | "husky": {
45 | "hooks": {
46 | "pre-commit": "lint-staged",
47 | "pre-push": "npm run tslint"
48 | }
49 | },
50 | "keywords": [
51 | "NativeScript",
52 | "JavaScript",
53 | "Android",
54 | "iOS",
55 | "loading-indicator",
56 | "Loading",
57 | "Progress",
58 | "MBProgressHUD",
59 | "nStudio",
60 | "ProgressDialog"
61 | ],
62 | "author": {
63 | "name": "Nathan Walker",
64 | "email": "walkerrunpdx@gmail.com"
65 | },
66 | "contributors": [
67 | {
68 | "name": "Osei Fortune",
69 | "email": "fortune.osei@yahoo.com"
70 | },
71 | {
72 | "name": "Brad Martin",
73 | "email": "bradwaynemartin@gmail.com"
74 | }
75 | ],
76 | "bugs": {
77 | "url": "https://github.com/nstudio/nativescript-loading-indicator/issues"
78 | },
79 | "license": "Apache-2.0",
80 | "homepage": "https://github.com/nstudio/nativescript-loading-indicator",
81 | "readmeFilename": "README.md",
82 | "devDependencies": {
83 | "husky": "~4.3.0",
84 | "lint-staged": "~10.5.0",
85 | "prettier": "~2.2.1",
86 | "@nativescript/core": "~8.0.0",
87 | "@nativescript/types": "~8.0.0",
88 | "typescript": "~4.1.0",
89 | "prompt": "^1.0.0",
90 | "rimraf": "^3.0.2",
91 | "tslint": "^6.1.3",
92 | "semver": "^5.6.0"
93 | },
94 | "dependencies": {}
95 | }
96 |
--------------------------------------------------------------------------------
/src/platforms/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/src/platforms/android/nativescript_loading_indicator.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nstudio/nativescript-loading-indicator/31a3c2e7c9010dc89d7aa8243167732d2672364c/src/platforms/android/nativescript_loading_indicator.aar
--------------------------------------------------------------------------------
/src/platforms/android/res/drawable/circle_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/platforms/android/res/drawable/circular_progress_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/platforms/android/res/drawable/circular_progress_bar_thick.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
10 |
11 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/platforms/ios/Podfile:
--------------------------------------------------------------------------------
1 | pod 'MBProgressHUD', '~> 1.2.0'
--------------------------------------------------------------------------------
/src/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
--------------------------------------------------------------------------------
/src/scripts/build-native.js:
--------------------------------------------------------------------------------
1 | const { exec } = require('child_process');
2 | const semver = require('semver');
3 |
4 | console.log(`executing 'ns plugin build'`);
5 | exec('ns plugin build', (err, stdout, stderr) => {
6 | if (err) {
7 | // node couldn't execute the command
8 | console.log(`${err}`);
9 | return;
10 | }
11 | });
12 |
--------------------------------------------------------------------------------
/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "rootDir": ".",
4 | "target": "ES2017",
5 | "module": "esnext",
6 | "sourceMap": true,
7 | "declaration": true,
8 | "moduleResolution": "node",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "noEmitOnError": true,
12 | "noEmitHelpers": true,
13 | "diagnostics": true,
14 | "skipLibCheck": true,
15 | "skipDefaultLibCheck": true,
16 | "lib": ["es2017", "dom"],
17 | "pretty": false,
18 | "allowUnreachableCode": false,
19 | "allowUnusedLabels": false,
20 | "noImplicitAny": false,
21 | "noImplicitReturns": true,
22 | "noImplicitUseStrict": false,
23 | "noFallthroughCasesInSwitch": true
24 | },
25 | "exclude": ["node_modules", "typings"],
26 | "compileOnSave": false
27 | }
28 |
--------------------------------------------------------------------------------
/src/typings/objc!MBProgressHUD.d.ts:
--------------------------------------------------------------------------------
1 | declare class MBBackgroundView extends UIView {
2 | static alloc(): MBBackgroundView; // inherited from NSObject
3 |
4 | static appearance(): MBBackgroundView; // inherited from UIAppearance
5 |
6 | static appearanceForTraitCollection(
7 | trait: UITraitCollection
8 | ): MBBackgroundView; // inherited from UIAppearance
9 |
10 | static appearanceForTraitCollectionWhenContainedIn(
11 | trait: UITraitCollection,
12 | ContainerClass: typeof NSObject
13 | ): MBBackgroundView; // inherited from UIAppearance
14 |
15 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(
16 | trait: UITraitCollection,
17 | containerTypes: NSArray | typeof NSObject[]
18 | ): MBBackgroundView; // inherited from UIAppearance
19 |
20 | static appearanceWhenContainedIn(
21 | ContainerClass: typeof NSObject
22 | ): MBBackgroundView; // inherited from UIAppearance
23 |
24 | static appearanceWhenContainedInInstancesOfClasses(
25 | containerTypes: NSArray | typeof NSObject[]
26 | ): MBBackgroundView; // inherited from UIAppearance
27 |
28 | static new(): MBBackgroundView; // inherited from NSObject
29 |
30 | blurEffectStyle: UIBlurEffectStyle;
31 |
32 | color: UIColor;
33 |
34 | style: MBProgressHUDBackgroundStyle;
35 | }
36 |
37 | declare class MBBarProgressView extends UIView {
38 | static alloc(): MBBarProgressView; // inherited from NSObject
39 |
40 | static appearance(): MBBarProgressView; // inherited from UIAppearance
41 |
42 | static appearanceForTraitCollection(
43 | trait: UITraitCollection
44 | ): MBBarProgressView; // inherited from UIAppearance
45 |
46 | static appearanceForTraitCollectionWhenContainedIn(
47 | trait: UITraitCollection,
48 | ContainerClass: typeof NSObject
49 | ): MBBarProgressView; // inherited from UIAppearance
50 |
51 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(
52 | trait: UITraitCollection,
53 | containerTypes: NSArray | typeof NSObject[]
54 | ): MBBarProgressView; // inherited from UIAppearance
55 |
56 | static appearanceWhenContainedIn(
57 | ContainerClass: typeof NSObject
58 | ): MBBarProgressView; // inherited from UIAppearance
59 |
60 | static appearanceWhenContainedInInstancesOfClasses(
61 | containerTypes: NSArray | typeof NSObject[]
62 | ): MBBarProgressView; // inherited from UIAppearance
63 |
64 | static new(): MBBarProgressView; // inherited from NSObject
65 |
66 | lineColor: UIColor;
67 |
68 | progress: number;
69 |
70 | progressColor: UIColor;
71 |
72 | progressRemainingColor: UIColor;
73 | }
74 |
75 | declare class MBProgressHUD extends UIView {
76 | static HUDForView(view: UIView): MBProgressHUD;
77 |
78 | static alloc(): MBProgressHUD; // inherited from NSObject
79 |
80 | static appearance(): MBProgressHUD; // inherited from UIAppearance
81 |
82 | static appearanceForTraitCollection(trait: UITraitCollection): MBProgressHUD; // inherited from UIAppearance
83 |
84 | static appearanceForTraitCollectionWhenContainedIn(
85 | trait: UITraitCollection,
86 | ContainerClass: typeof NSObject
87 | ): MBProgressHUD; // inherited from UIAppearance
88 |
89 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(
90 | trait: UITraitCollection,
91 | containerTypes: NSArray | typeof NSObject[]
92 | ): MBProgressHUD; // inherited from UIAppearance
93 |
94 | static appearanceWhenContainedIn(
95 | ContainerClass: typeof NSObject
96 | ): MBProgressHUD; // inherited from UIAppearance
97 |
98 | static appearanceWhenContainedInInstancesOfClasses(
99 | containerTypes: NSArray | typeof NSObject[]
100 | ): MBProgressHUD; // inherited from UIAppearance
101 |
102 | static hideHUDForViewAnimated(view: UIView, animated: boolean): boolean;
103 |
104 | static new(): MBProgressHUD; // inherited from NSObject
105 |
106 | static showHUDAddedToAnimated(view: UIView, animated: boolean): MBProgressHUD;
107 |
108 | animationType: MBProgressHUDAnimation;
109 |
110 | readonly backgroundView: MBBackgroundView;
111 |
112 | readonly bezelView: MBBackgroundView;
113 |
114 | readonly button: UIButton;
115 |
116 | completionBlock: () => void;
117 |
118 | contentColor: UIColor;
119 |
120 | customView: UIView;
121 |
122 | defaultMotionEffectsEnabled: boolean;
123 |
124 | delegate: MBProgressHUDDelegate;
125 |
126 | readonly detailsLabel: UILabel;
127 |
128 | graceTime: number;
129 |
130 | readonly label: UILabel;
131 |
132 | margin: number;
133 |
134 | minShowTime: number;
135 |
136 | minSize: CGSize;
137 |
138 | mode: MBProgressHUDMode;
139 |
140 | offset: CGPoint;
141 |
142 | progress: number;
143 |
144 | progressObject: NSProgress;
145 |
146 | removeFromSuperViewOnHide: boolean;
147 |
148 | square: boolean;
149 |
150 | constructor(o: { view: UIView });
151 |
152 | hideAnimated(animated: boolean): void;
153 |
154 | hideAnimatedAfterDelay(animated: boolean, delay: number): void;
155 |
156 | initWithView(view: UIView): this;
157 |
158 | showAnimated(animated: boolean): void;
159 | }
160 |
161 | declare const enum MBProgressHUDAnimation {
162 | Fade = 0,
163 |
164 | Zoom = 1,
165 |
166 | ZoomOut = 2,
167 |
168 | ZoomIn = 3
169 | }
170 |
171 | declare const enum MBProgressHUDBackgroundStyle {
172 | SolidColor = 0,
173 |
174 | Blur = 1
175 | }
176 |
177 | interface MBProgressHUDDelegate extends NSObjectProtocol {
178 | hudWasHidden?(hud: MBProgressHUD): void;
179 | }
180 | declare var MBProgressHUDDelegate: {
181 | prototype: MBProgressHUDDelegate;
182 | };
183 |
184 | declare const enum MBProgressHUDMode {
185 | Indeterminate = 0,
186 |
187 | Determinate = 1,
188 |
189 | DeterminateHorizontalBar = 2,
190 |
191 | AnnularDeterminate = 3,
192 |
193 | CustomView = 4,
194 |
195 | Text = 5
196 | }
197 |
198 | declare var MBProgressHUDVersionNumber: number;
199 |
200 | declare var MBProgressHUDVersionString: interop.Reference;
201 |
202 | declare var MBProgressMaxOffset: number;
203 |
204 | declare class MBRoundProgressView extends UIView {
205 | static alloc(): MBRoundProgressView; // inherited from NSObject
206 |
207 | static appearance(): MBRoundProgressView; // inherited from UIAppearance
208 |
209 | static appearanceForTraitCollection(
210 | trait: UITraitCollection
211 | ): MBRoundProgressView; // inherited from UIAppearance
212 |
213 | static appearanceForTraitCollectionWhenContainedIn(
214 | trait: UITraitCollection,
215 | ContainerClass: typeof NSObject
216 | ): MBRoundProgressView; // inherited from UIAppearance
217 |
218 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(
219 | trait: UITraitCollection,
220 | containerTypes: NSArray | typeof NSObject[]
221 | ): MBRoundProgressView; // inherited from UIAppearance
222 |
223 | static appearanceWhenContainedIn(
224 | ContainerClass: typeof NSObject
225 | ): MBRoundProgressView; // inherited from UIAppearance
226 |
227 | static appearanceWhenContainedInInstancesOfClasses(
228 | containerTypes: NSArray | typeof NSObject[]
229 | ): MBRoundProgressView; // inherited from UIAppearance
230 |
231 | static new(): MBRoundProgressView; // inherited from NSObject
232 |
233 | annular: boolean;
234 |
235 | backgroundTintColor: UIColor;
236 |
237 | progress: number;
238 |
239 | progressTintColor: UIColor;
240 | }
241 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "class-name": true,
4 | "prefer-const": true,
5 | "comment-format": [true, "check-space"],
6 | "indent": [true, "spaces"],
7 | "no-duplicate-variable": true,
8 | "no-eval": 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, "double"],
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 |
--------------------------------------------------------------------------------