├── .gitignore
├── README.md
├── demo
├── .editorconfig
├── .gitignore
├── LICENSE
├── app
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── app.gradle
│ │ │ └── src
│ │ │ │ └── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-nodpi
│ │ │ │ └── splash_screen.xml
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ │ ├── values-v21
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ └── iOS
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── icon-1024.png
│ │ │ │ ├── icon-20.png
│ │ │ │ ├── icon-20@2x.png
│ │ │ │ ├── icon-20@3x.png
│ │ │ │ ├── icon-29.png
│ │ │ │ ├── icon-29@2x.png
│ │ │ │ ├── icon-29@3x.png
│ │ │ │ ├── icon-40.png
│ │ │ │ ├── icon-40@2x.png
│ │ │ │ ├── icon-40@3x.png
│ │ │ │ ├── icon-60@2x.png
│ │ │ │ ├── icon-60@3x.png
│ │ │ │ ├── icon-76.png
│ │ │ │ ├── icon-76@2x.png
│ │ │ │ └── icon-83.5@2x.png
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.launchimage
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Default-1125h.png
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default-667h@2x.png
│ │ │ │ ├── Default-736h@3x.png
│ │ │ │ ├── Default-Landscape-X.png
│ │ │ │ ├── Default-Landscape-XR.png
│ │ │ │ ├── Default-Landscape-XS-Max.png
│ │ │ │ ├── Default-Landscape.png
│ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ ├── Default-Portrait-XR.png
│ │ │ │ ├── Default-Portrait-XS-Max.png
│ │ │ │ ├── Default-Portrait.png
│ │ │ │ ├── Default-Portrait@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ └── Default@2x.png
│ │ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ ├── LaunchScreen-AspectFill@2x.png
│ │ │ │ └── LaunchScreen-AspectFill@3x.png
│ │ │ └── LaunchScreen.Center.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ │ └── LaunchScreen-Center@3x.png
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── build.xcconfig
│ ├── app-root.xml
│ ├── app.css
│ ├── app.js
│ ├── main-page.js
│ ├── main-page.xml
│ ├── main-page2.js
│ ├── main-page2.xml
│ ├── package.json
│ └── references.d.ts
├── jsconfig.json
├── package-lock.json
├── package.json
└── webpack.config.js
├── docs
└── orientation1.gif
└── src
├── .npmignore
├── LICENSE
├── README.md
├── index.d.ts
├── orientation.js
├── package.json
├── postinstall.js
└── unmaintained.svg
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea
2 | /demo/node_modules/
3 | /demo/platforms/
4 | *.tar
5 | *.tgz
6 | /src/node_modules/
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Archived
2 | See: https://fluentreports.com/blog/?p=1434
3 |
4 |
5 |
6 | # NativeScript-Orientation
7 |
8 |

9 |
10 | We have an awesome, new service in town! This service provides tested new and upgraded plugins. All ProPlugins are already known to work with NativeScript 6.x.
11 | If you are interested in getting the latest, known working, and enhanced plugins; check out https://ProPlugins.org -- because I strongly believe in what ProPlugins offers the community all of my development work is being done on the ProPlugins version.
12 |
13 | Please feel free to continue to use this version of the plugin, it is now 100% being maintained by **YOU** the community, and as such
14 | I will gladly continue to support the community version by accepting any/all PR's for this plugin and publish it. I will attempt to verify the PR doesn't have any backdoors; but I won't be doing any testing, so if it is broken it is up to you to send a PR!
15 |
16 |
17 | ## Documentation
18 | The [documentation](src/README.md) for the plugin is located in the [src folder](src).
19 |
--------------------------------------------------------------------------------
/demo/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | charset = utf-8
8 |
9 | [*.json]
10 | indent_style = space
11 | indent_size = 2
12 |
13 | [*.js]
14 | indent_style = space
15 | indent_size = 4
16 |
--------------------------------------------------------------------------------
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | # NativeScript
2 | hooks/
3 | node_modules/
4 | platforms/
5 |
6 | # NativeScript Template
7 | *.js.map
8 |
9 | # Logs
10 | logs
11 | *.log
12 | npm-debug.log*
13 | yarn-debug.log*
14 | yarn-error.log*
15 |
16 | # General
17 | .DS_Store
18 | .AppleDouble
19 | .LSOverride
20 | .idea
21 | .cloud
22 | .project
23 | tmp/
24 | typings/
25 |
26 | # Visual Studio Code
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 |
--------------------------------------------------------------------------------
/demo/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/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // implementation 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | // If you want to add something to be applied before applying plugins' include.gradle files
9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1"
10 | // create a file named before-plugins.gradle in the current directory and place it there
11 |
12 | android {
13 | defaultConfig {
14 | minSdkVersion 17
15 | generatedDensities = []
16 | }
17 | aaptOptions {
18 | additionalParameters "--no-version-vectors"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/demo/app/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/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "icon-29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "icon-29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "icon-40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "icon-40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "icon-20.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "icon-20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "icon-29.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "icon-29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "icon-40.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "icon-40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "icon-76.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "icon-76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "icon-83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "icon-1024.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2688h",
7 | "filename" : "Default-Portrait-XS-Max.png",
8 | "minimum-system-version" : "12.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "2688h",
16 | "filename" : "Default-Landscape-XS-Max.png",
17 | "minimum-system-version" : "12.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "1792h",
25 | "filename" : "Default-Portrait-XR.png",
26 | "minimum-system-version" : "12.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "1792h",
34 | "filename" : "Default-Landscape-XR.png",
35 | "minimum-system-version" : "12.0",
36 | "orientation" : "landscape",
37 | "scale" : "2x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "2436h",
43 | "filename" : "Default-1125h.png",
44 | "minimum-system-version" : "11.0",
45 | "orientation" : "portrait",
46 | "scale" : "3x"
47 | },
48 | {
49 | "extent" : "full-screen",
50 | "idiom" : "iphone",
51 | "subtype" : "2436h",
52 | "filename" : "Default-Landscape-X.png",
53 | "minimum-system-version" : "11.0",
54 | "orientation" : "landscape",
55 | "scale" : "3x"
56 | },
57 | {
58 | "extent" : "full-screen",
59 | "idiom" : "iphone",
60 | "subtype" : "736h",
61 | "filename" : "Default-736h@3x.png",
62 | "minimum-system-version" : "8.0",
63 | "orientation" : "portrait",
64 | "scale" : "3x"
65 | },
66 | {
67 | "extent" : "full-screen",
68 | "idiom" : "iphone",
69 | "subtype" : "736h",
70 | "filename" : "Default-Landscape@3x.png",
71 | "minimum-system-version" : "8.0",
72 | "orientation" : "landscape",
73 | "scale" : "3x"
74 | },
75 | {
76 | "extent" : "full-screen",
77 | "idiom" : "iphone",
78 | "subtype" : "667h",
79 | "filename" : "Default-667h@2x.png",
80 | "minimum-system-version" : "8.0",
81 | "orientation" : "portrait",
82 | "scale" : "2x"
83 | },
84 | {
85 | "orientation" : "portrait",
86 | "idiom" : "iphone",
87 | "filename" : "Default@2x.png",
88 | "extent" : "full-screen",
89 | "minimum-system-version" : "7.0",
90 | "scale" : "2x"
91 | },
92 | {
93 | "extent" : "full-screen",
94 | "idiom" : "iphone",
95 | "subtype" : "retina4",
96 | "filename" : "Default-568h@2x.png",
97 | "minimum-system-version" : "7.0",
98 | "orientation" : "portrait",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "filename" : "Default-Portrait.png",
105 | "extent" : "full-screen",
106 | "minimum-system-version" : "7.0",
107 | "scale" : "1x"
108 | },
109 | {
110 | "orientation" : "landscape",
111 | "idiom" : "ipad",
112 | "filename" : "Default-Landscape.png",
113 | "extent" : "full-screen",
114 | "minimum-system-version" : "7.0",
115 | "scale" : "1x"
116 | },
117 | {
118 | "orientation" : "portrait",
119 | "idiom" : "ipad",
120 | "filename" : "Default-Portrait@2x.png",
121 | "extent" : "full-screen",
122 | "minimum-system-version" : "7.0",
123 | "scale" : "2x"
124 | },
125 | {
126 | "orientation" : "landscape",
127 | "idiom" : "ipad",
128 | "filename" : "Default-Landscape@2x.png",
129 | "extent" : "full-screen",
130 | "minimum-system-version" : "7.0",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "iphone",
136 | "filename" : "Default.png",
137 | "extent" : "full-screen",
138 | "scale" : "1x"
139 | },
140 | {
141 | "orientation" : "portrait",
142 | "idiom" : "iphone",
143 | "filename" : "Default@2x.png",
144 | "extent" : "full-screen",
145 | "scale" : "2x"
146 | },
147 | {
148 | "orientation" : "portrait",
149 | "idiom" : "iphone",
150 | "filename" : "Default-568h@2x.png",
151 | "extent" : "full-screen",
152 | "subtype" : "retina4",
153 | "scale" : "2x"
154 | },
155 | {
156 | "orientation" : "portrait",
157 | "idiom" : "ipad",
158 | "extent" : "to-status-bar",
159 | "scale" : "1x"
160 | },
161 | {
162 | "orientation" : "portrait",
163 | "idiom" : "ipad",
164 | "filename" : "Default-Portrait.png",
165 | "extent" : "full-screen",
166 | "scale" : "1x"
167 | },
168 | {
169 | "orientation" : "landscape",
170 | "idiom" : "ipad",
171 | "extent" : "to-status-bar",
172 | "scale" : "1x"
173 | },
174 | {
175 | "orientation" : "landscape",
176 | "idiom" : "ipad",
177 | "filename" : "Default-Landscape.png",
178 | "extent" : "full-screen",
179 | "scale" : "1x"
180 | },
181 | {
182 | "orientation" : "portrait",
183 | "idiom" : "ipad",
184 | "extent" : "to-status-bar",
185 | "scale" : "2x"
186 | },
187 | {
188 | "orientation" : "portrait",
189 | "idiom" : "ipad",
190 | "filename" : "Default-Portrait@2x.png",
191 | "extent" : "full-screen",
192 | "scale" : "2x"
193 | },
194 | {
195 | "orientation" : "landscape",
196 | "idiom" : "ipad",
197 | "extent" : "to-status-bar",
198 | "scale" : "2x"
199 | },
200 | {
201 | "orientation" : "landscape",
202 | "idiom" : "ipad",
203 | "filename" : "Default-Landscape@2x.png",
204 | "extent" : "full-screen",
205 | "scale" : "2x"
206 | }
207 | ],
208 | "info" : {
209 | "version" : 1,
210 | "author" : "xcode"
211 | }
212 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-AspectFill@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchScreen-Center@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/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/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/demo/app/app-root.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo/app/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.css file is where you place CSS rules that
3 | you would like to apply to your entire application. Check out
4 | http://docs.nativescript.org/ui/styling for a full list of the CSS
5 | selectors and properties you can use to style UI components.
6 |
7 | /*
8 | In many cases you may want to use the NativeScript core theme instead
9 | of writing your own CSS rules. For a full list of class names in the theme
10 | refer to http://docs.nativescript.org/ui/theme.
11 | The imported CSS rules must precede all other types of rules.
12 | */
13 | @import '~nativescript-theme-core/css/core.light.css';
14 |
15 | .copyright {
16 | background-color:blue;
17 | color: white;
18 | font-size: 12pt;
19 | }
20 |
21 |
22 | .landscape button {
23 | background-color: red;
24 | }
--------------------------------------------------------------------------------
/demo/app/app.js:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.js file is the entry point to your application.
3 | You can use this file to perform app-level initialization, but the primary
4 | purpose of the file is to pass control to the app’s first module.
5 | */
6 |
7 | const application = require("tns-core-modules/application");
8 | require('nativescript-orientation');
9 |
10 | application.run({ moduleName: "app-root" });
11 |
12 | /*
13 | Do not place any code after the application has been started as it will not
14 | be executed on iOS.
15 | */
16 |
--------------------------------------------------------------------------------
/demo/app/main-page.js:
--------------------------------------------------------------------------------
1 | var orientation = require('nativescript-orientation');
2 |
3 |
4 | var page, lockElem;
5 | exports.pageLoaded = function(args) {
6 | page = args.object;
7 | lockElem = page.getViewById('lock');
8 | };
9 |
10 | exports.portrait = function() {
11 | orientation.setOrientation("portrait");
12 | lock = true;
13 | lockElem.text = "Unlock";
14 | };
15 |
16 | exports.landscape = function() {
17 | orientation.setOrientation("landscape");
18 | lock = true;
19 | lockElem.text = "Unlock";
20 |
21 | };
22 |
23 |
24 | var lock = false;
25 | exports.lock = function() {
26 | lock = !lock;
27 | if (lock) {
28 | orientation.disableRotation();
29 | lockElem.text = "Unlock";
30 | } else {
31 | orientation.enableRotation();
32 | lockElem.text = "Lock";
33 | }
34 | };
35 |
36 | exports.openMT = function() {
37 | const utils = require('tns-core-modules/utils/utils');
38 | utils.openUrl("https://master.technology");
39 | };
40 |
41 |
42 | exports.orientation = function(args) {
43 | console.log("Orientation was changed, is Landscape?", args.landscape);
44 | };
45 |
46 | exports.nav = function() {
47 | var frame = require('tns-core-modules/ui/frame');
48 | frame.topmost().navigate({ moduleName: "main-page2", clearHistory: true });
49 | };
--------------------------------------------------------------------------------
/demo/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
15 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/app/main-page2.js:
--------------------------------------------------------------------------------
1 | var orientation = require('nativescript-orientation');
2 |
3 |
4 | var page, lockElem;
5 | exports.pageLoaded = function(args) {
6 | page = args.object;
7 | lockElem = page.getViewById('lock');
8 | };
9 |
10 | exports.portrait = function() {
11 | orientation.setOrientation("portrait");
12 | lock = true;
13 | lockElem.text = "Unlock";
14 | };
15 |
16 | exports.landscape = function() {
17 | orientation.setOrientation("landscape");
18 | lock = true;
19 | lockElem.text = "Unlock";
20 |
21 | };
22 |
23 |
24 | var lock = false;
25 | exports.lock = function() {
26 | lock = !lock;
27 | if (lock) {
28 | orientation.disableRotation();
29 | lockElem.text = "Unlock";
30 | } else {
31 | orientation.enableRotation();
32 | lockElem.text = "Lock";
33 | }
34 | };
35 |
36 |
37 |
38 | exports.orientation = function(args) {
39 | console.log("Orientation was changed, is Landscape?", args.landscape);
40 | };
41 |
42 | exports.nav = function() {
43 | var frame = require('tns-core-modules/ui/frame');
44 | frame.topmost().navigate({ moduleName: "main-page", clearHistory: true });
45 | };
--------------------------------------------------------------------------------
/demo/app/main-page2.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
15 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "app.js",
3 | "android": {
4 | "v8Flags": "--expose_gc"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/app/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Enable smart suggestions and completions in Visual Studio Code JavaScript projects.
2 |
--------------------------------------------------------------------------------
/demo/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "paths": {
5 | "*": ["./node_modules/tns-core-modules/*", "./node_modules/*"],
6 | "~/*": ["app/*"]
7 | }
8 | },
9 | "include": ["app/**/*"]
10 | }
11 |
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "nativescript": {
3 | "id": "org.nativescript.demo",
4 | "tns-android": {
5 | "version": "6.0.0"
6 | },
7 | "tns-ios": {
8 | "version": "6.0.1"
9 | }
10 | },
11 | "description": "NativeScript Application",
12 | "license": "SEE LICENSE IN ",
13 | "repository": "",
14 | "dependencies": {
15 | "nativescript-dom": "^2.0.2",
16 | "nativescript-globalevents": "^1.2.2",
17 | "nativescript-orientation": "file:../src",
18 | "nativescript-theme-core": "~1.0.4",
19 | "tns-core-modules": "6.0.1"
20 | },
21 | "devDependencies": {
22 | "nativescript-dev-webpack": "1.0.1"
23 | },
24 | "gitHead": "803cec054c44c99eaa59cdc267993e6346f6cb3a",
25 | "readme": "NativeScript Application"
26 | }
27 |
--------------------------------------------------------------------------------
/demo/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { join, relative, resolve, sep } = require("path");
2 |
3 | const webpack = require("webpack");
4 | const nsWebpack = require("nativescript-dev-webpack");
5 | const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
6 | const CleanWebpackPlugin = require("clean-webpack-plugin");
7 | const CopyWebpackPlugin = require("copy-webpack-plugin");
8 | const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
9 | const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
10 | const TerserPlugin = require("terser-webpack-plugin");
11 | const hashSalt = Date.now().toString();
12 |
13 | module.exports = env => {
14 | // Add your custom Activities, Services and other android app components here.
15 | const appComponents = [
16 | "tns-core-modules/ui/frame",
17 | "tns-core-modules/ui/frame/activity",
18 | ];
19 |
20 | const platform = env && (env.android && "android" || env.ios && "ios");
21 | if (!platform) {
22 | throw new Error("You need to provide a target platform!");
23 | }
24 |
25 | const platforms = ["ios", "android"];
26 | const projectRoot = __dirname;
27 |
28 | // Default destination inside platforms//...
29 | const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
30 |
31 | const {
32 | // The 'appPath' and 'appResourcesPath' values are fetched from
33 | // the nsconfig.json configuration file
34 | // when bundling with `tns run android|ios --bundle`.
35 | appPath = "app",
36 | appResourcesPath = "app/App_Resources",
37 |
38 | // You can provide the following flags when running 'tns run android|ios'
39 | snapshot, // --env.snapshot
40 | production, // --env.production
41 | uglify, // --env.uglify
42 | report, // --env.report
43 | sourceMap, // --env.sourceMap
44 | hiddenSourceMap, // --env.hiddenSourceMap
45 | hmr, // --env.hmr,
46 | unitTesting, // --env.unitTesting,
47 | verbose, // --env.verbose
48 | } = env;
49 |
50 | const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
51 | const externals = nsWebpack.getConvertedExternals(env.externals);
52 | const appFullPath = resolve(projectRoot, appPath);
53 | const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
54 |
55 | const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
56 | const entryPath = `.${sep}${entryModule}.js`;
57 | const entries = { bundle: entryPath };
58 | const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1);
59 | if (platform === "ios" && !areCoreModulesExternal) {
60 | entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules";
61 | };
62 |
63 | let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
64 |
65 | const itemsToClean = [`${dist}/**/*`];
66 | if (platform === "android") {
67 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "src", "main", "assets", "snapshots")}`);
68 | itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
69 | }
70 |
71 |
72 | nsWebpack.processAppComponents(appComponents, platform);
73 | const config = {
74 | mode: production ? "production" : "development",
75 | context: appFullPath,
76 | externals,
77 | watchOptions: {
78 | ignored: [
79 | appResourcesFullPath,
80 | // Don't watch hidden files
81 | "**/.*",
82 | ]
83 | },
84 | target: nativescriptTarget,
85 | entry: entries,
86 | output: {
87 | pathinfo: false,
88 | path: dist,
89 | sourceMapFilename,
90 | libraryTarget: "commonjs2",
91 | filename: "[name].js",
92 | globalObject: "global",
93 | hashSalt
94 | },
95 | resolve: {
96 | extensions: [".js", ".scss", ".css"],
97 | // Resolve {N} system modules from tns-core-modules
98 | modules: [
99 | resolve(__dirname, "node_modules/tns-core-modules"),
100 | resolve(__dirname, "node_modules"),
101 | "node_modules/tns-core-modules",
102 | "node_modules",
103 | ],
104 | alias: {
105 | '~': appFullPath
106 | },
107 | // resolve symlinks to symlinked modules
108 | symlinks: true
109 | },
110 | resolveLoader: {
111 | // don't resolve symlinks to symlinked loaders
112 | symlinks: false
113 | },
114 | node: {
115 | // Disable node shims that conflict with NativeScript
116 | "http": false,
117 | "timers": false,
118 | "setImmediate": false,
119 | "fs": "empty",
120 | "__dirname": false,
121 | },
122 | devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
123 | optimization: {
124 | runtimeChunk: "single",
125 | splitChunks: {
126 | cacheGroups: {
127 | vendor: {
128 | name: "vendor",
129 | chunks: "all",
130 | test: (module, chunks) => {
131 | const moduleName = module.nameForCondition ? module.nameForCondition() : '';
132 | return /[\\/]node_modules[\\/]/.test(moduleName) ||
133 | appComponents.some(comp => comp === moduleName);
134 |
135 | },
136 | enforce: true,
137 | },
138 | }
139 | },
140 | minimize: !!uglify,
141 | minimizer: [
142 | new TerserPlugin({
143 | parallel: true,
144 | cache: true,
145 | sourceMap: isAnySourceMapEnabled,
146 | terserOptions: {
147 | output: {
148 | comments: false,
149 | semicolons: !isAnySourceMapEnabled
150 | },
151 | compress: {
152 | // The Android SBG has problems parsing the output
153 | // when these options are enabled
154 | 'collapse_vars': platform !== "android",
155 | sequences: platform !== "android",
156 | }
157 | }
158 | })
159 | ],
160 | },
161 | module: {
162 | rules: [
163 | {
164 | test: nsWebpack.getEntryPathRegExp(appFullPath, entryPath),
165 | use: [
166 | // Require all Android app components
167 | platform === "android" && {
168 | loader: "nativescript-dev-webpack/android-app-components-loader",
169 | options: { modules: appComponents }
170 | },
171 |
172 | {
173 | loader: "nativescript-dev-webpack/bundle-config-loader",
174 | options: {
175 | loadCss: !snapshot, // load the application css if in debug mode
176 | unitTesting,
177 | appFullPath,
178 | projectRoot,
179 | ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
180 | }
181 | },
182 | ].filter(loader => !!loader)
183 | },
184 |
185 | {
186 | test: /\.(js|css|scss|html|xml)$/,
187 | use: "nativescript-dev-webpack/hmr/hot-loader"
188 | },
189 |
190 | { test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
191 |
192 | {
193 | test: /\.css$/,
194 | use: { loader: "css-loader", options: { url: false } }
195 | },
196 |
197 | {
198 | test: /\.scss$/,
199 | use: [
200 | { loader: "css-loader", options: { url: false } },
201 | "sass-loader"
202 | ]
203 | },
204 | ]
205 | },
206 | plugins: [
207 | // Define useful constants like TNS_WEBPACK
208 | new webpack.DefinePlugin({
209 | "global.TNS_WEBPACK": "true",
210 | "process": "global.process",
211 | }),
212 | // Remove all files from the out dir.
213 | new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),
214 | // Copy assets to out dir. Add your own globs as needed.
215 | new CopyWebpackPlugin([
216 | { from: { glob: "fonts/**" } },
217 | { from: { glob: "**/*.jpg" } },
218 | { from: { glob: "**/*.png" } },
219 | ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
220 | new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
221 |
222 | // For instructions on how to set up workers with webpack
223 | // check out https://github.com/nativescript/worker-loader
224 | new NativeScriptWorkerPlugin(),
225 | new nsWebpack.PlatformFSPlugin({
226 | platform,
227 | platforms,
228 | }),
229 | // Does IPC communication with the {N} CLI to notify events when running in watch mode.
230 | new nsWebpack.WatchStateLoggerPlugin()
231 | ],
232 | };
233 |
234 | if (report) {
235 | // Generate report files for bundles content
236 | config.plugins.push(new BundleAnalyzerPlugin({
237 | analyzerMode: "static",
238 | openAnalyzer: false,
239 | generateStatsFile: true,
240 | reportFilename: resolve(projectRoot, "report", `report.html`),
241 | statsFilename: resolve(projectRoot, "report", `stats.json`),
242 | }));
243 | }
244 |
245 | if (snapshot) {
246 | config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
247 | chunk: "vendor",
248 | requireModules: [
249 | "tns-core-modules/bundle-entry-points",
250 | ],
251 | projectRoot,
252 | webpackConfig: config,
253 | }));
254 | }
255 |
256 | if (hmr) {
257 | config.plugins.push(new webpack.HotModuleReplacementPlugin());
258 | }
259 |
260 |
261 | return config;
262 | };
263 |
--------------------------------------------------------------------------------
/docs/orientation1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NathanaelA/nativescript-orientation/fbbfc6d84d2d38c831014b93635a2bea7ec57752/docs/orientation1.gif
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | demo/
2 | .git/
3 | .gitignore
4 | .idea/
5 | docs/
6 | *.tar
7 | *.tgz
8 | .npmignore
9 | node_modules/
10 |
--------------------------------------------------------------------------------
/src/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015-2019, Nathanael Anderson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/src/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.npmjs.com/package/nativescript-orientation)
2 | [](https://www.npmjs.com/package/nativescript-orientation)
3 | [](https://www.npmjs.com/package/nativescript-orientation)
4 | [](https://twitter.com/congocart)
5 |
6 | # nativescript-orientation
7 | A NativeScript plugin to deal with Declarative UI and Screen Orientation
8 | This handles both sides of the orientation issues; both the events on when the orientation changes; and the ability to change the orientation manually.
9 |
10 | ## ProPlugins
11 | We have an awesome, new service in town! This service provides tested new and upgraded plugins. All ProPlugins are already known to work with NativeScript 6.x.
12 | If you are interested in getting the latest, known working, and enhanced plugins; check out https://ProPlugins.org -- because I strongly believe in what ProPlugins offers the community all of my development work is being done on the ProPlugins version.
13 |
14 |
15 |
16 | ## Community
17 | Please feel free to continue to use this version of the plugin, it is now 100% being maintained by **YOU** the community, and as such
18 | I will gladly continue to support the community version by accepting any/all PR's for this plugin and publish it. I will attempt to verify the PR doesn't have any backdoors; but I won't be doing any testing, so if it is broken it is up to you to send a PR!
19 |
20 |
21 | ## Developed by
22 | [](https://plugins.nativescript.rocks/mastertech-nstudio)
23 |
24 | ## License
25 |
26 | This is released under the MIT License, meaning you are free to include this in any type of program -- However for entities that need a support contract, changes, enhancements and/or a commercial license please contact me at [http://nativescript.tools](http://nativescript.tools).
27 |
28 | I also do contract work; so if you have a module you want built for NativeScript (or any other software projects) feel free to contact me [nathan@master-technology.com](mailto://nathan@master-technology.com).
29 |
30 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HN8DDMWVGBNQL&lc=US&item_name=Nathanael%20Anderson&item_number=nativescript%2dorientation&no_note=1&no_shipping=1¤cy_code=USD&bn=PP%2dDonationsBF%3ax%3aNonHosted)
31 | [](https://www.patreon.com/NathanaelA)
32 |
33 | ## Sample Snapshot
34 | 
35 | Thanks to TJ VanToll for the awesome animated gif.
36 |
37 |
38 | ## Installation
39 | tns plugin add nativescript-orientation
40 |
41 | #### NativeScript 2.x.x
42 | tns plugin add nativescript-orientation@1.6.1
43 |
44 | ## Usage
45 |
46 | To use the module you just `require()` it:
47 |
48 |
49 | ```js
50 | require( "nativescript-orientation" );
51 | ```
52 |
53 | This plugin has two separate abilities; the first ability is to setup the cool ability to run a function and setup the css when the screen is rotated.
54 | For this ability, you do NOT need to keep a reference to it for the orientation event handling and css. You only need to load it once. I recommend you add it to your app.js file and forget about it.
55 | It will automatically attach its methods to all the proper classes in the NativeScript library making it act as if they are built in.
56 | What this does is automatically add and remove the "landscape" to the current **Page**'s cssClass variable (and does other magic behind the scenes allowing it to actually work).
57 |
58 | If you want to manually control the orientation, then you will need to require it and use the functions you need.
59 |
60 |
61 | ## You ask, how exactly does this help?
62 | Well, guess what Cascading means in CSS?
63 | Yes, this means this works now:
64 |
65 | #### Plain Awesome NativeScript (PAN)
66 | ```css
67 | StackLayout {
68 | background-color: red;
69 | }
70 |
71 | .landscape StackLayout {
72 | background-color: green;
73 | }
74 | ```
75 |
76 | #### NativeScript Angular (NAN)
77 | ```css
78 |
79 | /deep/ .landscape StackLayout {
80 | background-color: green;
81 | }
82 |
83 | ```
84 |
85 | I was recently informed the `:host` is a better options, as it causes less potential isolation side effects in Angular.
86 | ```css
87 | StackLayout {
88 | background-color : red;
89 | }
90 |
91 |
92 | .landscape :host StackLayout {
93 | background-color: green;
94 | }
95 |
96 | ```
97 |
98 | So in portrait the background would be red, in landscape the color is green.
99 | Please note in Angular, you need to prefix the `.landscape` with `/deep/` for it to work!
100 | In addition, for Angular I was recently informed that `:host` is also a valid option, I have not tested this; but I wanted to get it documented.
101 |
102 |
103 | ## Why use this?
104 | You can set ALL the normal CSS values this way include width, height, font-size.
105 | By using the css to control any normal items and your own page's exports.orientation to control anything not controllable by css you can change the look completely between Landscape/Portrait.
106 |
107 |
108 |
109 | ### You can add to any page you need it the following Function:
110 | #### exports.orientation(args)
111 | ##### args.landscape = true | false
112 | ##### args.object = the current page
113 | This function (if it exists) will be ran when the page is first created so you can set any needed defaults. (This is ran at the same time as the PageNavigatingTo event)
114 | This function (if it exists) will be ran each time the orientation changes.
115 | Since at this moment some items can't be controlled by CSS like orientation on ScrollView, this event allows you to control change those things when the orientation changes via your code.
116 |
117 | Please note, there is also a built in event in NativeScript called `orientationChanged` event. The differences between these is that the built in event only gets called when the orientation changes;
118 | This event is called on every screen navigation and any time the device rotates; allowing you to setup any rotation stuff during the creation of the screen.
119 | **ANGULAR NOTE:** The `exports.orientation` function event does NOT work in Angular since Angular does not have the same concept. You can use the `orientation.addOrientationApplier` instead.
120 |
121 |
122 |
123 | ### Additional Helper Method
124 |
125 | ```js
126 | var orientation = require('nativescript-orientation');
127 | ```
128 |
129 | #### orientation.getOrientation(sensors?)
130 | ##### optional sensor === true, will return you sensor values on android verses screen size calculation
131 | ##### Some android tablets lie about port vs landscape; so we determine the orientation based on the current screen sizes
132 | ```js
133 | var orientation = require('nativescript-orientation');
134 | console.log(orientation.getOrientation()); // Returns the enum DeviceOrientation value
135 | ```
136 |
137 | #### orientation.setOrientation(direction, animation)
138 | ##### Direction - "portrait" | "landscape" | "landscapeleft" | "landscaperight" | enum DeviceOrientation
139 | ##### Animation === false, disabled animation on iOS. (iOS ONLY currently)
140 | This will automatically disable rotation support after it changes the orientation.
141 | ```js
142 | var orientation = require('nativescript-orientation');
143 | orientation.setOrientation("landscape");
144 | ```
145 |
146 |
147 | #### orientation.enableRotation() - enable orientation
148 | This will enable automatic orientation support
149 | ```js
150 | var orientation = require('nativescript-orientation');
151 | orientation.enableRotation(); // The screen will rotate to whatever the current settings are...
152 | ```
153 |
154 |
155 | #### orientation.disableRotation() - disables orientation
156 | This will disable automatic orientation support and lock it to the current orientation
157 | ```js
158 | var orientation = require('nativescript-orientation');
159 | orientation.disableRotation(); // The screen will no longer rotate
160 | ```
161 |
162 |
163 | #### orientation.setFullScreen(value) - true/false
164 |
165 |
166 | ### Orientation Appliers
167 |
168 | Orientation Appliers serve as hooks into the orientation application logic for *nativescript-orientation*. Whenever *nativescript-orientation* applies its orientation logic it also calls any Orientation Appliers that you've added. This allows you to easily execute your own logic when orientation needs to be considered/applied. Orientation Appliers are simple functions that receive 1 parameter: the current orientation in string form (the same as is returned from the **orientation.getOrientation()** method). Methods to add and remove Orientation Appliers, as well as examples, are supplied below.
169 |
170 | #### oprientationApplierCallback
171 | ##### args.landscape = true | false
172 | ##### args.object = the current page
173 | The callback receives the same arguments as the exports.orientation event in normal NativeScript.
174 |
175 |
176 | #### orientation.addOrientationApplier(orientationApplierCallback)
177 | This adds an Orientation Applier
178 | ```js
179 | var MyModule = (function() {
180 | var orientation = require('nativescript-orientation');
181 |
182 | this.boundProperty = "some value";
183 |
184 |
185 | function myCallback(args) {
186 | if (args.landscape) {
187 | // Do something landscap-y
188 | return;
189 | }
190 |
191 | // Do something portrait-y
192 | // Assume this includes updating boundProperty on this module's scope.
193 | this.boundProperty = "a different value";
194 | }
195 |
196 | orientation.addOrientationApplier(myCallback.bind(this));
197 |
198 | return {
199 | boundProperty: this.boundProperty
200 | };
201 | })();
202 |
203 | exports.MyModule = MyModule;
204 | ```
205 |
206 | #### orientation.removeOrientationApplier(orientationApplierCallback)
207 | This removes an Orientation Applier from the set of Orientation Appliers that will be executed.
208 | ```js
209 | var MyModule = (function() {
210 | var orientation = require('nativescript-orientation');
211 |
212 | function myCallback(args) {
213 | if (args.landscape) {
214 | // Do something landscap-y
215 | return;
216 | }
217 |
218 | // Do something portrait-y
219 | // Assume this includes updating boundProperty on this module's scope.
220 | this.boundProperty = "a different value";
221 | }
222 |
223 | var myOrientationApplier = myCallback.bind(this);
224 | orientation.addOrientationApplier(myOrientationApplier);
225 |
226 | // Somewhere later in your code...
227 | orientation.removeOrientationApplier(myOrientationApplier);
228 |
229 | return {
230 | boundProperty: this.boundProperty
231 | };
232 | })();
233 |
234 | exports.MyModule = MyModule;
235 | ```
236 |
237 |
238 | Two key things to remember when using this functionality:
239 | 1. Use ```myCallback.bind(this)``` when adding your Orientation Applier (this preserves the correct 'this' scope for your callback method).
240 | 2. In Nativescript Angular, the orientation change event does not trigger an Angular Change Detection cycle. Because of this you'll need to manually trigger Change Detection within your Orientation Applier by injecting **ChangeDetectorRef** from **@angular/core** into your Component and calling ```this.changeDetectorRef.detectChanges()``` from within your Orientation Applier;
241 |
242 |
243 | ### Contributors
244 | - Ashton Cummings
245 | - Dick Smith
246 | - Dimitar Tachev
247 | - Emiel Beeksma
248 | - Zsolt Racz
249 | - Brad Linard
250 |
251 |
--------------------------------------------------------------------------------
/src/index.d.ts:
--------------------------------------------------------------------------------
1 | import { Page } from "tns-core-modules/ui/page/page";
2 |
3 | export interface OrientationApplierOptions {
4 | object?: Page,
5 | landscape: boolean
6 | }
7 |
8 | /** args is a object {object: (current page), landscape: boolean} value **/
9 | export type OrientationApplierCallback = (args: OrientationApplierOptions) => void;
10 |
11 | /**
12 | * Adds a new OrientationApplier to be called whenever orientation needs to be applied.
13 | * @param newOrientationApplier [OrientationApplierCallback] - The OrientationApplier that you would like to add.
14 | */
15 | export function addOrientationApplier(newOrientationApplier: OrientationApplierCallback): void;
16 |
17 | /**
18 | * Removes an OrientationApplier from the list of OrientationAppliers to be called whenever orientation needs to be applied.
19 | * @param orientationApplier [OrientationApplierCallback] - The OrientationApplier that you would like to remove.
20 | */
21 | export function removeOrientationApplier(orientationApplier: OrientationApplierCallback): void
22 |
23 | /**
24 | * Get the current orientation of the device.
25 | * @param sensors [boolean] - If true, will return you sensor values on android verses screen size calculation.
26 | * @returns [string] - a value from tns_core_modules/ui/enums/DeviceOrientation
27 | */
28 | export function getOrientation(sensors?: boolean): string;
29 |
30 | /**
31 | * Sets app window to (or from) full screen mode.
32 | * @param shouldBeFullScreen [boolean] - If true, will make app full screen. If false, will make app not full screen.
33 | */
34 | export function setFullScreen(shouldBeFullScreen: boolean): void;
35 |
36 | /**
37 | * Set the orientation of the device.
38 | * @param direction ["portrait" | "landscape" | "landscapeleft" | "landscaperight"] - The orientation/direction to set the device.
39 | * @param animation [boolean] - *** iOS Only *** - this will disable the orientation change animation.
40 | */
41 | export function setOrientation(
42 | direction?:
43 | | "portrait"
44 | | "landscape"
45 | | "landscapeleft"
46 | | "landscaperight",
47 | animation?: boolean
48 | ): void;
49 |
50 | /**
51 | * This will enable automatic orientation support.
52 | */
53 | export function enableRotation(): void;
54 |
55 | /**
56 | * This will disable automatic orientation support and lock it to the current orientation.
57 | */
58 | export function disableRotation(): void;
59 |
--------------------------------------------------------------------------------
/src/orientation.js:
--------------------------------------------------------------------------------
1 | /**********************************************************************************
2 | * (c) 2016-2019, Master Technology
3 | * Licensed under the MIT license or contact me for a Support or Commercial License
4 | *
5 | * I do contract work in most languages, so let me solve your problems!
6 | *
7 | * Any questions please feel free to email me or put a issue up on the github repo
8 | * Version 2.0.1 Nathan@master-technology.com
9 | *********************************************************************************/
10 | "use strict";
11 |
12 | /* jshint camelcase: false */
13 | /* global UIDevice, UIDeviceOrientation, UIView, getElementsByTagName, android */
14 |
15 | var application = require('tns-core-modules/application');
16 | var view = require('tns-core-modules/ui/core/view');
17 | var viewBase = require('tns-core-modules/ui/core/view-base');
18 | var enums = require('tns-core-modules/ui/enums');
19 | var frame = require('tns-core-modules/ui/frame');
20 | var Page = require('tns-core-modules/ui/page').Page;
21 |
22 | // Load the helper plugins
23 | require('nativescript-globalevents');
24 | require('nativescript-dom');
25 |
26 | var allowRotation = true, forceRotation = false, fullScreen = false, abHidden=false;
27 | var orientation = { };
28 | var orientationAppliers = [];
29 |
30 | module.exports = orientation;
31 |
32 | /**
33 | * Function to add a new orientation applier callback
34 | */
35 | orientation.addOrientationApplier = function(newOrientationApplier) {
36 | if (!newOrientationApplier) return;
37 |
38 | var existingApplier = orientationAppliers.find(function(oa) { return oa === newOrientationApplier; });
39 | if (existingApplier) return;
40 |
41 | orientationAppliers.push(newOrientationApplier);
42 | };
43 |
44 | /**
45 | * Function to remove an orientation applier callback
46 | */
47 | orientation.removeOrientationApplier = function(orientationApplier) {
48 | if (!orientationApplier) return;
49 |
50 | orientationAppliers = orientationAppliers.filter(function (oa) { return oa !== orientationApplier; });
51 | };
52 |
53 | /**
54 | * Helper function hooked to the Application to get the current orientation
55 | */
56 | if (global.android) {
57 | orientation.getOrientation = function () {
58 | var context = getContext();
59 |
60 | // These both lie on Tablets, The orientation is opposite, so it is safer to use .orientation value
61 | // context.getSystemService("window").getDefaultDisplay().getOrientation();
62 | // context.getSystemService("window").getDefaultDisplay().getRotation();
63 |
64 | var currentOrientation = getContext().getResources().getConfiguration().orientation;
65 |
66 | switch (currentOrientation) {
67 | case 2: /* LANDSCAPE */
68 | return enums.DeviceOrientation.landscape;
69 | case 1: /* PORTRAIT */
70 | return enums.DeviceOrientation.portrait;
71 | default:
72 | break;
73 | }
74 |
75 |
76 | // If for some reason the orientation code above doesn't figure it out; we use sizes
77 | var metrics = new android.util.DisplayMetrics();
78 | context.getSystemService(android.content.Context.WINDOW_SERVICE).getDefaultDisplay().getRealMetrics(metrics);
79 | if (metrics.widthPixels > metrics.heightPixels) {
80 | return enums.DeviceOrientation.landscape;
81 | }
82 | return enums.DeviceOrientation.portrait;
83 |
84 | };
85 |
86 | orientation.enableRotation = function() {
87 | if (!application.android || !application.android.foregroundActivity) {
88 | setTimeout(orientation.enableRotation, 100);
89 | return;
90 | }
91 |
92 | var activity = application.android.foregroundActivity;
93 | activity.setRequestedOrientation(13); // SCREEN_ORIENTATION_FULL_USER = 13
94 | };
95 |
96 | orientation.disableRotation = function() {
97 | if (!application.android || !application.android.foregroundActivity) {
98 | setTimeout(orientation.disableRotation, 100);
99 | return;
100 | }
101 |
102 | var activity = application.android.foregroundActivity;
103 | activity.setRequestedOrientation(14); // SCREEN_ORIENTATION_LOCKED = 14
104 | };
105 |
106 | orientation.setOrientation = function(value, animation) {
107 | if (!application.android || !application.android.foregroundActivity) {
108 | setTimeout(function() { orientation.setOrientation(value, animation); }, 100);
109 | return;
110 | }
111 |
112 | var activity = application.android.foregroundActivity;
113 |
114 | var val = value.toLowerCase();
115 | var newOrientation;
116 | switch (val) {
117 | case 'landscape':
118 | newOrientation = 6; // SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6
119 | break;
120 |
121 | case 'landscaperight':
122 | newOrientation = 0; // SCREEN_ORIENTATION_LANDSCAPE = 0
123 | break;
124 |
125 | case 'landscapeleft':
126 | newOrientation = 8; // SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 9
127 | break;
128 |
129 | case 'portrait':
130 | default:
131 | newOrientation = 1; // SCREEN_ORIENTATION_PORTRAIT = 1
132 | break;
133 | }
134 | activity.setRequestedOrientation(newOrientation);
135 |
136 | // Animation: https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#ROTATION_ANIMATION_JUMPCUT
137 | // and https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#rotationAnimation
138 |
139 | };
140 |
141 | orientation.setFullScreen = function(value) {
142 |
143 | var View = android.view.View;
144 | var WindowManager = android.view.WindowManager;
145 | var window = application.android.startActivity.getWindow();
146 |
147 | fullScreen = !!value;
148 |
149 | if (fullScreen) {
150 | window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
151 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
152 | | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
153 | | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
154 | | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
155 | | View.SYSTEM_UI_FLAG_FULLSCREEN
156 | | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY );
157 | } else {
158 | window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
159 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
160 | }
161 | /*
162 | if (fullScreen) {
163 | if (!frame.topmost().currentPage.actionBarHidden && !abHidden) {
164 | abHidden = true;
165 | frame.topmost().currentPage.actionBarHidden = true;
166 | }
167 | } else if (abHidden) {
168 | abHidden = false;
169 | frame.topmost().currentPage.actionBarHidden = false;
170 | }
171 | */
172 | };
173 |
174 | } else if (global.NSObject && global.UIDevice) {
175 |
176 | setupiOSController();
177 | orientation.getOrientation = function () {
178 | var device = UIDevice.currentDevice;
179 |
180 | switch (device.orientation) {
181 | case UIDeviceOrientation.UIDeviceOrientationLandscapeRight:
182 | case UIDeviceOrientation.UIDeviceOrientationLandscapeLeft:
183 | return enums.DeviceOrientation.landscape;
184 | case UIDeviceOrientation.UIDeviceOrientationPortraitUpsideDown:
185 | case UIDeviceOrientation.UIDeviceOrientationPortrait:
186 | return enums.DeviceOrientation.portrait;
187 | default:
188 | // Since we have a up/Down orientation, we need to see what the statusbar is set to to get the actual current device orientation
189 | var appOrientation = UIApplication.sharedApplication.statusBarOrientation;
190 | if (appOrientation === 1 || appOrientation === 2) { return enums.DeviceOrientation.portrait; }
191 | else { return enums.DeviceOrientation.landscape; }
192 | }
193 | };
194 |
195 | orientation.setOrientation = function(value, animation) {
196 | var newOrientation, val = value.toLowerCase();
197 | if (val === 'landscape' || val === 'landscaperight') {
198 | newOrientation = NSNumber.numberWithInt(UIInterfaceOrientationLandscapeRight);
199 | } else if (val === 'landscapeleft') {
200 | newOrientation = NSNumber.numberWithInt(UIInterfaceOrientationLandscapeLeft);
201 | } else {
202 | newOrientation = NSNumber.numberWithInt(UIInterfaceOrientationPortrait);
203 | }
204 | var device = UIDevice.currentDevice;
205 | if (animation === false) {
206 | UIView.setAnimationsEnabled(false);
207 | }
208 | allowRotation = false; // disable rotations...
209 |
210 | forceRotation = true;
211 | var currentOrientation = device.orientation;
212 | // We have to swap to a different orientation FIRST, if the current orientation matches
213 | if (newOrientation === currentOrientation) {
214 | var tempOrientation = newOrientation-1;
215 | if (tempOrientation < 1) { tempOrientation += 2; }
216 | device.setValueForKey(tempOrientation, "orientation");
217 | }
218 | device.setValueForKey(newOrientation, "orientation");
219 | forceRotation = false;
220 |
221 | if (animation === false) {
222 | UIView.setAnimationsEnabled(true);
223 | }
224 | };
225 |
226 | orientation.enableRotation = function() { allowRotation = true; };
227 |
228 | orientation.disableRotation = function() { allowRotation = false; };
229 |
230 | orientation.setFullScreen = function(setFullScreen) {
231 | fullScreen = !!setFullScreen;
232 | var app = iosProperty(UIApplication, UIApplication.sharedApplication);
233 | app.setStatusBarHiddenWithAnimation(fullScreen, UIStatusBarAnimation.Slide);
234 | };
235 |
236 | var resetLandscapedLock = false;
237 | application.on('suspend', function() {
238 | if (allowRotation === false && orientation.getOrientation() === 'landscape') {
239 | allowRotation = true;
240 | resetLandscapedLock = true;
241 | }
242 | });
243 |
244 | application.on('resume', function() {
245 | if (resetLandscapedLock) {
246 | resetLandscapedLock = false;
247 | orientation.setOrientation('landscape',false);
248 | }
249 | });
250 |
251 |
252 | }
253 |
254 | // Depreciated; but supported for backwards compatibility
255 | application.getOrientation = orientation.getOrientation;
256 |
257 | /**
258 | * Searchs for a prototype in the prototype chain
259 | * @param source - Source element
260 | * @param name - the name of the element
261 | * @returns {*}
262 | */
263 | function findRootPrototype(source, name) {
264 | var proto = source;
265 | do {
266 | proto = Object.getPrototypeOf(proto);
267 | } while (proto !== null && !proto.hasOwnProperty(name) );
268 | return proto;
269 | }
270 |
271 | /**
272 | * Sets up the iOS Controller configuration
273 | */
274 | function setupiOSController() {
275 | var curFrame = frame.topmost();
276 | if (!curFrame) {
277 | setTimeout(setupiOSController, 100);
278 | return;
279 | }
280 |
281 | try {
282 | var app = curFrame.ios.controller;
283 | var proto = findRootPrototype(app, "shouldAutorotate");
284 | if (proto === null) {
285 | console.log("Unable to find rotations system, disabling orientation system.");
286 | return;
287 | }
288 | Object.defineProperty(proto, "shouldAutorotate", {
289 | get: function() {
290 | //console.log("Should rotate", forceRotation, allowRotation);
291 | return forceRotation || allowRotation;
292 | }, enumerable: true, configurable: true
293 | });
294 | } catch (err) {
295 | console.log("Unable to setup Rotation",err);
296 | }
297 | }
298 |
299 | /**
300 | * Helper function to look for children that have refresh (i.e. like ListView's) and call their refresh since the
301 | * CSS changes will probably impact them
302 | * @param child
303 | * @returns {boolean}
304 | */
305 | function resetChildrenRefreshes(child) {
306 | if (typeof child.refresh === 'function') {
307 | child.refresh();
308 | }
309 | return true;
310 | }
311 |
312 | /**
313 | * Function that does the majority of the work
314 | * @param page
315 | * @param args
316 | */
317 | var applyOrientationToPage = function(page, args){
318 | var currentOrientation = orientation.getOrientation();
319 |
320 | // If somehow we didn't get the orientation we don't do anything!
321 | if (!currentOrientation) return;
322 |
323 | // Check what the current rotation vs the existing page rotation is
324 | var isLandscape = currentOrientation === enums.DeviceOrientation.landscape;
325 | if (!args || !args.force) {
326 | var containsLandScape = page.classList.contains("landscape");
327 |
328 | // No need to run the swap if it already has the correct orientation
329 | if (isLandscape === containsLandScape) { return; }
330 | }
331 |
332 | // Change Orientation
333 | page.classList.toggle('landscape', isLandscape);
334 |
335 | // Unfortunately there is a bug in the NS CSS parser, so we have to work around it
336 | var i;
337 | if (page.classList.contains('android')) {
338 | for (i=0;i= 0) { continue; }
341 | page.classList.toggle(page.classList[i]+".landscape", isLandscape);
342 | }
343 | }
344 | } else if (page.classList.contains('ios')) {
345 | for (i=0;i= 0) { continue; }
348 | page.classList.toggle(page.classList[i]+".landscape", isLandscape);
349 | }
350 | }
351 | } else if (page.classList.contains('windows')) {
352 | page.classList.toggle('windows.landscape', isLandscape);
353 | }
354 | // --- End NS Bug Patch ---
355 |
356 | // _refreshCSS will verify against the Scope to make sure all the correct styles are
357 | // applied. If they are already applied, it will short circuit and not
358 | // do anything more.
359 | if (typeof page._refreshCss === 'function') {
360 | // TNS 3.2-
361 | page._refreshCss();
362 | } else {
363 | // TNS 3.3+
364 | page._onCssStateChange();
365 | }
366 |
367 | if (args != null) {
368 | if (view.eachDescendant) {
369 | view.eachDescendant(page, resetChildrenRefreshes);
370 | } else {
371 | // TNS 6.8+ rc
372 | viewBase.eachDescendant(page, resetChildrenRefreshes);
373 | }
374 | }
375 | if (page.exports && typeof page.exports.orientation === "function") {
376 | page.exports.orientation({landscape: isLandscape, object: page});
377 | }
378 |
379 | callOrientationAppliers(page, isLandscape);
380 | };
381 |
382 | /**
383 | * This handles an Orientation change event
384 | * @param args
385 | */
386 | var handleOrientationChange = function(args) {
387 | // If the topmost frame doesn't exist we can't do anything...
388 | if (!frame.topmost()) { return; }
389 | var currentPage = frame.topmost().currentPage;
390 |
391 | if (currentPage) {
392 | applyOrientationToPage(currentPage, args);
393 | }
394 | };
395 |
396 | var handleNavigatingTo = function(args){
397 | var targetPage = args.object;
398 | if (targetPage){
399 | applyOrientationToPage(targetPage, {force: true});
400 | }
401 | };
402 |
403 | function callOrientationAppliers(page, isLandscape) {
404 | if (!orientationAppliers || orientationAppliers.length <= 0) { return; }
405 |
406 | for (var i=0;i { setTimeout(resolve, 5000); } );
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/src/unmaintained.svg:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------