Compare commits

...

336 Commits

Author SHA1 Message Date
b265e45d2b 更新 'plugin.xml' 2023-05-24 19:54:59 +08:00
zher52
c3ec85e858 调整虚拟按键颜色为黑色 2020-05-07 20:28:14 +08:00
zher52
7edd841078 处理虚拟按键背景问题 2020-04-30 20:25:38 +08:00
zher52
94631e171a 修改参数名称 2020-04-02 09:52:56 +08:00
zher52
db3adec857 添加全屏参数 更新readme 2020-04-02 09:28:04 +08:00
zher52
d3ea3d1771 处理app打开时黑屏的问题 2020-04-01 16:56:56 +08:00
zher52
0ffc88915b 设置为全屏展示 2019-11-14 15:18:03 +08:00
Jan Piotrowski
be85a1b14e ci(travis): Upgrade node from 6 to 8 2019-07-02 20:59:02 +02:00
Jan Piotrowski
7936e7ea54 ci(travis): Remove Android 4.4, Add Android 9.0 2019-06-18 15:44:40 +02:00
Jan Piotrowski
0934d126d2 Travis CI: Add ADDITIONAL_TESTS_DIR=./tests/ios (#212)
* ADDITIONAL_TESTS_DIR=./tests/ios

* add actual code to run it
2019-05-11 00:33:14 +02:00
Jan Piotrowski
e44f9d1f1f Incremented plugin version. (splash20190509) 2019-05-09 22:43:34 +02:00
Jan Piotrowski
5339fcf377 Updated version and RELEASENOTES.md for release 5.0.3 (splash20190509) 2019-05-09 22:41:12 +02:00
Jan Piotrowski
49769ba2d4 Remove unsupported iOS10 Saucelabs simulator 2019-05-09 20:18:07 +02:00
Jan Piotrowski
6800de23b1 CI: Use universal paramedic travis.yml (#210) 2019-05-08 17:48:57 +02:00
エリス
76bec98b94 Revert Paramedic Dev Branch Usage (#208) 2019-05-07 16:45:26 +09:00
Jan Piotrowski
61e353f549 Improve README (#198)
* fix indentation

* add TOC

* fix more indentation and remove JIRA link

* apply changes from https://github.com/apache/cordova-plugin-splashscreen/pull/98

via @RobPosener

* add headline, resort

* remove outdated README translations

* remove outdated test README translations as well

* rework introduction

* optimize caPiTaLiZatiOn

* fix

* remove diff to native splash
2019-05-06 18:27:08 +02:00
エリス
4d8cd6f2fe Updated Travis CI Settings and Package.json (#194)
* Update NPM Package Node Requirement and Others

* Update Travis CI Config

* Stopped Local Tests from Running Sauce Tests with Wildcard Flag
2019-05-04 00:46:47 +02:00
Jan Piotrowski
8490496c0b Add or update GitHub pull request and issue template 2019-02-11 18:40:29 +01:00
Jan Piotrowski
95f91bf50c remove JIRA link 2018-10-04 01:17:00 +02:00
Jan Piotrowski
e78f1d10b1 also accept terms for android sdk android-27 2018-10-01 12:36:38 +02:00
jcesarmobile
8ba8f41637 Merge pull request #138 from adamschachne/master
Fixed docs typo
2018-07-31 00:47:48 +02:00
jcesarmobile
91a8210890 Merge pull request #149 from mmig/CB-12277
CB-12277: (android) avoid NullPointerException  when removing splash-screen
2018-07-31 00:22:48 +02:00
russa
c95a26ab34 Merge branch 'master' into CB-12277 2018-05-22 12:43:52 +02:00
Suraj Pindoria
d96c08e00b CB-13826 Incremented plugin version. 2018-01-25 11:47:20 -08:00
Suraj Pindoria
09e1f06fb0 CB-13826 Updated version and RELEASENOTES.md for release 5.0.2 2018-01-25 11:41:07 -08:00
russa
f9c88b8ab8 CB-12277: (android) avoid NullPointerException on splashImageView when removing splashscreen 2018-01-25 18:18:40 +01:00
jcesarmobile
9a6ff27008 Merge pull request #147 from jcesarmobile/CB-13750
CB-13750: Add build-tools-26.0.2 to travis
2018-01-09 23:33:21 +01:00
Julio César
cadc68f75b CB-13750: Add build-tools-26.0.2 to travis 2018-01-09 20:23:26 +01:00
jcesarmobile
be8be330ac Merge pull request #146 from jcesarmobile/CB-13737
CB-13737 (iOS): fix Splash screen images for iPhone X
2018-01-09 20:00:00 +01:00
Julio César
4ffaaa2952 CB-13737 (iOS): fix Splash screen images for iPhone X 2018-01-07 17:30:23 +01:00
jcesarmobile
b5e0c786c5 Fix release notes (#145) 2017-12-30 00:54:06 -05:00
Simon MacDonald
5197c664c3 Set VERSION to 5.0.2-dev (via coho) 2017-12-27 19:13:50 -05:00
Simon MacDonald
fb606fec6a CB-13714 Updated version and RELEASENOTES.md for release 5.0.1 (via coho) 2017-12-27 19:13:36 -05:00
jcesarmobile
57b553a68e CB-13709: Fix to allow 5.0.0 version install (#144) 2017-12-27 10:50:30 -05:00
Steve Gill
031afc5056 Set VERSION to 5.0.1-dev (via coho) 2017-12-15 17:26:45 -08:00
Steve Gill
36bf91c9e8 CB-13681 Updated version and RELEASENOTES.md for release 5.0.0 (via coho) 2017-12-15 17:25:13 -08:00
Vishal Mishra
a606af98ca Merge pull request #143 from maverickmishra/master
CB-13677: Remove deprecated platforms
2017-12-13 23:20:58 -08:00
maverickmishra
2ae821c4a8 CB-13677: Remove deprecated platforms 2017-12-13 11:39:44 -08:00
Steve Gill
36c43827bb Set VERSION to 4.1.1-dev (via coho) 2017-11-06 14:38:40 -08:00
Steve Gill
326f13220e CB-13542 Updated version and RELEASENOTES.md for release 4.1.0 (via coho) 2017-11-06 14:37:46 -08:00
Adam Schachne
5f41762722 Fixed docs typo 2017-10-22 15:57:59 -07:00
Alexander Sorokin
5ca43e8c5d CB-13473: (CI) Removed browser builds from AppVeyor 2017-10-20 10:23:27 +03:00
Alexander Sorokin
278c5d8168 CB-13472: (CI) Fixed Travis Android builds again 2017-10-20 08:59:26 +03:00
MartijnW49
7cb318727b Update readme
This closes #116
2017-10-18 14:21:52 -07:00
MartijnW49
c2c3a980e1 Tabs to spaces 2017-10-18 14:21:51 -07:00
MartijnW49
1a4b51fbc8 CB-12011: (android) added the possibility to change the spinner color on Android 5.0+ apps 2017-10-18 14:21:51 -07:00
Joe Bowser
0b75c1faa0 This closes #85 2017-10-10 14:15:58 -07:00
Joe Bowser
09e95a2628 This closes #81 2017-10-10 14:14:13 -07:00
Joe Bowser
3180758a4e This closes #132 2017-10-10 14:08:31 -07:00
Andrea Lazzarotto
50a55883d3 CB-12626: Updated Android plugin
This closes #125

Prefer a slightly slower, but bulletproof, way to check for the splashscreen instead of relying on the Cordova preferences. This fixes the splash screen on several phones.
2017-10-05 14:05:50 -07:00
Andrea Lazzarotto
833dc7f783 Samsung crash quick-n-dirty fix 2017-10-05 13:57:45 -07:00
Alexander Sorokin
e443871785 CB-13299 (CI) Fix Android builds 2017-09-19 09:07:06 +03:00
Alexander Sorokin
fcef678a7f CB-13028 (CI) Browser builds on Travis and AppVeyor 2017-07-28 14:22:12 +03:00
Andrey Sharapov
e5c6772f17 CB-13094: (android) Don't show splash when activity being finished 2017-07-24 16:36:34 +04:00
filmaj
7c0ab0fa51 Closes #109 2017-07-18 21:26:05 -07:00
Alexander Sorokin
7735ae0598 CB-11487 (browser) Documented AutoHideSplashScreen for browser
this closes #107
2017-07-11 11:56:02 +03:00
Peter (Somogyvari) Metz
b0e1157c8a CB-11488 (browser) Guarding code against the case when deviceready fires earlier than the plugin init on cold-start 2017-07-11 10:55:19 +03:00
Peter (Somogyvari) Metz
a18cc8241a CB-11488 (browser) The hide() call became non re-entrant after the addition of fade out. This fixes the issue. 2017-07-11 10:55:18 +03:00
Peter (Somogyvari) Metz
bf9607e27f CB-11488 (browser) Added a 1 second long fade out to the splash screen instead of the hard remove from the DOM whenever hide() is called.
Also made a high z-index the default. This could be added from the user's stylesheets but if that only
gets parsed later, there may be flickering between the application UI and the splash screen itself.
2017-07-11 10:55:18 +03:00
Peter (Somogyvari) Metz
87d29ad6d3 CB-11487 (browser) The "standard" AutoHideSplashScreen config.xml property is now supported by the browser platform. 2017-07-11 10:55:18 +03:00
Peter (Somogyvari) Metz
2db7bac571 CB-11486 (browser) splashScreenDelay now feed through parseInt to ensure it's an integer by the time it's value is passed in to setTimeout() in hide(). 2017-07-11 10:55:17 +03:00
Alexander Sorokin
d6db9f3459 CB-13000: (CI) Speed up android builds 2017-07-10 10:34:56 +03:00
Alexander Sorokin
be635a36c1 CB-12991: (CI) Updated CI badges 2017-07-07 11:36:52 +03:00
Alexander Sorokin
d63786d33b CB-12935: (windows) Enable paramedic builds on AppVeyor 2017-06-30 09:32:26 +03:00
Alexander Sorokin
98f83fea5a CB-12935: (ios, android) Enable paramedic builds on Travis CI 2017-06-27 08:40:39 +03:00
jab
c81df6f274 CB-12947: (docs) Fix iPhone 5 and 5s resolution
(and add iPhone SE which was missing)
2017-06-23 11:39:29 -04:00
filmaj
ffda2e81b9 CB-12847: added bugs entry to package.json. 2017-05-25 19:03:13 +02:00
filmaj
e0cf396835 Close #126 2017-05-23 21:10:42 +02:00
filmaj
7f140e0176 Set VERSION to 4.0.4-dev (via coho) 2017-04-27 13:05:10 -07:00
filmaj
85aa605a12 CB-12736 Updated version and RELEASENOTES.md for release 4.0.3 (via coho) 2017-04-27 13:05:08 -07:00
Alexander Sorokin
7c687957f8 CB-12622 Added Android 6.0 build badge to README 2017-04-26 16:30:20 +03:00
Steve Gill
13849c3d20 CB-12685: added package.json to tests folder 2017-04-21 19:26:24 -07:00
Steve Gill
90ba3dfc5b Set VERSION to 4.0.3-dev (via coho) 2017-03-02 15:26:49 -08:00
Steve Gill
b1ceb532f8 CB-12519 Updated version and RELEASENOTES.md for release 4.0.2 2017-02-28 17:41:27 -08:00
daserge
1185561549 CB-12353 Corrected merges usage in plugin.xml 2017-01-20 14:57:35 +03:00
Nikita Matrosov
894d164191 CB-12369: Add plugin typings from DefinitelyTyped
This closes #123
2017-01-20 11:56:43 +03:00
Alexander Sorokin
caa5534c0d CB-12363 Added build badges for iOS 9.3 and 10.0 2017-01-18 13:38:07 +03:00
Shazron Abdullah
a922ce0453 CB-12236 - Fixed RELEASENOTES for cordova-plugin-splashscreen 2016-12-11 12:58:03 -08:00
Alexander Sorokin
6195d6741b CB-12230 Removed Windows 8.1 build badges 2016-12-09 13:58:36 +03:00
Shazron Abdullah
0f2a069588 CB-12224 Incremented plugin version. 2016-12-07 16:55:08 -08:00
Shazron Abdullah
782939f7ef CB-12224 Updated version and RELEASENOTES.md for release 4.0.1 2016-12-07 16:39:46 -08:00
daserge
04667e04c0 CB-11751 'extendedSplashScreen' is undefined
Document that splashscreen needs to be disabled on Windows in case of updating entire document body
2016-12-02 17:27:37 +03:00
daserge
de28cf89bf CB-9287 Not enough Icons and Splashscreens for Windows 8.1 and Windows Phone 8.1
Documented MRT-style configuration
2016-11-25 13:40:06 +03:00
Shazron Abdullah
770c264d2c CB-11917 - Remove pull request template checklist item: "iCLA has been submitted…"
This closes #115
2016-10-04 21:36:47 -07:00
Kerri Shotts
5a1ade6114 CB-11830 (iOS) Fix doc typos in PR#114 2016-09-29 12:06:07 -05:00
Kerri Shotts
62509f6b47 CB-11829 (iOS) Support for CB-9762; docs (CB-11830)
This closes #114
2016-09-28 11:52:02 -05:00
Steve Gill
2eb78b3724 CB-11832 Incremented plugin version. 2016-09-09 16:08:04 -07:00
Steve Gill
6e43615e25 CB-11832 Updated version and RELEASENOTES.md for release 4.0.0 2016-09-08 23:38:55 -07:00
Vladimir Kotikov
ac39b04b6f CB-11795 Add 'protective' entry to cordovaDependencies
The entry is required to protect end-users from fetching edge versions of the plugin by incompatible version of cordova. This also assumes that we will not introduce any regressions in compatibility w/ cordova in minor and patch releases. On every major release we will need to add similar entry with _next_ major version.

 This closes #113
2016-09-08 12:01:36 +03:00
Julio César
66f7ee34d1 Closing outdated pull request: close #106 2016-08-26 20:48:18 +02:00
Vladimir Kotikov
41ca5809b1 CB-11326 Prevent crash when initializing plugin after navigating to another URL 2016-07-21 23:08:02 +03:00
Franco Bugnano
0a8b5be3d1 Fix crash on iOS when reloading page from remote Safari
This closes #110
2016-07-21 21:39:41 +02:00
Vladimir Kotikov
d65c0c7cc5 Add badges for paramedic builds on Jenkins 2016-06-10 12:12:56 +03:00
Nikhil Khandelwal
4102589bd5 Add pull request template. 2016-05-23 13:54:00 -07:00
daserge
1eac08c558 CB-11179 Extend the windows-splashscreen docs
Documented a way to disable splashscreen
2016-05-12 17:57:30 +03:00
daserge
80b01049c8 CB-11159 Fix flaky splashscreen native tests
Adds a retry as a temporary measure
2016-05-12 15:00:00 +03:00
daserge
4adff6f1c9 CB-11156 Change default FadeSplashScreenDuration value 2016-05-12 15:00:00 +03:00
daserge
3d924fce1b CB-8056 Updated the dependency version, added it to the docs 2016-04-29 16:26:20 +03:00
Dmitry Blotsky
6a737203da CB-10996 Adding front matter to README.md 2016-04-22 19:35:51 -07:00
daserge
acb45f3a38 CB-8056 Implement splashscreen for Windows platform
The plugin implementation has been moved to the platform code
Documented SplashScreenBackgroundColor preference for Windows
Updated the docs
Updated plugin dependencies - cordova-windows@5 is required
Updated the plugin version to 4.0.0
2016-04-22 18:20:28 +03:00
daserge
8d66b9e353 CB-6498 Misleading documentation in Android Quirks 2016-04-19 15:03:04 +03:00
Steve Gill
edb6c3d6f8 CB-11091 Incremented plugin version. 2016-04-15 13:45:27 -07:00
Steve Gill
14061d1999 Updated version and RELEASENOTES.md for release 3.2.2 2016-04-15 13:08:27 -07:00
weexpectedTHIS
6863886d74 Fixed misspelling in the README
Github: close #88
2016-03-31 16:09:59 +03:00
daserge
9832d2e165 CB-10979 Fix splashscreen ios native tests
Added jshintignore for tests/ios
2016-03-30 10:12:25 +03:00
Jeroen Verhoest
bea0a4e408 CB-10895 Transparent Splashscreen view sometimes remains
github: close#92
2016-03-24 16:33:23 +03:00
daserge
41d9ae94ff CB-10562 hide() not working in latest splashscreen plug in 3.1.0 in iOS 2016-03-24 16:19:19 +03:00
Sarangan Rajamanickam
9ca15db91a CB-10688:Plugin Splashscreen Readme must have examples. This closes #90 2016-03-21 15:04:56 -07:00
daserge
f8311aaca8 CB-10864 Run ios native tests on Travis
Updated cordova-ios tests dependency version to latest published
2016-03-14 20:30:52 +03:00
Carlos Santana
abbb07e5ee clean up release notes 2016-03-10 13:56:59 -05:00
Carlos Santana
2012ba9ab6 CB-10820 Incremented plugin version. 2016-03-09 22:34:18 -05:00
Carlos Santana
e877722bac CB-10820 Updated version and RELEASENOTES.md for release 3.2.1 2016-03-09 22:14:25 -05:00
Dan Polivy
617ad81090 CB-10692 Don't fade when plugin is forced to close
The fading logic exposed a race condition in an edge case when the
plugin was repeatedly reinitialized, e.g. when the WebView tries to load
a new URL. To address this, we add a flag to removeSplashScreen() that
allows the fade logic to be bypassed in certain circumstances --
specifically, when hiding the splashscreen due to onPause or onDestroy
events. By hiding it immediately in this scenario, we can avoid any race
conditions due to the fade delay.

github: close #86
2016-03-09 23:13:19 +03:00
Sarangan Rajamanickam
03ea0a4e80 CB-10764: Remove emoji in cordova-plugin-splashscreen
Removing warning emoji
2016-03-02 17:36:23 -08:00
daserge
850159490c CB-10650 Non-index content.src causes Splashscreen to be not displayed on browser 2016-02-19 16:10:17 +03:00
daserge
5ea854d8c3 CB-10636 Add JSHint for plugins
Fixed autotests
2016-02-19 12:18:29 +03:00
Edna Morales
e401a4de0f CB-10606 fix deprecation warning for interfaceOrientation
This closes #82
2016-02-15 19:34:38 -05:00
t1st3
2e1ec32916 chore: edit package.json license to match SPDX id
See [NPM package.json spec for licenses](https://docs.npmjs.com/files/package.json#license) and [SPDX license IDs](https://spdx.org/licenses/)

X-ref: https://github.com/apache/cordova-plugin-device/pull/48

This closes #79
2016-02-10 13:21:19 +10:00
Vladimir Kotikov
4bc552848f CB-10557 Incremented plugin version. 2016-02-09 13:13:37 +03:00
Vladimir Kotikov
5af0016c67 CB-10557 Updated version and RELEASENOTES.md for release 3.2.0 2016-02-09 13:13:27 +03:00
daserge
617960ee3e CB-10422 Splashscreen displays black screen with no image on Android 2016-01-27 18:58:56 +03:00
daserge
109c82b29b CB-10412 AutoHideSplashScreen "false" isn't taken in account on iOS 2016-01-27 18:53:23 +03:00
daserge
799b0a1737 CB-9516 Android SplashScreen - Spinner Does Not Display
Removes spinnerStop call from onMessage("spinner", "stop") as it is called when webview is shown and we are hiding spinner manually along with the splashscreen dialog.
Changed the spinner to be noncancellable.
Changed the ProgressDialog to custom only-spinner mode (on transparent background, without title/message and dimming).
Removed unused spinnerStart action handler.
Updated the docs.
2016-01-22 14:21:34 +03:00
Dan Polivy
5b3c2c8b14 CB-9094: Smarter autohide logic on Android
When the plugin is initialized, the splash screen is shown with an
auto-hide delay. If a subsequent call to show() comes in while the
splashscreen is visible, it will still be automatically hidden, even
though the user expectation is that it wouldn't be.

This fix tracks the "hideAfterDelay" setting of the most recent call to
show() -- and when the auto hide timer goes off, if the most recent call
to show() did not set hideAfterDelay, then the splashscreen will not be
automatically hidden.

This provides a more consistent -- and expected -- behavior based on
user action.

https://issues.apache.org/jira/browse/CB-9094

Github: close #49
2016-01-22 13:22:37 +03:00
daserge
7a12204ba9 CB-8396 Add AutoHideSplashScreen logic to Android's Splashscreen
Also initializing the splashscreen image irrespective of firstShow because the splashscreen could be shown manually via navigator.splashscreen.show(); after exiting the app using BackButton or via navigator.app.exitApp();
2016-01-18 11:36:21 +03:00
daserge
eada9a6ac1 Closing stale: close #14, close #17, close #23, close #33, close #63 2016-01-18 10:37:43 +03:00
Steve Gill
12dcd57d51 CB-10368 Incremented plugin version. 2016-01-15 16:58:32 -08:00
Steve Gill
0f4a9d3f18 CB-10368 Updated version and RELEASENOTES.md for release 3.1.0 2016-01-15 16:35:06 -08:00
daserge
50318213c4 CB-9538 Implementing FadeSplashScreen feature for Android
Refactoring, adds support of seconds for fade duration for backward compatibility
Includes fade duration into overall splashscreen duration to be consistent with iOS
Updated the docs
2016-01-11 12:49:38 +03:00
Philipp Grosswiler
34bc1dbf16 CB-9538 Implementing FadeSplashScreen feature for Android 2016-01-11 12:44:12 +03:00
daserge
3b2e9e5912 CB-9240 Cordova splash screen plugin iPad landscape mode issue
Aligns shouldRotate default value with parent CDVViewController behavior
2015-12-29 22:08:02 +03:00
daserge
d7841c7ec9 CB-10263 Fix splashscreen plugin filenames for Asset Catalog
Github: close #69
2015-12-29 12:00:31 +03:00
Wilson Pinto
1e67606c60 CB-9374 Android: add SplashShowOnlyFirstTime as preference
Github: close #70
2015-12-26 23:01:15 +03:00
daserge
fa3b665223 CB-10244 Don't rotate the iPhone 6 Plus splash 2015-12-22 17:28:53 +03:00
daserge
875ccbf5bc CB-9043 Fix the ios splashscreen being deformed on orientation change 2015-12-22 17:15:59 +03:00
Thejaswi Puthraya
ccb3c2f453 CB-10079 Splashscreen plugin does not honor SplashScreenDelay on iOS
Github: close #64
2015-12-21 08:00:27 -08:00
daserge
cfc6d74506 CB-10231 Fix FadeSplashScreen to default to true on iOS 2015-12-21 16:51:19 +03:00
Steve Gill
78d8ef94eb CB-10035 Incremented plugin version. 2015-11-30 17:57:07 -08:00
Steve Gill
e2239306d6 CB-10035 linked issues in RELEASENOTES.md 2015-11-18 22:11:41 -08:00
Steve Gill
ea3f7f7b07 CB-10035 Updated version and RELEASENOTES.md for release 3.0.0 2015-11-18 19:45:06 -08:00
Steve Gill
d348168e08 removed r prefix from tags 2015-11-18 14:53:11 -08:00
Steve Gill
848bd487e0 CB-10035 Updated RELEASENOTES to be newest to oldest 2015-11-18 13:54:08 -08:00
Dmitry Blotsky
d034ceee6e Actually fixing the contribute link. 2015-10-23 12:11:50 -07:00
Dmitry Blotsky
93aaf0529e Fixing contribute link. 2015-10-23 12:03:42 -07:00
Jesse MacFadyen
60fb0621ae Merge branch 'add-jira-link' of https://github.com/revolunet/cordova-plugin-splashscreen 2015-10-05 17:50:24 -07:00
Jesse MacFadyen
7eec7c8b43 Bumped version number for API changed in CB-9750 commit 2015-10-05 17:47:40 -07:00
Jesse MacFadyen
3a79663680 CB-9750 FadeSplashDuration is now in msecs 2015-10-05 17:46:12 -07:00
Jesse MacFadyen
b83392df21 This closes #56, This closes #44 2015-10-05 17:23:59 -07:00
Jesse MacFadyen
2b5187b909 fix formatting 2015-10-05 17:20:57 -07:00
Jesse MacFadyen
fb0764c528 CB-8875 FadeSplashScreen was not fading 2015-10-05 16:34:49 -07:00
Jesse MacFadyen
9a69f12ada CB-9749 documentation is wrong - default SplashScreenDelay 2015-10-05 14:16:30 -07:00
Jesse MacFadyen
9bd0ec7091 Add line to increase readability. Close #58 2015-09-14 13:54:48 -07:00
Julien Bouquillon
f675376de1 add JIRA issue tracker link 2015-09-10 18:29:36 +02:00
daserge
9ea2d4c86f CB-9467 SplashScreen does not show any image in hosted app on Windows 10 2015-08-07 11:29:05 +03:00
Andrey Kurdyumov
5aff6590f8 CB-7282 Document AutoHideSplashScreenpreference 2015-07-25 13:52:42 +06:00
Shazron Abdullah
f4a92d21ff CB-9327 - Splashscreen not receiving CDVPageLoadNotification 2015-07-07 18:17:07 -07:00
Jesse MacFadyen
0916db61b4 remove travis-ci 2015-07-07 17:55:55 -07:00
Roel van Uden
ac23964ac6 WP8: Avoid config value of a wrong element.
If you have an element that shares the `name`, like <feature
name="SplashScreen">, then the `value` attribute was read of that
instead (since it can appear *before* the preference element). Thus, the
config of `SplashScreen` preference was not settable at all.
2015-06-22 11:50:07 +02:00
Steve Gill
57ad3602f4 CB-9192 Incremented plugin version. 2015-06-17 17:35:36 -07:00
Steve Gill
4b1df233ae CB-9202 updated repo url to github mirror in package.json 2015-06-17 14:14:41 -07:00
Steve Gill
c4ba138de5 CB-9192 Updated version and RELEASENOTES.md for release 2.1.0 2015-06-17 12:36:05 -07:00
Steve Gill
805bcf505d added missing license headers 2015-06-17 11:11:40 -07:00
Victor Sosa
fa29a85fcb CB-9128 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2015-06-12 09:42:35 -05:00
Raymond Camden
ab26925e25 fix npm md issue 2015-06-02 11:01:17 -05:00
Shazron Abdullah
ed00c63d2d Fixed iOS unit tests. 2015-05-12 00:04:24 -07:00
Dan Polivy
52c025bbef CB-3562: Disable screen rotation for iPhone when splash screen is shown. (closes #47)
This is a port of emarashliev's original fix for CB-3562, cleaned up
to avoid deprecated functions.

Merge branch 'master' of https://github.com/emarashliev/cordova-plugin-splashscreen into CB3562

Signed-off-by: Shazron Abdullah <shazron@apache.org>
2015-05-11 23:59:44 -07:00
Dan Polivy
87f3c3a3ac CB-8988: Fix rotation on iOS/iPad (closes #46)
The viewController.interfaceOrientation passed to getImageName has not
yet been updated with the new orientation, even when the frame/bounds
change event has fired. Thus, the plugin never actually loads the
correct image for the new orientation. Instead, it poorly scales the
existing image.

This fix uses the statusBarOrientation property of the UIApplication
object to detect the actual orientation, and correctly load the right
image.

Signed-off-by: Shazron Abdullah <shazron@apache.org>
2015-05-11 17:46:58 -07:00
Joe Bowser
6cc3d1f3fe CB-8904: Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable 2015-05-07 15:59:39 -07:00
sgrebnov
b7750760f4 Removed wp7 from plugin.xml and package.json 2015-04-25 14:58:11 -07:00
sgrebnov
00e8999eeb CB-8750 [wp8]: Rewrite resoultion helper 2015-04-25 14:56:39 -07:00
sgrebnov
9549ce3a9d CB-8750 [wp8]: Allow resolution-specific splashscreen images
There are two aspect ratios for Windows Phone devices: 15:9 and 16:9. At
the moment, though, there is only one splash screen by default for WP8
Cordova apps. When stretched to fit all possible resolutions, this can
sometimes look bad.

WP supports resolution-specific splashscreens, so this commit adds the
same support to the splashscreen plugin. It uses the same base name for
the splashscreen, but adds modifiers such as ".screen-<res>" based on
the device. If a screen-specific image is found, it is used. If not, we
fall back to the single default image.

Fixes https://issues.apache.org/jira/browse/CB-8750

github close #41
github close #42
2015-04-25 14:55:21 -07:00
Dan Polivy
62e92afae8 CB-8758 [wp8]: UnauthorizedAccessException on hide()
When calling hide() from JS, the attempt to access Popup could happen on
a background thread, which ends up throwing an
UnauthorizedAccessException about cross-thread access.

To address this, it's best to check the popup's state from within the UI
thread.

Fixes https://issues.apache.org/jira/browse/CB-8758
2015-04-25 14:32:17 -07:00
Steve Gill
fa60f01adc CB-8858 Incremented plugin version. 2015-04-15 16:00:22 -07:00
Steve Gill
d23ea4e011 CB-8858 Updated version in package.json for release 2.0.0 2015-04-15 15:50:47 -07:00
Steve Gill
0a46c4cbbb Revert "CB-8858 Incremented plugin version."
This reverts commit a510cd21ec.
2015-04-15 14:31:12 -07:00
Steve Gill
a510cd21ec CB-8858 Incremented plugin version. 2015-04-15 13:55:47 -07:00
Steve Gill
76bf7655a0 CB-8858 Updated version and RELEASENOTES.md for release 2.0.0 2015-04-15 11:06:38 -07:00
Jesse MacFadyen
9575c92db6 give users a way to install the bleeding edge. 2015-04-13 11:40:00 -07:00
Steve Gill
a9ac114130 CB-8746 gave plugin major version bump 2015-04-09 17:03:54 -07:00
Shazron Abdullah
48def1443a CB-8797 - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing 2015-04-09 14:19:23 -07:00
Shazron Abdullah
559b300d29 CB-8836 - Crashes after animating splashscreen 2015-04-09 14:07:18 -07:00
Andrew Grieve
35272415d3 CB-8753 android: Fix missing import in previous commit 2015-04-07 20:37:06 -04:00
Alex Talis
dd9c88204c CB-8753 android: Adds SplashMaintainAspectRatio preference (close #43) 2015-04-07 10:55:23 -04:00
Steve Gill
5dc26d7e65 CB-8683 changed plugin-id to pacakge-name 2015-04-01 16:41:33 -07:00
Steve Gill
1c41959288 CB-8653 properly updated translated docs to use new id 2015-03-31 16:06:01 -07:00
Steve Gill
43e9c75345 CB-8653 updated translated docs to use new id 2015-03-31 10:53:32 -07:00
Andrew Grieve
9b3f750085 CB-8345 Make default for splashscreen resource "screen" (which is what template and CLI assume it to be) 2015-03-30 09:48:04 -04:00
Andrew Grieve
ba6730e594 Revert "CB-8345 android: Make "splash" the default resource ID instead of null"
This reverts commit 1d89a2aa1b.
There were some other changes in there that weren't meant to be made!
2015-03-30 09:47:00 -04:00
Jesse MacFadyen
89c23fad03 Use TRAVIS_BUILD_DIR, install paramedic by npm 2015-03-24 23:43:27 -07:00
Andrew Grieve
1d89a2aa1b CB-8345 android: Make "splash" the default resource ID instead of null 2015-03-24 14:50:09 -04:00
sgrebnov
0ff8d52081 docs: added Windows to supported platforms 2015-03-19 18:24:40 +03:00
daserge
bb65993a51 CB-7964 Add cordova-plugin-splashscreen support for browser platform
Added Browser platform support
Using cordova/confighelper module to read parameter values from config.xml
Updated the docs
2015-03-18 16:01:31 +03:00
Steve Gill
6ce8a32865 CB-8653 Updated Readme 2015-03-13 19:41:09 -07:00
Jesse MacFadyen
5afde1c62f [wp8] oops, Added back config parse result checks 2015-03-10 15:03:39 -07:00
Jesse MacFadyen
6b1e72c631 [WP8] code cleanup, minor refactors, comments to clarify some stuff. 2015-03-10 14:27:29 -07:00
Jesse MacFadyen
98edfeb73e Merge branch 'galexandrov/wp8-fixes' of https://github.com/Icenium/cordova-plugin-splashscreen 2015-03-10 12:53:16 -07:00
Georgi Alexandrov
688b138e31 Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file 2015-03-09 14:30:14 +02:00
Jesse MacFadyen
8bc540e454 CB-8574 Integrate TravisCI 2015-03-02 16:37:52 -08:00
Victor Sosa
4430cfce6b CB-8438 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2015-02-27 12:52:28 -06:00
Steve Gill
c1d4ca8d83 CB-8538 Added package.json file 2015-02-25 00:53:27 -08:00
sgrebnov
bcbc23958f CB-8397 Add support to 'windows' for showing the Windows Phone splashscreen 2015-02-11 13:36:02 +03:00
Andrew Grieve
b232cd7447 CB-8429 Incremented plugin version. 2015-02-04 20:54:03 -05:00
Andrew Grieve
a9f0faa499 CB-8429 Updated version and RELEASENOTES.md for release 1.0.0 2015-02-04 20:12:45 -05:00
Andrew Grieve
c3a5867c81 CB-8351 ios: Stop using deprecated IsIpad macro 2015-01-27 10:20:17 -05:00
Andrew Grieve
e86a9cc7a4 CB-8280 android: Don't apply SplashScreenDelay when .show() is called explicitly 2015-01-19 13:39:55 -05:00
Andrew Grieve
ddec7008cb CB-3679 Add engine tag for Android >= 3.6.0 due to use of preferences 2014-12-11 11:15:01 -05:00
Andrew Grieve
e320e2504a CB-8079 Use activity class package name, but fallback to application package name when looking for splash screen drawable 2014-12-10 21:18:00 -05:00
Andrew Grieve
e593fe3f53 CB-3679 Make SplashScreen plugin compatible with cordova-android@4.0.x 2014-12-10 16:09:54 -05:00
Andrew Grieve
50e4887aa1 CB-3679 Break Android splashscreen logic into splascreen plugin 2014-12-10 15:37:15 -05:00
Steve Gill
f67216d64a CB-8110 Incremented plugin version. 2014-12-02 16:08:50 -08:00
Steve Gill
67e8b9f01d CB-8110 Updated version and RELEASENOTES.md for release 0.3.5 2014-12-02 16:07:02 -08:00
Ian Clelland
29ac24ff9d Merge branch 'CB-7700' 2014-12-02 16:19:29 -05:00
Victor Sosa
3947f8570a CB-7700 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-10-20 10:39:27 -05:00
Shazron Abdullah
d2e62a551c CB-7204 - Race condition when hiding and showing spinner (closes #21) 2014-10-13 16:11:42 -07:00
Shazron Abdullah
c67622f1b9 Update iOS test to specify device 2014-10-13 16:06:17 -07:00
Nic Mulvaney
2f37eed184 Fix for portrait/landscape detection
Sometimes the width can be 568 or 320 depending on orientation on iPhone 5. This fixes the detection.

Signed-off-by: Shazron Abdullah <shazron@apache.org>
2014-10-13 16:03:33 -07:00
Ian Clelland
887f0f6c81 Merge branch 'master' of https://github.com/sosahvictor/cordova-plugin-splashscreen 2014-10-06 15:10:40 -04:00
Steven Gill
8804977c84 Incremented plugin version. 2014-10-03 17:09:47 -07:00
Steven Gill
b46cdca795 Updated version and RELEASENOTES.md for release 0.3.4 2014-10-03 16:10:14 -07:00
Victor Sosa
1009019372 CB-7700 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-10-02 18:13:15 -05:00
Shazron Abdullah
129830a76c Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus). 2014-10-01 16:06:24 -07:00
Shazron Abdullah
24e6f2e0dd CB-7633 - (Re-fix based on updated unit tests) iPhone 6 Plus support 2014-10-01 13:59:22 -07:00
Shazron Abdullah
21f372acc9 Updated iOS tests for locked orientations 2014-10-01 13:49:36 -07:00
Shazron Abdullah
4d548e67c2 Added more iOS splash screen tests. 2014-09-30 17:52:51 -07:00
Shazron Abdullah
55722de1c4 CB-7633 - Add support for iPhone 6/6+ 2014-09-30 17:52:30 -07:00
Shazron Abdullah
0ffe1c2d46 Added failing iPhone 6/6 Plus tests. 2014-09-30 16:59:47 -07:00
Shazron Abdullah
95f407ea0d Re-fix iOS command line tests not working if Xcode was not launched at least once (shared scheme was not saved in the right place) 2014-09-30 11:56:38 -07:00
Shazron Abdullah
99803ba7c6 Fix iOS command line tests not working if Xcode was not launched at least once. 2014-09-30 11:52:11 -07:00
Shazron Abdullah
6b87577801 Added 'npm test' 2014-09-30 11:47:46 -07:00
Shazron Abdullah
d0614c532b Fixed iOS tests README typo. 2014-09-30 11:06:04 -07:00
Shazron Abdullah
483182f33a CB-7663 - Update README for command line invocation of tests 2014-09-29 17:49:21 -07:00
Shazron Abdullah
d85c6a9359 CB-7663 - iOS unit tests for splash screen 2014-09-29 17:33:50 -07:00
Shazron Abdullah
fcd628ffc9 CB-7663 - prep for unit tests 2014-09-29 14:03:58 -07:00
Shazron Abdullah
e1f17d6665 Properly formatted splashscreen preference docs. 2014-09-29 12:03:01 -07:00
Marcel Kinard
ec7c6aac30 CB-7571 Bump version of nested plugin to match parent plugin 2014-09-17 16:27:18 -04:00
Marcel Kinard
0b001fb209 CB-7571 Incremented plugin version. 2014-09-17 15:35:02 -04:00
Marcel Kinard
e4d8b77027 CB-7571 Updated version and RELEASENOTES.md for release 0.3.3 2014-09-17 15:27:44 -04:00
Lisa Seacat DeLuca
0f63861e88 CB-7249cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-08-19 10:51:57 -04:00
Edna Morales
e364377d4f Merge renamed tests dir 2014-08-13 13:24:50 -04:00
Jesse MacFadyen
395302ee16 Merge branch 'CB-7196' of https://github.com/stacic/cordova-plugin-splashscreen 2014-08-07 13:39:02 -07:00
Steven Gill
333b0e7f90 CB-7244 Incremented plugin version. 2014-08-06 19:24:29 -07:00
Steven Gill
3b58cd69b3 CB-7244 Updated version and RELEASENOTES.md for release 0.3.2 2014-08-06 18:58:24 -07:00
Staci Cooper
be8d340f31 Renamed test dir, added nested plugin.xml 2014-08-01 16:40:01 -04:00
Edna Morales
f833c39ed3 added documentation for manual tests 2014-07-29 09:10:44 -04:00
Staci Cooper
8eb2533e78 CB-7196 port splashscreen tests to framework 2014-07-24 15:37:03 -04:00
Lisa Seacat DeLuca
5d25cf0250 CB-6127lisa7cordova-plugin-consolecordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-07-07 15:28:22 -04:00
Michael Hoisie
cd61952efc CB-7041 ios: Fix image filename logic when setting the iPad splash screen
When running Cordova apps without orientation lock on iPads, the
Splash Screen plugin didn't work properly. It would skip the iPad-
specific splash screen logic, and just select the image named
@"Default.png" (without adding the orientation suffix), and print
the following messages in the console:

WARNING: The splashscreen image named Default was not found

Now, for iPads, the splash screen image is set by first looking
at the position of the orientation lock, and if that is not set, it
uses the calculated view orientation.

close #19
2014-06-27 14:56:49 -04:00
ldeluca
6f23d8e828 CB-6773cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-06-23 13:53:41 -04:00
ldeluca
cf5c5beafb Merge branch 'master' of ssh://github.com/ldeluca/cordova-plugin-splashscreen into CB-6773cordova-plugin-splashscreen 2014-06-23 12:26:08 -04:00
Nadya Atanasova
1f50d90d9e fixes Splashscreen crash on WP8
The UI elements cannot be accessed from any other than the UI thread directly. So, enclose UI access code in the Dispatcher.BeginInvoke()
2014-06-19 16:55:35 +04:00
mbillau
c56bb9efec Remove outdated doc, thx Axel 2014-06-16 13:43:32 -04:00
ldeluca
1943a88c8c Merge branch 'master' of ssh://github.com/ldeluca/cordova-plugin-splashscreen into CB-6773cordova-plugin-splashscreen 2014-06-11 10:00:30 -04:00
Steven Gill
ac1422f49f CB-6877 Incremented plugin version. 2014-06-05 13:40:50 -07:00
Steven Gill
b3b7a561ab CB-6877 Updated version and RELEASENOTES.md for release 0.3.1 2014-06-05 13:39:43 -07:00
Steven Gill
91ed62deda Merge branch 'master' of https://github.com/ldeluca/cordova-plugin-splashscreen 2014-06-04 15:21:11 -07:00
Marcel Kinard
30661dbb42 CB-6810 Add license to CONTRIBUTING.md 2014-05-30 11:37:08 -04:00
ldeluca
b109c7f234 Merge branch 'master' of ssh://github.com/ldeluca/cordova-plugin-splashscreen into CB-6773cordova-plugin-splashscreen 2014-05-30 09:52:46 -04:00
ldeluca
d7f0994f32 Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen 2014-05-30 09:52:37 -04:00
Jesse MacFadyen
f37c1557b6 [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same 2014-05-29 17:58:28 -07:00
Jesse MacFadyen
988517df7f [wp] implemented OnInit so splash screen can be shown before cordova page is loaded 2014-05-29 17:41:49 -07:00
Jesse MacFadyen
8e12d550a1 [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work 2014-05-29 17:40:38 -07:00
ldeluca
829dbcc819 CB-6773cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen 2014-05-28 13:15:40 -04:00
ldeluca
ae7daf48e3 Merge branch 'master' of ssh://github.com/ldeluca/cordova-plugin-splashscreen into CB-6773cordova-plugin-splashscreen 2014-05-28 13:07:18 -04:00
ldeluca
4fda49b771 documentation translation: cordova-plugin-splashscreen 2014-05-28 12:48:19 -04:00
ldeluca
2c68427a8a Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-28 12:48:19 -04:00
ldeluca
0498d90517 Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-28 12:48:19 -04:00
ldeluca
5c245c2bc8 Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-28 12:48:19 -04:00
ldeluca
ec5bbc51e7 Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-28 12:48:19 -04:00
ldeluca
1c350a061f documentation translation: cordova-plugin-splashscreen 2014-05-27 21:37:03 -04:00
ldeluca
7d78efed0d Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-27 21:22:38 -04:00
ldeluca
51e054a1ea Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-05-27 17:50:00 -04:00
ldeluca
39827ec753 Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen 2014-05-05 10:03:17 -04:00
Jesse MacFadyen
71dc86786b Merge branch 'master' of https://github.com/sgrebnov/cordova-plugin-splashscreen 2014-04-30 16:12:36 -07:00
Marcel Kinard
0a82a8ef2d CB-6491 add CONTRIBUTING.md 2014-04-30 09:34:37 -04:00
Ian Clelland
83a6c41132 Merge branch 'dev' into master
Further development should take place on master
2014-04-25 11:25:13 -04:00
Ian Clelland
0838b1d3a7 Merge tag 'r0.3.0'
Conflicts:
	src/tizen/SplashScreenProxy.js
2014-04-23 14:48:48 -04:00
Sergey Grebnov
bcbb574d05 CB-6483 Use splash screen image from manifest on Windows8 2014-04-21 16:57:49 -07:00
Ian Clelland
f82ff290a9 CB-6452 Incremented plugin version on dev branch. 2014-04-17 11:16:03 -04:00
Ian Clelland
8052d3804d CB-6452 Updated version and RELEASENOTES.md for release 0.3.0 2014-04-17 10:53:20 -04:00
Ian Clelland
f46aae1075 CB-6465: Add license headers to Tizen code 2014-04-17 09:50:57 -04:00
Ian Clelland
23cbf34bae CB-6460: Update license headers 2014-04-16 16:22:15 -04:00
Jesse MacFadyen
1e54cacac1 CB-6422 [windows8] use cordova/exec/proxy 2014-04-08 16:35:42 -07:00
Shazron Abdullah
e3e3996766 CB-4051 - Re-fix - Splashscreen rotation problem (closes #13) 2014-03-19 18:28:52 -07:00
Andrew Grieve
a10d8f8ca0 Add NOTICE file 2014-02-27 15:36:31 -05:00
ldeluca
fca4e5c351 Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-02-27 11:15:13 -05:00
ldeluca
0595d4d779 Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen 2014-02-26 09:36:31 -05:00
Steven Gill
6bc271b059 CB-5980 Incremented plugin version on dev branch. 2014-02-05 18:13:30 -08:00
Steven Gill
3d553eb51a Merge branch 'dev' 2014-02-05 18:12:13 -08:00
Steven Gill
91234e2d59 CB-5980 Updated version and RELEASENOTES.md for release 0.2.7 2014-02-05 17:53:59 -08:00
Anis Kadri
61a7a6d3df Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen into dev 2014-01-27 17:33:40 -08:00
Anis Kadri
6cb0a8cf0c Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen"
This reverts commit 4da6ca883c, reversing
changes made to 3c2813f505.
2014-01-27 17:32:09 -08:00
Anis Kadri
4da6ca883c Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen 2014-01-27 17:00:15 -08:00
Michael Hanselmann
75327c88e4 [CB-3562] Fix aspect ratio on landscape-only iPhone applications
The splash screen is shown with a faulty aspect ratio for landscape-only
applications on iPhone/iPod touch devices. This is fixed by applying
a 90° rotational transformation.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2014-01-15 16:33:32 -08:00
Andrew Grieve
fe288ec3c3 Delete stale test/ directory 2014-01-08 21:14:02 -05:00
Sean Bollin
424e82cde4 CB-4051 fix for splashscreen rotation problem 2014-01-07 14:35:25 -08:00
Andrew Grieve
1560fc86f8 CB-5719 Incremented plugin version on dev branch. 2014-01-02 12:30:52 -05:00
Andrew Grieve
3c2813f505 CB-5719 Updated version and RELEASENOTES.md for release 0.2.6 2014-01-02 12:24:02 -05:00
Andrew Grieve
7c520181c3 CB-5658 Update license comment formatting of doc/index.md 2013-12-18 21:11:03 -05:00
Andrew Grieve
a5d40d0a95 CB-5658 Add doc.index.md for Splashscreen plugin 2013-12-18 20:59:29 -05:00
Andrew Grieve
c2d22c0671 CB-5658 Delete stale snapshot of plugin docs 2013-12-17 20:49:39 -05:00
Nathan Peles
d799eda020 Handle error when splash image is missing.
From pull request:
https://github.com/apache/cordova-plugin-splashscreen/pull/1
2013-12-06 14:38:28 -05:00
Steven Gill
9541c1eb37 [CB-5565] Incremented plugin version on dev branch. 2013-12-04 15:32:04 -08:00
Steven Gill
e73b59024a [CB-5565] Updated version and RELEASENOTES.md for release 0.2.5 2013-12-04 15:16:31 -08:00
Steven Gill
01edc0ead2 added ubuntu support 2013-12-02 16:29:17 -08:00
Steven Gill
b998129669 Merge branch 'dev' of github.com:archananaik/cordova-plugin-splashscreen into dev 2013-11-26 16:45:45 -08:00
Gabriel Schulhof
8dc057b796 Proxy: Correct structure, and only ever create one splashscreen window. 2013-11-19 14:01:56 +02:00
Gabriel Schulhof
8aa0b24481 plugin.xml: Make sure splashscreen proxy is executed. 2013-11-19 14:01:13 +02:00
Salvatore Iovene
9f3b52f4b9 Fix path of Tizen's SplashScreenProxy file. 2013-11-19 13:11:59 +02:00
Salvatore Iovene
cf7c35d399 Fix syntax errors. 2013-11-19 13:11:32 +02:00
Salvatore Iovene
c368b63f0a Fix typo. 2013-11-19 13:04:30 +02:00
Salvatore Iovene
3a1810baa5 Native Tizen implementation of SplashScreen API. 2013-11-19 12:55:35 +02:00
Salvatore Iovene
9ebd08f69b Add tentative Tizen implementation. 2013-11-19 12:43:12 +02:00
Shazron Abdullah
c9ff4b428b CB-5124 - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs 2013-11-11 15:16:31 -08:00
Archana Naik
75f78b9032 Added amazon-fireos platform.
Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'
2013-10-30 14:51:44 -07:00
Steven Gill
02492654ef CB-5188: 2013-10-28 12:27:16 -07:00
Steven Gill
4b757c8e73 Merge branch 'dev' 2013-10-28 12:13:55 -07:00
Steven Gill
71ea946746 [CB-5188] Updated version and RELEASENOTES.md for release 0.2.4 2013-10-28 12:08:11 -07:00
hermwong
1cfd009c91 CB-5128: add repo + issue tag to plugin.xml for splashscreen plugin 2013-10-22 14:02:04 -07:00
Maxim Ermilov
6c12ea4380 add ubuntu platform 2013-10-16 22:16:33 +04:00
Steven Gill
8326da4ee2 [CB-5010] Incremented plugin version on dev branch. 2013-10-09 16:06:49 -07:00
Steven Gill
b0543eee77 Merge branch 'dev' 2013-10-09 15:44:00 -07:00
Steven Gill
0b733d1797 [CB-5010] Updated version and RELEASENOTES.md for release 0.2.3 2013-10-09 15:33:12 -07:00
Shazron Abdullah
c2dea2fc02 [CB-4806] (Re-fix) Update splashscreen image bounds for iOS 7 2013-10-01 13:26:05 -07:00
purplecabbage
abc62a5eda Merge branch 'CB-4934' of https://github.com/csantanapr/cordova-plugin-splashscreen into dev 2013-09-26 16:14:11 -07:00
Carlos Santana
2dc0f42b8f [CB-4934] plugin-splashscreen should not show by default on Windows8 2013-09-26 17:54:43 -04:00
Carlos Santana
71a8c9cc33 [CB-4929] plugin-splashscreen not loading proxy windows8 2013-09-26 15:20:22 -04:00
Steven Gill
52b6c539d3 [CB-4915] Incremented plugin version on dev branch. 2013-09-25 18:34:15 -07:00
Steven Gill
10e7e9a1d5 Merge branch 'dev' 2013-09-25 18:19:29 -07:00
Steven Gill
f1aed7d844 [CB-4915] Updated version and RELEASENOTES.md for release 0.2.2 2013-09-25 17:56:18 -07:00
Anis Kadri
87a701004d CB-4889 bumping&resetting version 2013-09-25 17:50:50 +02:00
Anis Kadri
4ce42a0c99 CB-4889 renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen 2013-09-21 12:38:51 +02:00
Andrew Grieve
d937fcb43b Rename CHANGELOG.md -> RELEASENOTES.md 2013-09-17 11:36:13 -04:00
Shazron Abdullah
4275e57a73 Revert "[CB-4806] Update splashscreen image bounds for iOS 7"
This reverts commit 96d5875dc3.
2013-09-16 17:27:09 -07:00
Shazron Abdullah
1111c8b3b9 [CB-4806] Update splashscreen image bounds for iOS 7 2013-09-16 17:26:48 -07:00
Shazron Abdullah
96d5875dc3 [CB-4806] Update splashscreen image bounds for iOS 7 2013-09-13 15:58:36 -07:00
Andrew Grieve
5f83eda5e8 [CB-4752] Incremented plugin version on dev branch. 2013-09-06 00:58:22 -04:00
55 changed files with 4119 additions and 1033 deletions

28
.appveyor.yml Normal file
View File

@@ -0,0 +1,28 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
max_jobs: 1
shallow_clone: true
init:
- git config --global core.autocrlf true
image:
- Visual Studio 2017
environment:
nodejs_version: "4"
matrix:
- PLATFORM: windows-10-store
JUST_BUILD: --justBuild
install:
- npm cache clean -f
- node --version
- npm install -g cordova-paramedic@https://github.com/apache/cordova-paramedic.git
- npm install -g cordova
build: off
test_script:
- cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%

42
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,42 @@
<!--
Please have a look at the issue templates you get when you click "New issue" in the GitHub UI.
We very much prefer issues created by using one of these templates.
-->
### Issue Type
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] Bug Report
- [ ] Feature Request
- [ ] Support Question
## Description
## Information
<!-- Include all relevant information that might help understand and reproduce the problem -->
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
## Checklist
<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
- [ ] I searched for already existing GitHub issues about this
- [ ] I updated all Cordova tooling to their most recent version
- [ ] I included all the necessary information above

50
.github/ISSUE_TEMPLATE/BUG_REPORT.md vendored Normal file
View File

@@ -0,0 +1,50 @@
---
name: 🐛 Bug Report
about: If something isn't working as expected.
---
# Bug Report
## Problem
### What is expected to happen?
### What does actually happen?
## Information
<!-- Include all relevant information that might help understand and reproduce the problem -->
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above

View File

@@ -0,0 +1,29 @@
---
name: 🚀 Feature Request
about: A suggestion for a new functionality
---
# Feature Request
## Motivation Behind Feature
<!-- Why should this feature be implemented? What problem does it solve? -->
## Feature Description
<!--
Describe your feature request in detail
Please provide any code examples or screenshots of what this feature would look like
Are there any drawbacks? Will this break anything for existing users?
-->
## Alternatives or Workarounds
<!--
Describe alternatives or workarounds you are currently using
Are there ways to do this with existing functionality?
-->

View File

@@ -0,0 +1,27 @@
---
name: 💬 Support Question
about: If you have a question, please check out our Slack or StackOverflow!
---
<!------------^ Click "Preview" for a nicer view! -->
Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_.
For usage and support questions, please check out the resources below. Thanks!
---
You can get answers to your usage and support questions about **Apache Cordova** on:
* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/)
* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova`
---
If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:
* **Ionic Framework**
* [Ionic Community Forum](https://forum.ionicframework.com/)
* [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/)
* **PhoneGap**
* [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap)

35
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,35 @@
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
### Description
<!-- Describe your changes in detail -->
### Testing
<!-- Please describe in detail how you tested your changes. -->
### Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary

9
.gitignore vendored
View File

@@ -1,4 +1,4 @@
#If ignorance is bliss, then somebody knock the smile off my face
#If ignorance is bliss, then somebody knock the smile off my face
*.csproj.user
*.suo
@@ -20,4 +20,9 @@ Thumbs.db
node_modules
/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcuserdata/
/tests/ios/CDVSplashScreenTest.xcworkspace/xcuserdata/

1
.jshintignore Normal file
View File

@@ -0,0 +1 @@
tests/ios

16
.jshintrc Normal file
View File

@@ -0,0 +1,16 @@
{
"browser": true
, "devel": true
, "bitwise": true
, "undef": true
, "trailing": true
, "quotmark": false
, "indent": 4
, "unused": "vars"
, "latedef": "nofunc"
, "globals": {
"module": false,
"exports": false,
"require": false
}
}

123
.travis.yml Normal file
View File

@@ -0,0 +1,123 @@
# This Travis configuration file is built after a Cordova Paramedic
# specific template with minimal modifications and adaptations:
# https://github.com/apache/cordova-paramedic/blob/master/.travis.yml
sudo: false
addons:
jwt:
# sauce labs key
secure: UmbBQ73ydIzhTCfaTb/g0beTwnOHjYxlILmQYK2Tl9Gna/KbpawiVmbloX1eZakevkeYgzQmAHEF0LyDINy5AUk97azYeP0Sz/IOjIDfXAdc6U6sZb7BScneBMt6ET/hCprG4f3mbmleQ+gx+dmNWez6rlb3Xu+XWfJuwDfAWm0=
env:
global:
- SAUCE_USERNAME=snay
- TRAVIS_NODE_VERSION=8
- ANDROID_API_LEVEL=28
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
language: node_js
node_js: 8
# yaml anchor/alias: https://medium.com/@tommyvn/travis-yml-dry-with-anchors-8b6a3ac1b027
_ios: &_ios
os: osx
osx_image: xcode10.2
_android: &_android
language: android
os: linux
jdk: oraclejdk8
android:
components:
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
matrix:
include:
# additional `npm test` in directory
- env: ADDITIONAL_TESTS_DIR=./tests/ios
<<: *_ios
# one local test, without saucelabs
- env: PLATFORM=local/browser
<<: *_ios
- env: PLATFORM=local/ios-10.0
<<: *_ios
# many tests with saucelabs
- env: PLATFORM=browser-chrome
- env: PLATFORM=browser-firefox
- env: PLATFORM=browser-safari
- env: PLATFORM=browser-edge
- env: PLATFORM=ios-11.3
<<: *_ios
- env: PLATFORM=ios-12.0
<<: *_ios
- env: PLATFORM=ios-12.2
<<: *_ios
- env: PLATFORM=android-5.1
<<: *_android
- env: PLATFORM=android-6.0
<<: *_android
- env: PLATFORM=android-7.0
<<: *_android
- env: PLATFORM=android-7.1
<<: *_android
- env: PLATFORM=android-8.0
<<: *_android
- env: PLATFORM=android-8.1
<<: *_android
- env: PLATFORM=android-9.0
<<: *_android
before_install:
# manually install Node for `language: android`
- if [[ "$PLATFORM" =~ android ]]; then nvm install $TRAVIS_NODE_VERSION; fi
- node --version
- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
- npm install -g cordova
# install paramedic if not running on paramedic repo
- if ! [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then npm install -g github:apache/cordova-paramedic; fi
install:
- npm install
before_script:
- |
if [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then
# when used in the cordova-paramedic repo
TEST_COMMAND="npm run eslint"
PARAMEDIC_PLUGIN_TO_TEST="./spec/testable-plugin/"
PARAMEDIC_COMMAND="node main.js"
else
# when used in any other (plugin) repo
TEST_COMMAND="npm test"
PARAMEDIC_PLUGIN_TO_TEST=$(pwd)
PARAMEDIC_COMMAND="cordova-paramedic"
fi
- PARAMEDIC_BUILDNAME=travis-$TRAVIS_REPO_SLUG-$TRAVIS_JOB_NUMBER
- |
echo "Variables now are set to:"
echo "TEST_COMMAND=$TEST_COMMAND"
echo "ADDITIONAL_TESTS=$ADDITIONAL_TESTS"
echo "PARAMEDIC_COMMAND=$PARAMEDIC_COMMAND"
echo "PLATFORM=$PLATFORM"
echo "PARAMEDIC_PLUGIN_TO_TEST=$PARAMEDIC_PLUGIN_TO_TEST"
echo "PARAMEDIC_BUILDNAME=$PARAMEDIC_BUILDNAME"
script:
- $TEST_COMMAND
- if [[ "$ADDITIONAL_TESTS_DIR" != "" ]]; then
cd $ADDITIONAL_TESTS_DIR && npm install && npm test;
else
$PARAMEDIC_COMMAND --config ./pr/$PLATFORM --plugin $PARAMEDIC_PLUGIN_TO_TEST --buildName $PARAMEDIC_BUILDNAME;
fi

View File

@@ -7,9 +7,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,6 +18,20 @@
# under the License.
#
-->
# Release Notes
# Contributing to Apache Cordova
Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/contribute/).
The details are explained there, but the important items are:
- Sign and submit an Apache ICLA (Contributor License Agreement).
- Have a Jira issue open that corresponds to your contribution.
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!

5
NOTICE Normal file
View File

@@ -0,0 +1,5 @@
Apache Cordova
Copyright 2012 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

View File

@@ -1,18 +1,53 @@
cordova-plugin-splashscreen
----------------------------
---
title: 可设置全屏显示的 Splashscreen
description: Control the splash screen for your app.
---
<!--
# license: Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-->
For Android,
# cordova-plugin-splashscreen
In your config.xml, you need to add the following preference
在 [cordova-plugin-splashscreen](https://github.com/apache/cordova-plugin-splashscreen.git) 的基础上添加了全屏设置,处理了android启动app时黑屏的问题
`<preference name="splashscreen" value="foo" />`
- [Installation](#installation)
- [Preferences](#preferences)
* [config.xml](#configxml)
- [Other](#other)
Where foo is the name of the splashscreen file. Preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders.
## Installation
For Android, you also have to edit your projects main java file. You must add a second parameter representing a time delay to your super.loadUrl.
// 安装前请先卸载 cordova-plugin-splashscreen 插件
cordova plugin rm cordova-plugin-splashscreen
`super.loadUrl(Config.getStartUrl(), 10000);`
// 安装插件
cordova plugin add https://github.com/shuto-cn/cordova-plugin-splashscreen.git
To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface).
## Preferences
If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html).
### config.xml
- `SplashFullScreen` (boolean, default to `true`). 在app未设置全屏的情况下FadeSplash是否全屏显示
```xml
<preference name="SplashFullScreen" value="true" />
```
## Other
- 关于android启动黑屏 请保持`SplashScreen`参数值为`screen`否则请修改`src/android/res/values/style.xml`中对应资源id
- 其他配置及插件使用方法请移步[cordova-plugin-splashscreen](https://github.com/apache/cordova-plugin-splashscreen.git)

244
RELEASENOTES.md Normal file
View File

@@ -0,0 +1,244 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
# Release Notes
### 5.0.3 (May 09, 2019)
* Update CI configuration and README ([#210](https://github.com/apache/cordova-plugin-splashscreen/pull/210), [#208](https://github.com/apache/cordova-plugin-splashscreen/pull/208), [#198](https://github.com/apache/cordova-plugin-splashscreen/pull/198), [#194](https://github.com/apache/cordova-plugin-splashscreen/pull/194))
* Add or update GitHub pull request and issue template
* [CB-13826](https://issues.apache.org/jira/browse/CB-13826) Incremented plugin version.
* [CB-12277](https://issues.apache.org/jira/browse/CB-12277) (android) avoid NullPointerException on splashImageView when removing splashscreen
### 5.0.2 (Jan 24, 2018)
* [CB-13750](https://issues.apache.org/jira/browse/CB-13750) Add build-tools-26.0.2 to travis
* [CB-13737](https://issues.apache.org/jira/browse/CB-13737) (iOS): fix Splash screen images for iPhone X
### 5.0.1 (Dec 27, 2017)
* [CB-13709](https://issues.apache.org/jira/browse/CB-13709) Fix to allow 5.0.0 version install (#144)
### 5.0.0 (Dec 15, 2017)
* [CB-13677](https://issues.apache.org/jira/browse/CB-13677) Remove deprecated platforms
### 4.1.0 (Nov 06, 2017)
* [CB-13473](https://issues.apache.org/jira/browse/CB-13473) (CI) Removed **Browser** builds from AppVeyor
* [CB-12011](https://issues.apache.org/jira/browse/CB-12011) (android) added the possibility to change the spinner color on **Android 5.0**+ apps
* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
* [CB-13094](https://issues.apache.org/jira/browse/CB-13094) (android) Don't show splash when activity being finished
* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) Documented `AutoHideSplashScreen` for **Browser**
* [CB-11488](https://issues.apache.org/jira/browse/CB-11488) (browser) The `hide()` call became non re-entrant after the addition of fade out. This fixes the issue.
* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) The standard `AutoHideSplashScreen` `config.xml` property is now supported by the **Browser** platform.
* [CB-11486](https://issues.apache.org/jira/browse/CB-11486) (browser) `splashScreenDelay` now feed through `parseInt` to ensure it is an integer by the time it's value is passed in to `setTimeout()` in `hide()`.
* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
### 4.0.3 (Apr 27, 2017)
* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
### 4.0.2 (Feb 28, 2017)
* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
### 4.0.1 (Dec 07, 2016)
* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 4.0.1
* [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined Document that splashscreen needs to be disabled on Windows in case of updating entire document body
* [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for **Windows 8.1** and Windows Phone 8.1
* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
* [CB-11830](https://issues.apache.org/jira/browse/CB-11830) (iOS) Fix doc typos in PR#114
* [CB-11829](https://issues.apache.org/jira/browse/CB-11829) (iOS) Support for CB-9762; docs (CB-11830)
* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
### 4.0.0 (Sep 08, 2016)
* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
* [CB-11326](https://issues.apache.org/jira/browse/CB-11326) Prevent crash when initializing plugin after navigating to another URL
* Fix crash on **iOS** when reloading page from remote **Safari**
* Add badges for paramedic builds on Jenkins
* Add pull request template.
* [CB-11179](https://issues.apache.org/jira/browse/CB-11179) Extend the windows-splashscreen docs
* [CB-11159](https://issues.apache.org/jira/browse/CB-11159) Fix flaky splashscreen native tests
* [CB-11156](https://issues.apache.org/jira/browse/CB-11156) Change default `FadeSplashScreenDuration` value
* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Updated the dependency version, added it to the docs
* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Implement splashscreen for **Windows** platform
* [CB-6498](https://issues.apache.org/jira/browse/CB-6498) Misleading documentation in **Android** Quirks
### 3.2.2 (Apr 15, 2016)
* [CB-10979](https://issues.apache.org/jira/browse/CB-10979) Fix splashscreen **iOS** native tests. Added `jshintignore` for tests/ios
* [CB-10895](https://issues.apache.org/jira/browse/CB-10895) Transparent Splashscreen view sometimes remains
* [CB-10562](https://issues.apache.org/jira/browse/CB-10562) `hide()` not working in latest splashscreen plug in 3.1.0 in **iOS**
* [CB-10688](https://issues.apache.org/jira/browse/CB-10688) Plugin Splashscreen Readme must have examples.
* [CB-10864](https://issues.apache.org/jira/browse/CB-10864) Run **iOS** native tests on Travis
### 3.2.1 (Mar 09, 2016)
* [CB-10764](https://issues.apache.org/jira/browse/CB-10764) Remove emoji in cordova-plugin-splashscreen
* [CB-10650](https://issues.apache.org/jira/browse/CB-10650) Non-index content.src causes Splashscreen to be not displayed on **Browser**
* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
* [CB-10606](https://issues.apache.org/jira/browse/CB-10606) fix deprecation warning for interfaceOrientation on **iOS**
* chore: edit package.json license to match SPDX id
### 3.2.0 (Feb 09, 2016)
* [CB-10422](https://issues.apache.org/jira/browse/CB-10422) Splashscreen displays black screen with no image on Android
* [CB-10412](https://issues.apache.org/jira/browse/CB-10412) AutoHideSplashScreen "false" isn't taken in account on iOS
* [CB-9516](https://issues.apache.org/jira/browse/CB-9516) Android SplashScreen - Spinner Does Not Display
* [CB-9094](https://issues.apache.org/jira/browse/CB-9094) Smarter autohide logic on Android
* [CB-8396](https://issues.apache.org/jira/browse/CB-8396) Add AutoHideSplashScreen logic to Android's Splashscreen
### 3.1.0 (Jan 15, 2016)
* [CB-9538](https://issues.apache.org/jira/browse/CB-9538) Implementing `FadeSplashScreen` feature for **Android**
* [CB-9240](https://issues.apache.org/jira/browse/CB-9240) Cordova splash screen plugin **iPad** landscape mode issue
* [CB-10263](https://issues.apache.org/jira/browse/CB-10263) Fix splashscreen plugin filenames for Asset Catalog
* [CB-9374](https://issues.apache.org/jira/browse/CB-9374) **Android** add `SplashShowOnlyFirstTime` as preference
* [CB-10244](https://issues.apache.org/jira/browse/CB-10244) Don't rotate the **iPhone 6 Plus** splash
* [CB-9043](https://issues.apache.org/jira/browse/CB-9043) Fix the **ios** splashscreen being deformed on orientation change
* [CB-10079](https://issues.apache.org/jira/browse/CB-10079) Splashscreen plugin does not honor `SplashScreenDelay` on **iOS**
* [CB-10231](https://issues.apache.org/jira/browse/CB-10231) Fix `FadeSplashScreen` to default to true on **iOS**
### 3.0.0 (Nov 18, 2015)
* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
* Fixing contribute link.
* [CB-9750](https://issues.apache.org/jira/browse/CB-9750) `FadeSplashDuration` is now in `msecs`
* [CB-8875](https://issues.apache.org/jira/browse/CB-8875) `FadeSplashScreen` was not fading
* [CB-9467](https://issues.apache.org/jira/browse/CB-9467) SplashScreen does not show any image in hosted app on **Windows 10**
* [CB-7282](https://issues.apache.org/jira/browse/CB-7282) Document `AutoHideSplashScreenpreference`
* [CB-9327](https://issues.apache.org/jira/browse/CB-9327) - Splashscreen not receiving `CDVPageLoadNotification`
* WP8: Avoid config `value` of a wrong element.
### 2.1.0 (Jun 17, 2015)
* added missing license headers
* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
* fix npm md issue
* Fixed iOS unit tests.
* [CB-3562](https://issues.apache.org/jira/browse/CB-3562): Disable screen rotation for iPhone when splash screen is shown. (closes #47)
* [CB-8988](https://issues.apache.org/jira/browse/CB-8988): Fix rotation on iOS/iPad (closes #46)
* [CB-8904](https://issues.apache.org/jira/browse/CB-8904): Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable
* Removed wp7 from `plugin.xml` and package.json
* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Rewrite resoultion helper
* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Allow resolution-specific splashscreen images
* [CB-8758](https://issues.apache.org/jira/browse/CB-8758) [wp8]: UnauthorizedAccessException on hide()
### 2.0.0 (Apr 15, 2015)
* give users a way to install the bleeding edge.
* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
* [CB-8797](https://issues.apache.org/jira/browse/CB-8797) - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing
* [CB-8836](https://issues.apache.org/jira/browse/CB-8836) - Crashes after animating splashscreen
* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Fix missing import in previous commit
* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Adds `SplashMaintainAspectRatio` preference (close #43)
* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) Make default for splashscreen resource "screen" (which is what template and CLI assume it to be)
* Revert "CB-8345 android: Make "splash" the default resource ID instead of null"
* Use TRAVIS_BUILD_DIR, install paramedic by npm
* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) android: Make "splash" the default resource ID instead of null
* docs: added Windows to supported platforms
* [CB-7964](https://issues.apache.org/jira/browse/CB-7964) Add cordova-plugin-splashscreen support for browser platform
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
* [wp8] oops, Added back config parse result checks
* [WP8] code cleanup, minor refactors, comments to clarify some stuff.
* Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file
* [CB-8574](https://issues.apache.org/jira/browse/CB-8574) Integrate TravisCI
* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
* [CB-8397](https://issues.apache.org/jira/browse/CB-8397) Add support to 'windows' for showing the Windows Phone splashscreen
### 1.0.0 (Feb 04, 2015)
* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using deprecated IsIpad macro
* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Add engine tag for Android >= 3.6.0 due to use of `preferences`
* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Make SplashScreen plugin compatible with cordova-android@4.0.x
### 0.3.5 (Dec 02, 2014)
* [CB-7204](https://issues.apache.org/jira/browse/CB-7204) - Race condition when hiding and showing spinner (closes #21)
* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
### 0.3.4 (Oct 03, 2014)
* Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus).
* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - (Re-fix based on updated unit tests) iPhone 6 Plus support
* Updated iOS tests for locked orientations
* Added more iOS splash screen tests.
* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - Add support for iPhone 6/6+
* Added failing iPhone 6/6 Plus tests.
* Added 'npm test'
* [CB-7663](https://issues.apache.org/jira/browse/CB-7663) - iOS unit tests for splash screen
* Properly formatted splashscreen preference docs.
### 0.3.3 (Sep 17, 2014)
* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-splashscreen documentation translation
* Renamed test dir, added nested `plugin.xml`
* added documentation for manual tests
* [CB-7196](https://issues.apache.org/jira/browse/CB-7196) port splashscreen tests to framework
### 0.3.2 (Aug 06, 2014)
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
* [CB-7041](https://issues.apache.org/jira/browse/CB-7041) ios: Fix image filename logic when setting the iPad splash screen
* fixes Splashscreen crash on WP8
* Remove outdated doc
### 0.3.1 (Jun 05, 2014)
* documentation translation: cordova-plugin-splashscreen
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
* [CB-6810](https://issues.apache.org/jira/browse/CB-6810) Add license to CONTRIBUTING.md
* [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same
* [wp] implemented OnInit so splash screen can be shown before cordova page is loaded
* [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work
* [CB-6483](https://issues.apache.org/jira/browse/CB-6483) Use splash screen image from manifest on Windows8
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
* Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen"
### 0.3.0 (Apr 17, 2014)
* Add Tizen support to plugin
* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
* [CB-4051](https://issues.apache.org/jira/browse/CB-4051): [ios] - Re-fix - Splashscreen rotation problem (closes #13)
* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
* [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code
* Add NOTICE file
### 0.2.7 (Feb 05, 2014)
* [CB-3562](https://issues.apache.org/jira/browse/CB-3562) Fix aspect ratio on landscape-only iPhone applications
* [CB-4051](https://issues.apache.org/jira/browse/CB-4051) fix for splashscreen rotation problem
### 0.2.6 (Jan 02, 2014)
* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Splashscreen plugin
* Handle error when splash image is missing.
### 0.2.5 (Dec 4, 2013)
* add ubuntu platform
* Added amazon-fireos platform. Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'
* [CB-5124](https://issues.apache.org/jira/browse/CB-5124) - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs
### 0.2.4 (Oct 28, 2013)
* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to `plugin.xml` for splashscreen plugin
* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
### 0.2.3 (Oct 9, 2013)
* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Re-fix Update splashscreen image bounds for iOS 7
* [CB-4934](https://issues.apache.org/jira/browse/CB-4934) plugin-splashscreen should not show by default on Windows8
* [CB-4929](https://issues.apache.org/jira/browse/CB-4929) plugin-splashscreen not loading proxy windows8
* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
### 0.2.2 (Sept 25, 2013)
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
* Rename CHANGELOG.md -> RELEASENOTES.md
* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Update splashscreen image bounds for iOS 7
* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.

View File

@@ -1,80 +0,0 @@
---
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---
hide
===============
Dismiss the splash screen.
navigator.splashscreen.hide();
Description
-----------
navigator.splashscreen.hide() dismisses the applications splash screen.
Supported Platforms
-------------------
- Android
- iOS
Quick Example
-------------
navigator.splashscreen.hide();
Full Example
------------
<!DOCTYPE html>
<html>
<head>
<title>Splashscreen Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
navigator.splashscreen.hide();
}
</script>
</head>
<body>
<h1>Example</h1>
</body>
</html>
iOS Quirk
------------
1. In your **config.xml**, you need to [modify the value](guide_project-settings_index.md.html#Project%20Settings) for **"AutoHideSplashScreen”** to false
2. Then, if you want to delay hiding the splash screen for 2 seconds, you can do this in your **deviceready** event handler:
setTimeout(function() {
navigator.splashscreen.hide();
}, 2000);

View File

@@ -1,90 +0,0 @@
---
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---
Splashscreen
==========
> Enables developers to show/hide the application's splash screen.
Methods
-------
- show
- hide
Permissions
-----------
### Android
#### app/res/xml/config.xml
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
### iOS
#### config.xml
<plugin name="SplashScreen" value="CDVSplashScreen" />
Setup
-----
### Android
1. Copy your splash screen image into the res/drawable directories of your Android project. The sizes of each image should be:
- xlarge (xhdpi): at least 960 x 720
- large (hdpi): at least 640 x 480
- medium (mdpi): at least 470 x 320
- small (ldpi): at least 426 x 320
It is highly recommended that you use a [9-patch image](https://developer.android.com/tools/help/draw9patch.html) for your splash screen.
2. In the onCreate method of the class that extends DroidGap add the following two lines:
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl(Config.getStartUrl(), 10000);
The first line 'super.setIntegerProperty' sets the image to be displayed as the splashscreen. If you have named your image anything other than splash.png you will have to modify this line.
The second line is the normal 'super.loadUrl' line but it has a second parameter which is the timeout value for the splash screen. In this example the splash screen will display for 10 seconds. If you want to dismiss the splash screen once you get the "deviceready" event you should call the navigator.splashscreen.hide() method.
### iOS
1. Copy your splash screen images into the **Resources/splash** directory of your iOS project. Only add the images for the devices you want to support (iPad screen size or iPhone screen size). The sizes of each image should be:
- Default-568h@2x~iphone.png (640x1136 pixels)
- Default-Landscape@2x~ipad.png (2048x1496 pixels)
- Default-Landscape~ipad.png (1024x748 pixels)
- Default-Portrait@2x~ipad.png (1536x2008 pixels)
- Default-Portrait~ipad.png (768x1004 pixels)
- Default@2x~iphone.png (640x960 pixels)
- Default~iphone.png (320x480 pixels)
### BlackBerry10
## Quirks
The SplashScreen BlackBerry10 plugin implements hide(), but show() is not possible using the built in OS mechanism. The advantage to using this is the splash screen is displayed before WebKit boots and issupports multiple images for various device resolutions and orientations.
We also implemented the AutoHideSplashScreen config.xml value, similar to iOS.

View File

@@ -1,69 +0,0 @@
---
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---
show
===============
Displays the splash screen.
navigator.splashscreen.show();
Description
-----------
navigator.splashscreen.show() displays the applications splash screen.
Supported Platforms
-------------------
- Android
- iOS
Quick Example
-------------
navigator.splashscreen.show();
Full Example
------------
<!DOCTYPE html>
<html>
<head>
<title>Splashscreen Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
navigator.splashscreen.show();
}
</script>
</head>
<body>
<h1>Example</h1>
</body>
</html>

51
package.json Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "cordova-plugin-splashscreen",
"version": "5.0.4-dev",
"description": "Cordova Splashscreen Plugin",
"types": "./types/index.d.ts",
"cordova": {
"id": "cordova-plugin-splashscreen",
"platforms": [
"android",
"ubuntu",
"ios",
"windows",
"browser"
]
},
"repository": "github:apache/cordova-plugin-splashscreen",
"bugs": "https://github.com/apache/cordova-plugin-splashscreen/issues",
"keywords": [
"cordova",
"splashscreen",
"ecosystem:cordova",
"cordova-android",
"cordova-ios",
"cordova-windows"
],
"scripts": {
"test": "npm run jshint",
"jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
},
"engines": {
"cordovaDependencies": {
"2.0.0": {
"cordova-android": ">=3.6.0"
},
"4.0.0": {
"cordova-android": ">=3.6.0",
"cordova-windows": ">=4.4.0"
},
"6.0.0": {
"cordova": ">100"
}
},
"node": ">=6.0.0"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
"devDependencies": {
"jshint": "^2.6.0"
},
"homepage": "https://cordova.apache.org/"
}

View File

@@ -1,13 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="org.apache.cordova.core.splashscreen"
version="0.2.0">
id="cordova-plugin-splashscreen"
version="5.0.4-dev">
<name>Splashscreen</name>
<description>Cordova Splashscreen Plugin</description>
<license>Apache 2.0</license>
<keywords>cordova,splashscreen</keywords>
<repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git</repo>
<issue>https://issues.apache.org/jira/browse/CB/component/12320653</issue>
<engines>
<engine name="cordova-android" version=">=3.6.0" /><!-- Requires CordovaPlugin.preferences -->
<engine name="cordova-windows" version=">=4.4.0" />
</engines>
<js-module src="www/splashscreen.js" name="SplashScreen">
<clobbers target="navigator.splashscreen" />
@@ -17,11 +41,13 @@
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen"/>
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen"/>
<param name="onload" value="true"/>
</feature>
</config-file>
<source-file src="src/android/SplashScreen.java" target-dir="src/org/apache/cordova/splashscreen" />
<resource-file src="src/android/res/values/style.xml"
target="res/values/style.xml" />
</platform>
<!-- ios -->
@@ -33,49 +59,25 @@
</feature>
</config-file>
<header-file src="src/ios/CDVSplashScreen.h" />
<source-file src="src/ios/CDVSplashScreen.m" />
<header-file src="src/ios/CDVSplashScreen.h" />
<source-file src="src/ios/CDVSplashScreen.m" />
<header-file src="src/ios/CDVViewController+SplashScreen.h" />
<source-file src="src/ios/CDVViewController+SplashScreen.m" />
<framework src="CoreGraphics.framework" />
</platform>
<!-- blackberry10 -->
<platform name="blackberry10">
<source-file src="src/blackberry10/index.js" target-dir="SplashScreen" />
<config-file target="www/config.xml" parent="/widget">
<feature name="SplashScreen" value="SplashScreen"/>
</config-file>
</platform>
<!-- wp7 -->
<platform name="wp7">
<config-file target="config.xml" parent="/*">
<feature name="SplashScreen">
<param name="wp-package" value="SplashScreen"/>
</feature>
</config-file>
<source-file src="src/wp/SplashScreen.cs" />
</platform>
<!-- wp8 -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="SplashScreen">
<param name="wp-package" value="SplashScreen"/>
</feature>
</config-file>
<source-file src="src/wp/SplashScreen.cs" />
</platform>
<!-- windows8 -->
<platform name="windows8">
<js-module src="www/windows8/SplashScreenProxy.js" name="SplashScreenProxy">
<merges target="" />
<!-- windows -->
<platform name="windows">
<js-module src="www/windows/SplashScreenProxy.js" name="SplashScreenProxy">
<runs />
</js-module>
</platform>
<!-- browser -->
<platform name="browser">
<js-module src="src/browser/SplashScreenProxy.js" name="SplashScreenProxy">
<runs />
</js-module>
</platform>
</plugin>

View File

@@ -19,20 +19,161 @@
package org.apache.cordova.splashscreen;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Handler;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AlphaAnimation;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.json.JSONArray;
import org.json.JSONException;
public class SplashScreen extends CordovaPlugin {
private static final String LOG_TAG = "SplashScreen";
// Cordova 3.x.x has a copy of this plugin bundled with it (SplashScreenInternal.java).
// Enable functionality only if running on 4.x.x.
private static final boolean HAS_BUILT_IN_SPLASH_SCREEN = Integer.valueOf(CordovaWebView.CORDOVA_VERSION.split("\\.")[0]) < 4;
private static final int DEFAULT_SPLASHSCREEN_DURATION = 3000;
private static final int DEFAULT_FADE_DURATION = 500;
private static Dialog splashDialog;
private static ProgressDialog spinnerDialog;
private static boolean firstShow = true;
private static boolean lastHideAfterDelay; // https://issues.apache.org/jira/browse/CB-9094
/**
* Displays the splash drawable.
*/
private ImageView splashImageView;
/**
* Remember last device orientation to detect orientation changes.
*/
private int orientation;
// Helper to be compile-time compatible with both Cordova 3.x and 4.x.
private View getView() {
try {
return (View)webView.getClass().getMethod("getView").invoke(webView);
} catch (Exception e) {
return (View)webView;
}
}
private int getSplashId() {
int drawableId = 0;
String splashResource = preferences.getString("SplashScreen", "screen");
if (splashResource != null) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
if (drawableId == 0) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName());
}
}
return drawableId;
}
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
if (action.equals("hide")) {
this.webView.postMessage("splashscreen", "hide");
} else if (action.equals("show")){
this.webView.postMessage("splashscreen", "show");
protected void pluginInitialize() {
if (HAS_BUILT_IN_SPLASH_SCREEN) {
return;
}
else {
// Make WebView invisible while loading URL
// CB-11326 Ensure we're calling this on UI thread
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
getView().setVisibility(View.INVISIBLE);
}
});
int drawableId = getSplashId();
// Save initial orientation.
orientation = cordova.getActivity().getResources().getConfiguration().orientation;
if (firstShow) {
boolean autoHide = preferences.getBoolean("AutoHideSplashScreen", true);
showSplashScreen(autoHide);
}
if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) {
firstShow = false;
}
}
/**
* Shorter way to check value of "SplashMaintainAspectRatio" preference.
*/
private boolean isMaintainAspectRatio () {
return preferences.getBoolean("SplashMaintainAspectRatio", false);
}
private int getFadeDuration () {
int fadeSplashScreenDuration = preferences.getBoolean("FadeSplashScreen", true) ?
preferences.getInteger("FadeSplashScreenDuration", DEFAULT_FADE_DURATION) : 0;
if (fadeSplashScreenDuration < 30) {
// [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10
// they mean 10 seconds, and not the meaningless 10ms
fadeSplashScreenDuration *= 1000;
}
return fadeSplashScreenDuration;
}
@Override
public void onPause(boolean multitasking) {
if (HAS_BUILT_IN_SPLASH_SCREEN) {
return;
}
// hide the splash screen to avoid leaking a window
this.removeSplashScreen(true);
}
@Override
public void onDestroy() {
if (HAS_BUILT_IN_SPLASH_SCREEN) {
return;
}
// hide the splash screen to avoid leaking a window
this.removeSplashScreen(true);
// If we set this to true onDestroy, we lose track when we go from page to page!
//firstShow = true;
}
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if (action.equals("hide")) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
webView.postMessage("splashscreen", "hide");
}
});
} else if (action.equals("show")) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
webView.postMessage("splashscreen", "show");
}
});
} else {
return false;
}
@@ -40,4 +181,238 @@ public class SplashScreen extends CordovaPlugin {
return true;
}
@Override
public Object onMessage(String id, Object data) {
if (HAS_BUILT_IN_SPLASH_SCREEN) {
return null;
}
if ("splashscreen".equals(id)) {
if ("hide".equals(data.toString())) {
this.removeSplashScreen(false);
} else {
this.showSplashScreen(false);
}
} else if ("spinner".equals(id)) {
if ("stop".equals(data.toString())) {
getView().setVisibility(View.VISIBLE);
}
} else if ("onReceivedError".equals(id)) {
this.spinnerStop();
}
return null;
}
// Don't add @Override so that plugin still compiles on 3.x.x for a while
public void onConfigurationChanged(Configuration newConfig) {
if (newConfig.orientation != orientation) {
orientation = newConfig.orientation;
// Splash drawable may change with orientation, so reload it.
if (splashImageView != null) {
int drawableId = getSplashId();
if (drawableId != 0) {
splashImageView.setImageDrawable(cordova.getActivity().getResources().getDrawable(drawableId));
}
}
}
}
private void removeSplashScreen(final boolean forceHideImmediately) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cordova.getActivity().getWindow().setNavigationBarColor(Color.parseColor("#000000"));
}
if (splashDialog != null && splashImageView != null && splashDialog.isShowing()) {//check for non-null splashImageView, see https://issues.apache.org/jira/browse/CB-12277
final int fadeSplashScreenDuration = getFadeDuration();
// CB-10692 If the plugin is being paused/destroyed, skip the fading and hide it immediately
if (fadeSplashScreenDuration > 0 && forceHideImmediately == false) {
AlphaAnimation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setInterpolator(new DecelerateInterpolator());
fadeOut.setDuration(fadeSplashScreenDuration);
splashImageView.setAnimation(fadeOut);
splashImageView.startAnimation(fadeOut);
fadeOut.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
spinnerStop();
}
@Override
public void onAnimationEnd(Animation animation) {
if (splashDialog != null && splashImageView != null && splashDialog.isShowing()) {//check for non-null splashImageView, see https://issues.apache.org/jira/browse/CB-12277
splashDialog.dismiss();
splashDialog = null;
splashImageView = null;
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
} else {
spinnerStop();
splashDialog.dismiss();
splashDialog = null;
splashImageView = null;
}
}
}
});
}
/**
* Shows the splash screen over the full Activity
*/
@SuppressWarnings("deprecation")
private void showSplashScreen(final boolean hideAfterDelay) {
final int splashscreenTime = preferences.getInteger("SplashScreenDelay", DEFAULT_SPLASHSCREEN_DURATION);
final int drawableId = getSplashId();
final int fadeSplashScreenDuration = getFadeDuration();
final int effectiveSplashDuration = Math.max(0, splashscreenTime - fadeSplashScreenDuration);
lastHideAfterDelay = hideAfterDelay;
// Prevent to show the splash dialog if the activity is in the process of finishing
if (cordova.getActivity().isFinishing()) {
return;
}
// If the splash dialog is showing don't try to show it again
if (splashDialog != null && splashDialog.isShowing()) {
return;
}
if (drawableId == 0 || (splashscreenTime <= 0 && hideAfterDelay)) {
return;
}
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
// Get reference to display
Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
Context context = webView.getContext();
// Use an ImageView to render the image because of its flexible scaling options.
splashImageView = new ImageView(context);
splashImageView.setImageResource(drawableId);
LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
splashImageView.setLayoutParams(layoutParams);
splashImageView.setMinimumHeight(display.getHeight());
splashImageView.setMinimumWidth(display.getWidth());
// TODO: Use the background color of the webView's parent instead of using the preference.
splashImageView.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
if (isMaintainAspectRatio()) {
// CENTER_CROP scale mode is equivalent to CSS "background-size:cover"
splashImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
}
else {
// FIT_XY scales image non-uniformly to fit into image view.
splashImageView.setScaleType(ImageView.ScaleType.FIT_XY);
}
// Create and show the dialog
splashDialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
// check to see if the splash screen should be full screen
boolean fullscreen = preferences.getBoolean("SplashFullScreen", true);
if (fullscreen || ((cordova.getActivity().getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
== WindowManager.LayoutParams.FLAG_FULLSCREEN)) {
splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
splashDialog.setContentView(splashImageView);
splashDialog.setCancelable(false);
splashDialog.show();
if (preferences.getBoolean("ShowSplashScreenSpinner", true)) {
spinnerStart();
}
// Set Runnable to remove splash screen just in case
if (hideAfterDelay) {
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
if (lastHideAfterDelay) {
removeSplashScreen(false);
}
}
}, effectiveSplashDuration);
}
}
});
}
// Show only spinner in the center of the screen
private void spinnerStart() {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
spinnerStop();
spinnerDialog = new ProgressDialog(webView.getContext());
spinnerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
spinnerDialog = null;
}
});
spinnerDialog.setCancelable(false);
spinnerDialog.setIndeterminate(true);
RelativeLayout centeredLayout = new RelativeLayout(cordova.getActivity());
centeredLayout.setGravity(Gravity.CENTER);
centeredLayout.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
ProgressBar progressBar = new ProgressBar(webView.getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
progressBar.setLayoutParams(layoutParams);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
String colorName = preferences.getString("SplashScreenSpinnerColor", null);
if(colorName != null){
int[][] states = new int[][] {
new int[] { android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] { android.R.attr.state_pressed} // pressed
};
int progressBarColor = Color.parseColor(colorName);
int[] colors = new int[] {
progressBarColor,
progressBarColor,
progressBarColor,
progressBarColor
};
ColorStateList colorStateList = new ColorStateList(states, colors);
progressBar.setIndeterminateTintList(colorStateList);
}
}
centeredLayout.addView(progressBar);
spinnerDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
spinnerDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
spinnerDialog.show();
spinnerDialog.setContentView(centeredLayout);
}
});
}
private void spinnerStop() {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
if (spinnerDialog != null && spinnerDialog.isShowing()) {
spinnerDialog.dismiss();
spinnerDialog = null;
}
}
});
}
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppStart" parent="android:Theme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/screen</item>
</style>
</resources>

View File

@@ -1,28 +0,0 @@
/*
* Copyright 2013 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module.exports = {
show: function (success, fail, args, env) {
var result = new PluginResult(args, env);
result.error("Not supported on platform", false);
},
hide: function (success, fail, args, env) {
var result = new PluginResult(args, env);
window.qnx.webplatform.getApplication().windowVisible = true;
result.ok(undefined, false);
}
};

View File

@@ -0,0 +1,170 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
// Default parameter values including image size can be changed in `config.xml`
var splashImageWidth = 170;
var splashImageHeight = 200;
var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
var localSplash; // the image to display
var localSplashImage;
var bgColor = "#464646";
var imageSrc = '/img/logo.png';
var splashScreenDelay = 3000; // in milliseconds
var showSplashScreen = true; // show splashcreen by default
var cordova = require('cordova');
var configHelper = cordova.require('cordova/confighelper');
var autoHideSplashScreen = true;
function updateImageLocation() {
position.width = Math.min(splashImageWidth, window.innerWidth);
position.height = position.width * (splashImageHeight / splashImageWidth);
localSplash.style.width = window.innerWidth + "px";
localSplash.style.height = window.innerHeight + "px";
localSplash.style.top = "0px";
localSplash.style.left = "0px";
localSplashImage.style.top = "50%";
localSplashImage.style.left = "50%";
localSplashImage.style.height = position.height + "px";
localSplashImage.style.width = position.width + "px";
localSplashImage.style.marginTop = (-position.height / 2) + "px";
localSplashImage.style.marginLeft = (-position.width / 2) + "px";
}
function onResize() {
updateImageLocation();
}
var SplashScreen = {
setBGColor: function (cssBGColor) {
bgColor = cssBGColor;
if (localSplash) {
localSplash.style.backgroundColor = bgColor;
}
},
show: function () {
if(!localSplash) {
window.addEventListener("resize", onResize, false);
localSplash = document.createElement("div");
localSplash.style.backgroundColor = bgColor;
localSplash.style.position = "absolute";
localSplash.style["z-index"] = "99999";
localSplashImage = document.createElement("img");
localSplashImage.src = imageSrc;
localSplashImage.style.position = "absolute";
updateImageLocation();
localSplash.appendChild(localSplashImage);
document.body.appendChild(localSplash);
// deviceready fires earlier than the plugin init on cold-start
if (SplashScreen.shouldHideImmediately) {
SplashScreen.shouldHideImmediately = false;
window.setTimeout(function () {
SplashScreen.hide();
}, 1000);
}
}
},
hide: function () {
if(localSplash) {
var innerLocalSplash = localSplash;
localSplash = null;
window.removeEventListener("resize", onResize, false);
innerLocalSplash.style.opacity = '0';
innerLocalSplash.style["-webkit-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-moz-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-ms-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-o-transition"] = "opacity 1s ease-in-out";
window.setTimeout(function () {
document.body.removeChild(innerLocalSplash);
innerLocalSplash = null;
}, 1000);
} else {
SplashScreen.shouldHideImmediately = true;
}
}
};
/**
* Reads preferences via ConfigHelper and substitutes default parameters.
*/
function readPreferencesFromCfg(cfg) {
try {
var value = cfg.getPreferenceValue('ShowSplashScreen');
if(typeof value != 'undefined') {
showSplashScreen = value === 'true';
}
splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
splashScreenDelay = parseInt(splashScreenDelay, 10);
imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
} catch(e) {
var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
console.error(msg);
}
}
/**
* Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
*/
function showAndHide() {
if(showSplashScreen) {
SplashScreen.show();
window.setTimeout(function() {
SplashScreen.hide();
}, splashScreenDelay);
}
}
/**
* Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
*/
(function initAndShow() {
configHelper.readConfig(function(config) {
readPreferencesFromCfg(config);
if (autoHideSplashScreen) {
showAndHide();
} else {
SplashScreen.show();
}
}, function(err) {
console.error(err);
});
})();
module.exports = SplashScreen;
require("cordova/exec/proxy").add("SplashScreen", SplashScreen);

View File

@@ -20,11 +20,24 @@
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
typedef struct {
BOOL iPhone;
BOOL iPad;
BOOL iPhone4;
BOOL iPhone5;
BOOL iPhone6;
BOOL iPhone6Plus;
BOOL retina;
BOOL iPhoneX;
} CDV_iOSDevice;
@interface CDVSplashScreen : CDVPlugin {
UIActivityIndicatorView* _activityView;
UIImageView* _imageView;
NSString* _curImageName;
BOOL _visible;
BOOL _destroyed;
}
- (void)show:(CDVInvokedUrlCommand*)command;

View File

@@ -18,14 +18,19 @@
*/
#import "CDVSplashScreen.h"
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVScreenOrientationDelegate.h>
#import "CDVViewController+SplashScreen.h"
#define kSplashScreenDurationDefault 3000.0f
#define kFadeDurationDefault 500.0f
#define kSplashScreenDurationDefault 0.25f
@implementation CDVSplashScreen
- (void)pluginInitialize
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:self.webView];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:nil];
[self setVisible:YES];
}
@@ -37,7 +42,7 @@
- (void)hide:(CDVInvokedUrlCommand*)command
{
[self setVisible:NO];
[self setVisible:NO andForce:YES];
}
- (void)pageDidLoad
@@ -65,14 +70,29 @@
* gray = UIActivityIndicatorViewStyleGray
*
*/
// Determine whether rotation should be enabled for this device
// Per iOS HIG, landscape is only supported on iPad and iPhone 6+
CDV_iOSDevice device = [self getCurrentDevice];
BOOL autorotateValue = (device.iPad || device.iPhone6Plus || device.iPhoneX) ?
[(CDVViewController *)self.viewController shouldAutorotateDefaultValue] :
NO;
[(CDVViewController *)self.viewController setEnabledAutorotation:autorotateValue];
NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]];
UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
if ([topActivityIndicator isEqualToString:@"whiteLarge"]) {
if ([topActivityIndicator isEqualToString:@"whiteLarge"])
{
topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge;
} else if ([topActivityIndicator isEqualToString:@"white"]) {
}
else if ([topActivityIndicator isEqualToString:@"white"])
{
topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite;
} else if ([topActivityIndicator isEqualToString:@"gray"]) {
}
else if ([topActivityIndicator isEqualToString:@"gray"])
{
topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
}
@@ -90,7 +110,8 @@
id showSplashScreenSpinnerValue = [self.commandDelegate.settings objectForKey:[@"ShowSplashScreenSpinner" lowercaseString]];
// backwards compatibility - if key is missing, default to true
if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue]) {
if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue])
{
[parentView addSubview:_activityView];
}
@@ -100,10 +121,20 @@
[parentView addObserver:self forKeyPath:@"bounds" options:0 context:nil];
[self updateImage];
_destroyed = NO;
}
- (void)hideViews
{
[_imageView setAlpha:0];
[_activityView setAlpha:0];
}
- (void)destroyViews
{
_destroyed = YES;
[(CDVViewController *)self.viewController setEnabledAutorotation:[(CDVViewController *)self.viewController shouldAutorotateDefaultValue]];
[_imageView removeFromSuperview];
[_activityView removeFromSuperview];
_imageView = nil;
@@ -111,119 +142,372 @@
_curImageName = nil;
self.viewController.view.userInteractionEnabled = YES; // re-enable user interaction upon completion
[self.viewController.view removeObserver:self forKeyPath:@"frame"];
[self.viewController.view removeObserver:self forKeyPath:@"bounds"];
@try {
[self.viewController.view removeObserver:self forKeyPath:@"frame"];
[self.viewController.view removeObserver:self forKeyPath:@"bounds"];
}
@catch (NSException *exception) {
// When reloading the page from a remotely connected Safari, there
// are no observers, so the removeObserver method throws an exception,
// that we can safely ignore.
// Alternatively we can check whether there are observers before calling removeObserver
}
}
- (CDV_iOSDevice) getCurrentDevice
{
CDV_iOSDevice device;
UIScreen* mainScreen = [UIScreen mainScreen];
CGFloat mainScreenHeight = mainScreen.bounds.size.height;
CGFloat mainScreenWidth = mainScreen.bounds.size.width;
int limit = MAX(mainScreenHeight,mainScreenWidth);
device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
device.retina = ([mainScreen scale] == 2.0);
device.iPhone4 = (device.iPhone && limit == 480.0);
device.iPhone5 = (device.iPhone && limit == 568.0);
// note these below is not a true device detect, for example if you are on an
// iPhone 6/6+ but the app is scaled it will prob set iPhone5 as true, but
// this is appropriate for detecting the runtime screen environment
device.iPhone6 = (device.iPhone && limit == 667.0);
device.iPhone6Plus = (device.iPhone && limit == 736.0);
device.iPhoneX = (device.iPhone && limit == 812.0);
return device;
}
- (BOOL) isUsingCDVLaunchScreen {
NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
if (launchStoryboardName) {
return ([launchStoryboardName isEqualToString:@"CDVLaunchScreen"]);
} else {
return NO;
}
}
- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device
{
// Use UILaunchImageFile if specified in plist. Otherwise, use Default.
NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
// detect if we are using CB-9762 Launch Storyboard; if so, return the associated image instead
if ([self isUsingCDVLaunchScreen]) {
imageName = @"LaunchStoryboard";
return imageName;
}
NSUInteger supportedOrientations = [orientationDelegate supportedInterfaceOrientations];
// Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape
BOOL supportsLandscape = (supportedOrientations & UIInterfaceOrientationMaskLandscape);
BOOL supportsPortrait = (supportedOrientations & UIInterfaceOrientationMaskPortrait || supportedOrientations & UIInterfaceOrientationMaskPortraitUpsideDown);
// this means there are no mixed orientations in there
BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape);
if (imageName)
{
imageName = [imageName stringByDeletingPathExtension];
}
else
{
imageName = @"Default";
}
// Add Asset Catalog specific prefixes
if ([imageName isEqualToString:@"LaunchImage"])
{
if (device.iPhone4 || device.iPhone5 || device.iPad) {
imageName = [imageName stringByAppendingString:@"-700"];
} else if(device.iPhone6) {
imageName = [imageName stringByAppendingString:@"-800"];
} else if(device.iPhone6Plus || device.iPhoneX ) {
if(device.iPhone6Plus) {
imageName = [imageName stringByAppendingString:@"-800"];
} else {
imageName = [imageName stringByAppendingString:@"-1100"];
}
if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
imageName = [imageName stringByAppendingString:@"-Portrait"];
}
}
}
if (device.iPhone5)
{ // does not support landscape
imageName = [imageName stringByAppendingString:@"-568h"];
}
else if (device.iPhone6)
{ // does not support landscape
imageName = [imageName stringByAppendingString:@"-667h"];
}
else if (device.iPhone6Plus || device.iPhoneX)
{ // supports landscape
if (isOrientationLocked)
{
imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"")];
}
else
{
switch (currentOrientation)
{
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
default:
break;
}
}
if (device.iPhoneX) {
imageName = [imageName stringByAppendingString:@"-2436h"];
} else {
imageName = [imageName stringByAppendingString:@"-736h"];
}
}
else if (device.iPad)
{ // supports landscape
if (isOrientationLocked)
{
imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")];
}
else
{
switch (currentOrientation)
{
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
}
return imageName;
}
- (UIInterfaceOrientation)getCurrentOrientation
{
UIInterfaceOrientation iOrientation = [UIApplication sharedApplication].statusBarOrientation;
UIDeviceOrientation dOrientation = [UIDevice currentDevice].orientation;
bool landscape;
if (dOrientation == UIDeviceOrientationUnknown || dOrientation == UIDeviceOrientationFaceUp || dOrientation == UIDeviceOrientationFaceDown) {
// If the device is laying down, use the UIInterfaceOrientation based on the status bar.
landscape = UIInterfaceOrientationIsLandscape(iOrientation);
} else {
// If the device is not laying down, use UIDeviceOrientation.
landscape = UIDeviceOrientationIsLandscape(dOrientation);
// There's a bug in iOS!!!! http://openradar.appspot.com/7216046
// So values needs to be reversed for landscape!
if (dOrientation == UIDeviceOrientationLandscapeLeft)
{
iOrientation = UIInterfaceOrientationLandscapeRight;
}
else if (dOrientation == UIDeviceOrientationLandscapeRight)
{
iOrientation = UIInterfaceOrientationLandscapeLeft;
}
else if (dOrientation == UIDeviceOrientationPortrait)
{
iOrientation = UIInterfaceOrientationPortrait;
}
else if (dOrientation == UIDeviceOrientationPortraitUpsideDown)
{
iOrientation = UIInterfaceOrientationPortraitUpsideDown;
}
}
return iOrientation;
}
// Sets the view's frame and image.
- (void)updateImage
{
UIInterfaceOrientation orientation = self.viewController.interfaceOrientation;
NSString* imageName = [self getImageName:[self getCurrentOrientation] delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]];
// Use UILaunchImageFile if specified in plist. Otherwise, use Default.
NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
if (imageName) {
imageName = [imageName stringByDeletingPathExtension];
} else {
imageName = @"Default";
}
if (CDV_IsIPhone5()) {
imageName = [imageName stringByAppendingString:@"-568h"];
} else if (CDV_IsIPad()) {
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
if (![imageName isEqualToString:_curImageName]) {
if (![imageName isEqualToString:_curImageName])
{
UIImage* img = [UIImage imageNamed:imageName];
_imageView.image = img;
_curImageName = imageName;
}
// Check that splash screen's image exists before updating bounds
if (_imageView.image) {
if (_imageView.image)
{
[self updateBounds];
} else {
}
else
{
NSLog(@"WARNING: The splashscreen image named %@ was not found", imageName);
}
}
- (void)updateBounds
{
if ([self isUsingCDVLaunchScreen]) {
// CB-9762's launch screen expects the image to fill the screen and be scaled using AspectFill.
CGSize viewportSize = [UIApplication sharedApplication].delegate.window.bounds.size;
_imageView.frame = CGRectMake(0, 0, viewportSize.width, viewportSize.height);
_imageView.contentMode = UIViewContentModeScaleAspectFill;
return;
}
UIImage* img = _imageView.image;
CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height);
CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero;
CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
CGAffineTransform imgTransform = CGAffineTransformIdentity;
/* If and only if an iPhone application is landscape-only as per
* UISupportedInterfaceOrientations, the view controller's orientation is
* landscape. In this case the image must be rotated in order to appear
* correctly.
*/
CDV_iOSDevice device = [self getCurrentDevice];
if (UIInterfaceOrientationIsLandscape(orientation) && !device.iPhone6Plus && !device.iPad && !device.iPhoneX)
{
imgTransform = CGAffineTransformMakeRotation(M_PI / 2);
imgBounds.size = CGSizeMake(imgBounds.size.height, imgBounds.size.width);
}
// There's a special case when the image is the size of the screen.
if (CGSizeEqualToSize(screenSize, imgBounds.size)) {
if (CGSizeEqualToSize(screenSize, imgBounds.size))
{
CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
imgBounds.origin.y -= statusFrame.size.height;
} else {
if (!(IsAtLeastiOSVersion(@"7.0")))
{
imgBounds.origin.y -= statusFrame.size.height;
}
}
else if (imgBounds.size.width > 0)
{
CGRect viewBounds = self.viewController.view.bounds;
CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
// This matches the behaviour of the native splash screen.
CGFloat ratio;
if (viewAspect > imgAspect) {
if (viewAspect > imgAspect)
{
ratio = viewBounds.size.width / imgBounds.size.width;
} else {
}
else
{
ratio = viewBounds.size.height / imgBounds.size.height;
}
imgBounds.size.height *= ratio;
imgBounds.size.width *= ratio;
}
_imageView.transform = imgTransform;
_imageView.frame = imgBounds;
}
- (void)setVisible:(BOOL)visible
{
if (visible == _visible) {
return;
}
_visible = visible;
[self setVisible:visible andForce:NO];
}
id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]];
id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]];
- (void)setVisible:(BOOL)visible andForce:(BOOL)force
{
if (visible != _visible || force)
{
_visible = visible;
float fadeDuration = fadeSplashScreenDuration == nil ? kSplashScreenDurationDefault : [fadeSplashScreenDuration floatValue];
id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]];
id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]];
if ((fadeSplashScreenValue == nil) || ![fadeSplashScreenValue boolValue]) {
fadeDuration = 0;
}
float fadeDuration = fadeSplashScreenDuration == nil ? kFadeDurationDefault : [fadeSplashScreenDuration floatValue];
// Never animate the showing of the splash screen.
if (visible) {
if (_imageView == nil) {
[self createViews];
}
} else if (fadeDuration == 0) {
[self destroyViews];
} else {
[UIView transitionWithView:self.viewController.view
duration:fadeDuration
options:UIViewAnimationOptionTransitionNone
animations:^(void) {
[_imageView setAlpha:0];
[_activityView setAlpha:0];
id splashDurationString = [self.commandDelegate.settings objectForKey: [@"SplashScreenDelay" lowercaseString]];
float splashDuration = splashDurationString == nil ? kSplashScreenDurationDefault : [splashDurationString floatValue];
id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]];
BOOL autoHideSplashScreen = true;
if (autoHideSplashScreenValue != nil) {
autoHideSplashScreen = [autoHideSplashScreenValue boolValue];
}
completion:^(BOOL finished) {
if (!autoHideSplashScreen) {
// CB-10412 SplashScreenDelay does not make sense if the splashscreen is hidden manually
splashDuration = 0;
}
if (fadeSplashScreenValue == nil)
{
fadeSplashScreenValue = @"true";
}
if (![fadeSplashScreenValue boolValue])
{
fadeDuration = 0;
}
else if (fadeDuration < 30)
{
// [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10
// they mean 10 seconds, and not the meaningless 10ms
fadeDuration *= 1000;
}
if (_visible)
{
if (_imageView == nil)
{
[self createViews];
}
}
else if (fadeDuration == 0 && splashDuration == 0)
{
[self destroyViews];
}];
}
else
{
__weak __typeof(self) weakSelf = self;
float effectiveSplashDuration;
// [CB-10562] AutoHideSplashScreen may be "true" but we should still be able to hide the splashscreen manually.
if (!autoHideSplashScreen || force) {
effectiveSplashDuration = (fadeDuration) / 1000;
} else {
effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) effectiveSplashDuration * NSEC_PER_SEC), dispatch_get_main_queue(), CFBridgingRelease(CFBridgingRetain(^(void) {
if (!_destroyed) {
[UIView transitionWithView:self.viewController.view
duration:(fadeDuration / 1000)
options:UIViewAnimationOptionTransitionNone
animations:^(void) {
[weakSelf hideViews];
}
completion:^(BOOL finished) {
// Always destroy views, otherwise you could have an
// invisible splashscreen that is overlayed over your active views
// which causes that no touch events are passed
if (!_destroyed) {
[weakSelf destroyViews];
// TODO: It might also be nice to have a js event happen here -jm
}
}
];
}
})));
}
}
}

View File

@@ -0,0 +1,28 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
#import <Cordova/CDVViewController.h>
@interface CDVViewController (SplashScreen)
@property (nonatomic, assign) BOOL enabledAutorotation;
@property (nonatomic, readonly) BOOL shouldAutorotateDefaultValue;
@end

View File

@@ -0,0 +1,89 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
#import "CDVViewController+SplashScreen.h"
#import <objc/runtime.h>
@implementation CDVViewController (SplashScreen)
@dynamic enabledAutorotation;
- (void)setEnabledAutorotation:(BOOL)value
{
objc_setAssociatedObject(self,
@selector(enabledAutorotation),
[NSNumber numberWithBool:value],
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (BOOL)enabledAutorotation
{
NSNumber *number = (NSNumber *)objc_getAssociatedObject(self, @selector(enabledAutorotation));
// Defaulting to YES to correspond parent CDVViewController behavior
if (number == nil)
{
return YES;
}
return [number boolValue];
}
+ (void)load
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class class = [self class];
SEL originalSelector = @selector(shouldAutorotate);
SEL swizzledSelector = @selector(splash_shouldAutorotate);
Method originalMethod = class_getInstanceMethod(class, originalSelector);
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
BOOL didAddMethod = class_addMethod(class,
originalSelector,
method_getImplementation(swizzledMethod),
method_getTypeEncoding(swizzledMethod));
if (didAddMethod) {
class_replaceMethod(class,
swizzledSelector,
method_getImplementation(originalMethod),
method_getTypeEncoding(originalMethod));
} else {
method_exchangeImplementations(originalMethod, swizzledMethod);
}
});
}
#pragma mark - Method Swizzling
- (BOOL)splash_shouldAutorotate
{
return self.enabledAutorotation;
}
- (BOOL)shouldAutorotateDefaultValue
{
return [self splash_shouldAutorotate];
}
@end

View File

@@ -0,0 +1,39 @@
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using Microsoft.Phone.Info;
using System;
using System.Windows;
namespace WPCordovaClassLib.Cordova.Commands
{
public enum Resolutions { WVGA, WXGA, HD };
public static class ResolutionHelper
{
public static Resolutions CurrentResolution
{
get
{
switch (Application.Current.Host.Content.ScaleFactor)
{
case 100: return Resolutions.WVGA;
case 160: return Resolutions.WXGA;
case 150: return Resolutions.HD;
}
throw new InvalidOperationException("Unknown resolution");
}
}
}
}

View File

@@ -1,10 +1,10 @@
/*
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,6 +26,11 @@ using Microsoft.Phone.Info;
using System.Windows.Controls.Primitives;
using System.Diagnostics;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
using System.IO;
using System.Xml.Linq;
using System.Linq;
using System.Windows.Threading;
namespace WPCordovaClassLib.Cordova.Commands
{
@@ -37,33 +42,214 @@ namespace WPCordovaClassLib.Cordova.Commands
{
private Popup popup;
// Time until we dismiss the splashscreen
private int prefDelay = 3000;
// Whether we hide it by default
private bool prefAutoHide = true;
// Path to image to use
private string prefImagePath = "SplashScreenImage.jpg";
// static because autodismiss is only ever applied once, at app launch
// subsequent page loads should not cause the SplashScreen to be shown.
private static bool WasShown = false;
public SplashScreen()
{
Image SplashScreen = new Image();
BitmapImage splash_image = new BitmapImage();
splash_image.SetSource(Application.GetResourceStream(new Uri(@"SplashScreenImage.jpg", UriKind.Relative)).Stream);
SplashScreen.Source = splash_image;
LoadConfigPrefs();
Image SplashScreen = new Image()
{
Height = Application.Current.Host.Content.ActualHeight,
Width = Application.Current.Host.Content.ActualWidth,
Stretch = Stretch.Fill
};
var imageResource = GetSplashScreenImageResource();
if (imageResource != null)
{
BitmapImage splash_image = new BitmapImage();
splash_image.SetSource(imageResource.Stream);
SplashScreen.Source = splash_image;
}
// Instansiate the popup and set the Child property of Popup to SplashScreen
this.popup = new Popup() {IsOpen = false, Child = SplashScreen };
// Orient the popup accordingly
this.popup.HorizontalAlignment = HorizontalAlignment.Stretch;
this.popup.VerticalAlignment = VerticalAlignment.Center;
popup = new Popup() { IsOpen = false,
Child = SplashScreen,
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Center
};
}
public void show(string options)
public override void OnInit()
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
// we only want to autoload on the first page load.
// but OnInit is called for every page load.
if (!SplashScreen.WasShown)
{
this.popup.IsOpen = true;
});
SplashScreen.WasShown = true;
show();
}
}
public void hide(string options)
private void LoadConfigPrefs()
{
StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("config.xml", UriKind.Relative));
if (streamInfo != null)
{
using (StreamReader sr = new StreamReader(streamInfo.Stream))
{
//This will Read Keys Collection for the xml file
XDocument configFile = XDocument.Parse(sr.ReadToEnd());
string configAutoHide = configFile.Descendants()
.Where(x => x.Name.LocalName == "preference")
.Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen")
.Select(x => (string)x.Attribute("value"))
.FirstOrDefault();
bool bVal;
prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide;
string configDelay = configFile.Descendants()
.Where(x => x.Name.LocalName == "preference")
.Where(x => (string)x.Attribute("name") == "SplashScreenDelay")
.Select(x => (string)x.Attribute("value"))
.FirstOrDefault();
int nVal;
prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay;
string configImage = configFile.Descendants()
.Where(x => x.Name.LocalName == "preference")
.Where(x => (string)x.Attribute("name") == "SplashScreen")
.Select(x => (string)x.Attribute("value"))
.FirstOrDefault();
if (!String.IsNullOrEmpty(configImage))
{
prefImagePath = configImage;
}
}
}
}
private StreamResourceInfo GetSplashScreenImageResource()
{
// Get the base filename for the splash screen images
string imageName = System.IO.Path.GetFileNameWithoutExtension(prefImagePath);
Uri imageUri = null;
StreamResourceInfo imageResource = null;
// First, try to get a resolution-specific splashscreen
try
{
// Determine the device's resolution
switch (ResolutionHelper.CurrentResolution)
{
case Resolutions.HD:
imageUri = new Uri(imageName + ".screen-720p.jpg", UriKind.Relative);
break;
case Resolutions.WVGA:
imageUri = new Uri(imageName + ".screen-WVGA.jpg", UriKind.Relative);
break;
case Resolutions.WXGA:
default:
imageUri = new Uri(imageName + ".screen-WXGA.jpg", UriKind.Relative);
break;
}
imageResource = Application.GetResourceStream(imageUri);
}
catch (Exception)
{
// It's OK if we didn't get a resolution-specific image
}
// Fallback to the default image name without decoration
if (imageResource == null)
{
imageUri = new Uri(prefImagePath, UriKind.Relative);
imageResource = Application.GetResourceStream(imageUri);
}
if (imageUri != null) Debug.WriteLine("INFO :: SplashScreen: using image {0}", imageUri.OriginalString);
return imageResource;
}
public void show(string options = null)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
this.popup.IsOpen = false;
if (!popup.IsOpen)
{
popup.Child.Opacity = 0;
Storyboard story = new Storyboard();
DoubleAnimation animation = new DoubleAnimation()
{
From = 0.0,
To = 1.0,
Duration = new Duration(TimeSpan.FromSeconds(0.2))
};
Storyboard.SetTarget(animation, popup.Child);
Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
story.Children.Add(animation);
story.Begin();
popup.IsOpen = true;
if (prefAutoHide)
{
StartAutoHideTimer();
}
}
});
}
public void hide(string options = null)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (popup.IsOpen)
{
popup.Child.Opacity = 1.0;
Storyboard story = new Storyboard();
DoubleAnimation animation = new DoubleAnimation()
{
From = 1.0,
To = 0.0,
Duration = new Duration(TimeSpan.FromSeconds(0.4))
};
Storyboard.SetTarget(animation, popup.Child);
Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
story.Children.Add(animation);
story.Completed += (object sender, EventArgs e) =>
{
popup.IsOpen = false;
};
story.Begin();
}
});
}
private void StartAutoHideTimer()
{
var timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(prefDelay) };
timer.Tick += (object sender, EventArgs e) =>
{
hide();
timer.Stop();
};
timer.Start();
}
}
}

70
test/cordova-incl.js vendored
View File

@@ -1,70 +0,0 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
var PLAT;
if (/Android/.exec(navigator.userAgent)) {
PLAT = 'android';
} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
PLAT = 'ios';
} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) {
PLAT = 'blackberry';
}
var scripts = document.getElementsByTagName('script');
var currentPath = scripts[scripts.length - 1].src;
var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js");
var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js");
var cordovaPath = normalCordovaPath;
if (PLAT) {
// XHR to local file is an error on some platforms, windowsphone for one
try {
var xhr = new XMLHttpRequest();
xhr.open("GET", platformCordovaPath, false);
xhr.onreadystatechange = function() {
if (this.readyState == this.DONE && this.responseText.length > 0) {
if(parseInt(this.status) >= 400){
cordovaPath = normalCordovaPath;
}else{
cordovaPath = platformCordovaPath;
}
}
};
xhr.send(null);
}
catch(e){
cordovaPath = normalCordovaPath;
} // access denied!
}
if (!window._doNotWriteCordovaScript) {
document.write('<script type="text/javascript" charset="utf-8" src="' + cordovaPath + '"></script>');
}
function backHome() {
if (window.device && device.platform && device.platform.toLowerCase() == 'android') {
navigator.app.backHistory();
}
else {
window.history.go(-1);
}
}

View File

@@ -1,65 +0,0 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Cordova Mobile Spec</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="cordova-incl.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
<body onload="init();" id="stage" class="theme">
<h1>Apache Cordova Tests</h1>
<div id="info">
<h4>Platform: <span id="platform"> </span></h4>
<h4>Version: <span id="version"> </span></h4>
<h4>UUID: <span id="uuid"> </span></h4>
<h4>Name: <span id="name"> </span></h4>
<h4>Model: <span id="model"> </span></h4>
<h4>Width: <span id="width"> </span>, Height: <span id="height">
</span>, Color Depth: <span id="colorDepth"></span></h4>
<h4>User-Agent: <span id="user-agent"> </span></h4>
</div>
<a href="autotest/index.html" class="btn large">Automatic Test</a>
<a href="accelerometer/index.html" class="btn large">Accelerometer</a>
<a href="audio/index.html" class="btn large">Audio Play/Record</a>
<a href="battery/index.html" class="btn large">Battery</a>
<a href="camera/index.html" class="btn large">Camera</a>
<a href="compass/index.html" class="btn large">Compass</a>
<a href="contacts/index.html" class="btn large">Contacts</a>
<a href="events/index.html" class="btn large">Events</a>
<a href="location/index.html" class="btn large">Location</a>
<a href="lazyloadjs/index.html" class="btn large">Lazy Loading of cordova-incl.js</a>
<a href="misc/index.html" class="btn large">Misc Content</a>
<a href="network/index.html" class="btn large">Network</a>
<a href="notification/index.html" class="btn large">Notification</a>
<a href="splashscreen/index.html" class="btn large">Splashscreen</a>
<a href="sql/index.html" class="btn large">Web SQL</a>
<a href="storage/index.html" class="btn large">Local Storage</a>
<a href="benchmarks/index.html" class="btn large">Benchmarks</a>
<a href="inappbrowser/index.html" class="btn large">In App Browser</a>
</body>
</html>

View File

@@ -1,163 +0,0 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
var deviceInfo = function() {
document.getElementById("platform").innerHTML = device.platform;
document.getElementById("version").innerHTML = device.version;
document.getElementById("uuid").innerHTML = device.uuid;
document.getElementById("name").innerHTML = device.name;
document.getElementById("model").innerHTML = device.model;
document.getElementById("width").innerHTML = screen.width;
document.getElementById("height").innerHTML = screen.height;
document.getElementById("colorDepth").innerHTML = screen.colorDepth;
};
var getLocation = function() {
var suc = function(p) {
alert(p.coords.latitude + " " + p.coords.longitude);
};
var locFail = function() {
};
navigator.geolocation.getCurrentPosition(suc, locFail);
};
var beep = function() {
navigator.notification.beep(2);
};
var vibrate = function() {
navigator.notification.vibrate(0);
};
function roundNumber(num) {
var dec = 3;
var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
return result;
}
var accelerationWatch = null;
function updateAcceleration(a) {
document.getElementById('x').innerHTML = roundNumber(a.x);
document.getElementById('y').innerHTML = roundNumber(a.y);
document.getElementById('z').innerHTML = roundNumber(a.z);
}
var toggleAccel = function() {
if (accelerationWatch !== null) {
navigator.accelerometer.clearWatch(accelerationWatch);
updateAcceleration({
x : "",
y : "",
z : ""
});
accelerationWatch = null;
} else {
var options = {};
options.frequency = 1000;
accelerationWatch = navigator.accelerometer.watchAcceleration(
updateAcceleration, function(ex) {
alert("accel fail (" + ex.name + ": " + ex.message + ")");
}, options);
}
};
var preventBehavior = function(e) {
e.preventDefault();
};
function dump_pic(data) {
var viewport = document.getElementById('viewport');
console.log(data);
viewport.style.display = "";
viewport.style.position = "absolute";
viewport.style.top = "10px";
viewport.style.left = "10px";
document.getElementById("test_img").src = "data:image/jpeg;base64," + data;
}
function fail(msg) {
alert(msg);
}
function show_pic() {
navigator.camera.getPicture(dump_pic, fail, {
quality : 50
});
}
function close() {
var viewport = document.getElementById('viewport');
viewport.style.position = "relative";
viewport.style.display = "none";
}
// This is just to do this.
function readFile() {
navigator.file.read('/sdcard/cordova.txt', fail, fail);
}
function writeFile() {
navigator.file.write('foo.txt', "This is a test of writing to a file",
fail, fail);
}
function contacts_success(contacts) {
alert(contacts.length
+ ' contacts returned.'
+ (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted)
: ''));
}
function get_contacts() {
var obj = new ContactFindOptions();
obj.filter = "";
obj.multiple = true;
obj.limit = 5;
navigator.service.contacts.find(
[ "displayName", "name" ], contacts_success,
fail, obj);
}
var networkReachableCallback = function(reachability) {
// There is no consistency on the format of reachability
var networkState = reachability.code || reachability;
var currentState = {};
currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection';
currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection';
currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection';
confirm("Connection type:\n" + currentState[networkState]);
};
function check_network() {
navigator.network.isReachable("www.mobiledevelopersolutions.com",
networkReachableCallback, {});
}
function init() {
// the next line makes it impossible to see Contacts on the HTC Evo since it
// doesn't have a scroll button
// document.addEventListener("touchmove", preventBehavior, false);
document.addEventListener("deviceready", deviceInfo, true);
document.getElementById("user-agent").textContent = navigator.userAgent;
}

View File

@@ -1,164 +0,0 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
body {
background:#222 none repeat scroll 0 0;
color:#666;
font-family:Helvetica;
font-size:72%;
line-height:1.5em;
margin:0;
border-top:1px solid #393939;
}
#info{
background:#ffa;
border: 1px solid #ffd324;
-webkit-border-radius: 5px;
border-radius: 5px;
clear:both;
margin:15px 6px 0;
min-width:295px;
max-width:97%;
padding:4px 0px 2px 10px;
word-wrap:break-word;
margin-bottom:10px;
display:inline-block;
min-height: 160px;
max-height: 300px;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#info > h4{
font-size:.95em;
margin:5px 0;
}
#stage.theme{
padding-top:3px;
}
/* Definition List */
#stage.theme > dl{
padding-top:10px;
clear:both;
margin:0;
list-style-type:none;
padding-left:10px;
overflow:auto;
}
#stage.theme > dl > dt{
font-weight:bold;
float:left;
margin-left:5px;
}
#stage.theme > dl > dd{
width:45px;
float:left;
color:#a87;
font-weight:bold;
}
/* Content Styling */
#stage.theme > h1, #stage.theme > h2, #stage.theme > p{
margin:1em 0 .5em 13px;
}
#stage.theme > h1{
color:#eee;
font-size:1.6em;
text-align:center;
margin:0;
margin-top:15px;
padding:0;
}
#stage.theme > h2{
clear:both;
margin:0;
padding:3px;
font-size:1em;
text-align:center;
}
/* Stage Buttons */
#stage.theme .btn{
border: 1px solid #555;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align:center;
display:inline-block;
background:#444;
width:150px;
color:#9ab;
font-size:1.1em;
text-decoration:none;
padding:1.2em 0;
margin:3px 0px 3px 5px;
}
#stage.theme .large{
width:308px;
padding:1.2em 0;
}
#stage.theme .wide{
width:100%;
padding:1.2em 0;
}
#stage.theme .backBtn{
border: 1px solid #555;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align:center;
display:block;
float:right;
background:#666;
width:75px;
color:#9ab;
font-size:1.1em;
text-decoration:none;
padding:1.2em 0;
margin:3px 5px 3px 5px;
}
#stage.theme .input{
border: 1px solid #555;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align:center;
display:block;
float:light;
background:#888;
color:#9cd;
font-size:1.1em;
text-decoration:none;
padding:1.2em 0;
margin:3px 0px 3px 5px;
}
#stage.theme .numeric{
width:100%;
}

View File

@@ -1,48 +0,0 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta name="viewport" content="width=device-width,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
<title>Cordova Mobile Spec</title>
<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
<script type="text/javascript" charset="utf-8">
function showFor(duration) {
navigator.splashscreen.show();
window.setTimeout(function() {
navigator.splashscreen.hide();
}, 1000 * duration);
}
</script>
</head>
<body id="stage" class="theme">
<h1>Splashscreen</h1>
<h2>Action</h2>
<div class="btn large" onclick="showFor(1)">Show for 1 second</div>
<div class="btn large" onclick="showFor(5)">Show for 5 seconds</div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "container:CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string>
<key>IDESourceControlProjectName</key>
<string>CDVSplashScreenTest</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
<string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
<key>IDESourceControlWCCName</key>
<string>cordova-plugin-splashscreen</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1 @@
build

View File

@@ -0,0 +1,702 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <Cordova/CDVScreenOrientationDelegate.h>
#import "CDVSplashScreen.h"
#import "ImageNameTestDelegates.h"
const CDV_iOSDevice CDV_iOSDeviceZero = { 0, 0, 0, 0, 0, 0 };
@interface ImageNameTest : XCTestCase
@property (nonatomic, strong) CDVSplashScreen* plugin;
@end
@interface CDVSplashScreen ()
// expose private interface
- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device;
@end
@implementation ImageNameTest
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
self.plugin = [[CDVSplashScreen alloc] init];
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void) orientationHelper:(id<CDVScreenOrientationDelegate>)delegate expectedImageNameDictionary:(NSDictionary*)expectedImageNameDictionary device:(CDV_iOSDevice)device{
NSString* name = nil;
NSString* expectedImageName = nil;
UIInterfaceOrientation currentOrientation;
NSString* deviceName = device.iPad? @"iPad" : device.iPhone6Plus? @"iPhone6Plus": device.iPhone6? @"iPhone6": device.iPhone5? @"iPhone5" : @"iPhone";
// LandscapeLeft, should always return expectedImageName
currentOrientation = UIInterfaceOrientationLandscapeLeft;
name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeLeft"];
XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name);
// LandscapeRight - should always return expectedImageName
currentOrientation = UIInterfaceOrientationLandscapeRight;
name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeRight"];
XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name);
// Portrait - should always return expectedImageName
currentOrientation = UIInterfaceOrientationPortrait;
name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
expectedImageName = [expectedImageNameDictionary objectForKey:@"portrait"];
XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name);
// PortraitUpsideDown - should always return expectedImageName
currentOrientation = UIInterfaceOrientationPortraitUpsideDown;
name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
expectedImageName = [expectedImageNameDictionary objectForKey:@"portraitUpsideDown"];
XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name);
}
- (void)testiPadOrientation {
CDV_iOSDevice device = CDV_iOSDeviceZero;
device.iPad = YES;
// One orientation
PortraitOnly* delegate = [[PortraitOnly alloc] init];
[self orientationHelper:delegate expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Portrait",
@"landscapeRight" : @"Default-Portrait",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
[self orientationHelper:delegate2 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Portrait",
@"landscapeRight" : @"Default-Portrait",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
[self orientationHelper:delegate3 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Landscape",
@"portraitUpsideDown" : @"Default-Landscape"
}
device:device];
LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
[self orientationHelper:delegate4 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Landscape",
@"portraitUpsideDown" : @"Default-Landscape"
}
device:device];
// All Portrait
AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
[self orientationHelper:delegate5 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Portrait",
@"landscapeRight" : @"Default-Portrait",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
// All Landscape
AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
[self orientationHelper:delegate6 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Landscape",
@"portraitUpsideDown" : @"Default-Landscape"
}
device:device];
// All orientations
AllOrientations* delegate7 = [[AllOrientations alloc] init];
[self orientationHelper:delegate7 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
// Portrait and Landscape Left
PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate8 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
// Portrait and Landscape Right
PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate9 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
// PortraitUpsideDown and Landscape Left
PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate10 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
// PortraitUpsideDown and Landscape Right
PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate11 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape",
@"landscapeRight" : @"Default-Landscape",
@"portrait" : @"Default-Portrait",
@"portraitUpsideDown" : @"Default-Portrait"
}
device:device];
}
- (void)testiPhoneOrientation {
CDV_iOSDevice device = CDV_iOSDeviceZero;
device.iPhone = YES;
// One orientation
PortraitOnly* delegate = [[PortraitOnly alloc] init];
[self orientationHelper:delegate expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
[self orientationHelper:delegate2 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
[self orientationHelper:delegate3 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
[self orientationHelper:delegate4 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// All Portrait
AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
[self orientationHelper:delegate5 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// All Landscape
AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
[self orientationHelper:delegate6 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// All orientations
AllOrientations* delegate7 = [[AllOrientations alloc] init];
[self orientationHelper:delegate7 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// Portrait and Landscape Left
PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate8 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// Portrait and Landscape Right
PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate9 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// PortraitUpsideDown and Landscape Left
PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate10 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
// PortraitUpsideDown and Landscape Right
PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate11 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default",
@"landscapeRight" : @"Default",
@"portrait" : @"Default",
@"portraitUpsideDown" : @"Default"
}
device:device];
}
- (void)testiPhone5Orientation {
CDV_iOSDevice device = CDV_iOSDeviceZero;
device.iPhone = YES;
device.iPhone5 = YES;
// One orientation
PortraitOnly* delegate = [[PortraitOnly alloc] init];
[self orientationHelper:delegate expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
[self orientationHelper:delegate2 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
[self orientationHelper:delegate3 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
[self orientationHelper:delegate4 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// All Portrait
AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
[self orientationHelper:delegate5 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// All Landscape
AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
[self orientationHelper:delegate6 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// All orientations
AllOrientations* delegate7 = [[AllOrientations alloc] init];
[self orientationHelper:delegate7 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// Portrait and Landscape Left
PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate8 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// Portrait and Landscape Right
PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate9 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// PortraitUpsideDown and Landscape Left
PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate10 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
// PortraitUpsideDown and Landscape Right
PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate11 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-568h",
@"landscapeRight" : @"Default-568h",
@"portrait" : @"Default-568h",
@"portraitUpsideDown" : @"Default-568h"
}
device:device];
}
- (void)testiPhone6Orientation {
CDV_iOSDevice device = CDV_iOSDeviceZero;
device.iPhone = YES;
device.iPhone6 = YES;
// One orientation
PortraitOnly* delegate = [[PortraitOnly alloc] init];
[self orientationHelper:delegate expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
[self orientationHelper:delegate2 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
[self orientationHelper:delegate3 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
[self orientationHelper:delegate4 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// All Portrait
AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
[self orientationHelper:delegate5 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// All Landscape
AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
[self orientationHelper:delegate6 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// All orientations
AllOrientations* delegate7 = [[AllOrientations alloc] init];
[self orientationHelper:delegate7 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// Portrait and Landscape Left
PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate8 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// Portrait and Landscape Right
PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate9 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// PortraitUpsideDown and Landscape Left
PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate10 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
// PortraitUpsideDown and Landscape Right
PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate11 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-667h",
@"landscapeRight" : @"Default-667h",
@"portrait" : @"Default-667h",
@"portraitUpsideDown" : @"Default-667h"
}
device:device];
}
- (void)testiPhone6PlusOrientation {
CDV_iOSDevice device = CDV_iOSDeviceZero;
device.iPhone = YES;
device.iPhone6Plus = YES;
// One orientation
PortraitOnly* delegate = [[PortraitOnly alloc] init];
[self orientationHelper:delegate expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-736h",
@"landscapeRight" : @"Default-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
[self orientationHelper:delegate2 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-736h",
@"landscapeRight" : @"Default-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
[self orientationHelper:delegate3 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-Landscape-736h",
@"portraitUpsideDown" : @"Default-Landscape-736h"
}
device:device];
LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
[self orientationHelper:delegate4 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-Landscape-736h",
@"portraitUpsideDown" : @"Default-Landscape-736h"
}
device:device];
// All Portrait
AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
[self orientationHelper:delegate5 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-736h",
@"landscapeRight" : @"Default-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
// All Landscape
AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
[self orientationHelper:delegate6 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-Landscape-736h",
@"portraitUpsideDown" : @"Default-Landscape-736h"
}
device:device];
// All orientations
AllOrientations* delegate7 = [[AllOrientations alloc] init];
[self orientationHelper:delegate7 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
// Portrait and Landscape Left
PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate8 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
// Portrait and Landscape Right
PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate9 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
// PortraitUpsideDown and Landscape Left
PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
[self orientationHelper:delegate10 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
// PortraitUpsideDown and Landscape Right
PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
[self orientationHelper:delegate11 expectedImageNameDictionary:@{
@"landscapeLeft" : @"Default-Landscape-736h",
@"landscapeRight" : @"Default-Landscape-736h",
@"portrait" : @"Default-736h",
@"portraitUpsideDown" : @"Default-736h"
}
device:device];
}
@end

View File

@@ -0,0 +1,57 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
#import <Foundation/Foundation.h>
#import <Cordova/CDVScreenOrientationDelegate.h>
@interface PortraitOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface PortraitUpsideDownOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface AllPortraitOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface LandscapeLeftOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface LandscapeRightOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface AllLandscapeOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface AllOrientations : NSObject <CDVScreenOrientationDelegate>
@end
@interface PortraitAndLandscapeLeftOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface PortraitAndLandscapeRightOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface PortraitUpsideDownAndLandscapeLeftOnly : NSObject <CDVScreenOrientationDelegate>
@end
@interface PortraitUpsideDownAndLandscapeRightOnly : NSObject <CDVScreenOrientationDelegate>
@end

View File

@@ -0,0 +1,200 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
#import <UIKit/UIKit.h>
#import "ImageNameTestDelegates.h"
@implementation PortraitOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation PortraitUpsideDownOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation AllPortraitOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation LandscapeLeftOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation LandscapeRightOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation AllLandscapeOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation AllOrientations
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation PortraitAndLandscapeLeftOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation PortraitAndLandscapeRightOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation PortraitUpsideDownAndLandscapeLeftOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
@implementation PortraitUpsideDownAndLandscapeRightOnly
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -0,0 +1,505 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */; };
7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* ImageNameTest.m */; };
7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; };
7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; };
7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */; };
7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */; };
7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 68A32D7114102E1C006B237C;
remoteInfo = CordovaLib;
};
7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7E9F519419DA102000DA31AC;
remoteInfo = CDVSplashScreenLib;
};
7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = CordovaLib;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
7E9F519319DA102000DA31AC /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = "<group>"; };
7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVSplashScreenLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVSplashScreenLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = ../../../src/ios/CDVSplashScreen.m; sourceTree = SOURCE_ROOT; };
7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = ../../../src/ios/CDVSplashScreen.h; sourceTree = SOURCE_ROOT; };
7E9F51B019DA114400DA31AC /* ImageNameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTest.m; sourceTree = "<group>"; };
7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageNameTestDelegates.h; sourceTree = "<group>"; };
7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTestDelegates.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7E9F519219DA102000DA31AC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
7E9F519C19DA102000DA31AC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */,
7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */,
7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */,
7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7E9F517119DA09CE00DA31AC = {
isa = PBXGroup;
children = (
7E9F51B419DA127E00DA31AC /* UIKit.framework */,
7E9F51B219DA116500DA31AC /* Foundation.framework */,
7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */,
7E9F519619DA102000DA31AC /* CDVSplashScreenLib */,
7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */,
7E9F517D19DA0A0A00DA31AC /* Products */,
);
sourceTree = "<group>";
};
7E9F517D19DA0A0A00DA31AC /* Products */ = {
isa = PBXGroup;
children = (
7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */,
7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
7E9F518C19DA0F8300DA31AC /* Products */ = {
isa = PBXGroup;
children = (
7E9F519019DA0F8300DA31AC /* libCordova.a */,
);
name = Products;
sourceTree = "<group>";
};
7E9F519619DA102000DA31AC /* CDVSplashScreenLib */ = {
isa = PBXGroup;
children = (
7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */,
7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */,
);
path = CDVSplashScreenLib;
sourceTree = SOURCE_ROOT;
};
7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */ = {
isa = PBXGroup;
children = (
7E9F51A119DA102000DA31AC /* Supporting Files */,
7E9F51B019DA114400DA31AC /* ImageNameTest.m */,
7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */,
7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */,
);
path = CDVSplashScreenLibTests;
sourceTree = "<group>";
};
7E9F51A119DA102000DA31AC /* Supporting Files */ = {
isa = PBXGroup;
children = (
7E9F51A219DA102000DA31AC /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7E9F519419DA102000DA31AC /* CDVSplashScreenLib */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */;
buildPhases = (
7E9F519119DA102000DA31AC /* Sources */,
7E9F519219DA102000DA31AC /* Frameworks */,
7E9F519319DA102000DA31AC /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = CDVSplashScreenLib;
productName = CDVSplashScreenLib;
productReference = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */;
productType = "com.apple.product-type.library.static";
};
7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */;
buildPhases = (
7E9F519B19DA102000DA31AC /* Sources */,
7E9F519C19DA102000DA31AC /* Frameworks */,
7E9F519D19DA102000DA31AC /* Resources */,
);
buildRules = (
);
dependencies = (
7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */,
7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */,
);
name = CDVSplashScreenLibTests;
productName = CDVSplashScreenLibTests;
productReference = 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7E9F517219DA09CE00DA31AC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
TargetAttributes = {
7E9F519419DA102000DA31AC = {
CreatedOnToolsVersion = 6.0;
};
7E9F519E19DA102000DA31AC = {
CreatedOnToolsVersion = 6.0;
};
};
};
buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 7E9F517119DA09CE00DA31AC;
productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */;
ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
},
);
projectRoot = "";
targets = (
7E9F519419DA102000DA31AC /* CDVSplashScreenLib */,
7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
7E9F519019DA0F8300DA31AC /* libCordova.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libCordova.a;
remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
7E9F519D19DA102000DA31AC /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7E9F519119DA102000DA31AC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7E9F519B19DA102000DA31AC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */,
7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */;
targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */;
};
7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = CordovaLib;
targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
7E9F517619DA09CE00DA31AC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
7E9F517719DA09CE00DA31AC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
7E9F51A419DA102000DA31AC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
"\"$(OBJROOT)/UninstalledProducts/include\"",
"\"$(BUILT_PRODUCTS_DIR)\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Debug;
};
7E9F51A519DA102000DA31AC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
"\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
7E9F51A719DA102000DA31AC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
};
name = Debug;
};
7E9F51A819DA102000DA31AC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E9F517619DA09CE00DA31AC /* Debug */,
7E9F517719DA09CE00DA31AC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E9F51A419DA102000DA31AC /* Debug */,
7E9F51A519DA102000DA31AC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E9F51A719DA102000DA31AC /* Debug */,
7E9F51A819DA102000DA31AC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7E9F517219DA09CE00DA31AC /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:CDVSplashScreenTest.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string>
<key>IDESourceControlProjectName</key>
<string>CDVSplashScreenTest</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
<string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
<key>IDESourceControlWCCName</key>
<string>cordova-plugin-splashscreen</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519419DA102000DA31AC"
BuildableName = "libCDVSplashScreenLib.a"
BlueprintName = "CDVSplashScreenLib"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519419DA102000DA31AC"
BuildableName = "libCDVSplashScreenLib.a"
BlueprintName = "CDVSplashScreenLib"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519419DA102000DA31AC"
BuildableName = "libCDVSplashScreenLib.a"
BlueprintName = "CDVSplashScreenLib"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
BuildableName = "CDVSplashScreenLibTests.xctest"
BlueprintName = "CDVSplashScreenLibTests"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
BuildableName = "CDVSplashScreenLibTests.xctest"
BlueprintName = "CDVSplashScreenLibTests"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
BuildableName = "CDVSplashScreenLibTests.xctest"
BlueprintName = "CDVSplashScreenLibTests"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
BuildableName = "CDVSplashScreenLibTests.xctest"
BlueprintName = "CDVSplashScreenLibTests"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
BuildableName = "CDVSplashScreenLibTests.xctest"
BlueprintName = "CDVSplashScreenLibTests"
ReferencedContainer = "container:CDVSplashScreenTest.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

40
tests/ios/README.md Normal file
View File

@@ -0,0 +1,40 @@
<!--
# license: Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-->
# iOS Tests for CDVSplashScreen
You need to install `node.js` to pull in `cordova-ios`.
First install cordova-ios:
npm install
... in the current folder.
# Testing from Xcode
1. Launch the `CDVSplashScreenTest.xcworkspace` file.
2. Choose "CDVSplashScreenLibTests" from the scheme drop-down menu
3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests
# Testing from the command line
npm test

13
tests/ios/package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "cordova-plugin-splashscreen-test-ios",
"version": "1.0.0",
"description": "iOS Unit Tests for Splashscreen Plugin",
"author": "Apache Software Foundation",
"license": "Apache Version 2.0",
"dependencies": {
"cordova-ios": "*"
},
"scripts": {
"test": "xcodebuild test -workspace CDVSplashScreenTest.xcworkspace -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp' HEADER_SEARCH_PATHS='$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include'"
}
}

14
tests/package.json Normal file
View File

@@ -0,0 +1,14 @@
{
"name": "cordova-plugin-splashscreen-tests",
"version": "5.0.4-dev",
"description": "",
"cordova": {
"id": "cordova-plugin-splashscreen-tests",
"platforms": []
},
"keywords": [
"ecosystem:cordova"
],
"author": "",
"license": "Apache 2.0"
}

29
tests/plugin.xml Normal file
View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-splashscreen-tests"
version="5.0.4-dev">
<name>Cordova Splashscreen Plugin Tests</name>
<license>Apache 2.0</license>
<js-module src="tests.js" name="tests">
</js-module>
</plugin>

64
tests/tests.js Normal file
View File

@@ -0,0 +1,64 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
/* jshint jasmine: true */
exports.defineAutoTests = function () {
describe('Splashscreen (cordova)', function () {
it("splashscreen.spec.1 should exist", function () {
expect(navigator.splashscreen).toBeDefined();
});
it("splashscreen.spec.2 show method should exist", function () {
expect(navigator.splashscreen.show).toBeDefined();
expect(typeof navigator.splashscreen.show).toBe('function');
});
it("splashscreen.spec.3 hide method should exist", function () {
expect(navigator.splashscreen.hide).toBeDefined();
expect(typeof navigator.splashscreen.hide).toBe('function');
});
});
};
exports.defineManualTests = function (contentEl, createActionButton) {
function showFor(duration) {
navigator.splashscreen.show();
window.setTimeout(function () {
navigator.splashscreen.hide();
}, 1000 * duration);
}
contentEl.innerHTML = '<h1>Splashscreen Tests</h1>' +
'<h3>Note for WP: AutoHideSplashScreen must be set to false in config.xml</h3>' +
'<div id="show1"></div>' +
'Expected result: Will show the Cordova splashscreen for 1 second' +
'</p> <div id="show5"></div>' +
'Expected result: Will show the Cordova splashscreen for 5 seconds';
createActionButton('Show for 1 second', function () {
showFor(1);
}, 'show1');
createActionButton('Show for 5 seconds', function () {
showFor(5);
}, 'show5');
};

17
types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
// Type definitions for Apache Cordova Splashscreen plugin
// Project: https://github.com/apache/cordova-plugin-splashscreen
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies Inc
// Licensed under the MIT license.
interface Navigator {
/** This plugin displays and hides a splash screen during application launch. */
splashscreen: {
/** Dismiss the splash screen. */
hide(): void;
/** Displays the splash screen. */
show(): void;
}
}

View File

@@ -0,0 +1,37 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
/*jslint sloppy:true */
var splash = require('cordova/splashscreen');
var SplashScreen = {
show: function () {
splash.show();
},
hide: function () {
splash.hide();
}
};
module.exports = SplashScreen;
require("cordova/exec/proxy").add("SplashScreen", SplashScreen);

View File

@@ -1,104 +0,0 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
/*global Windows:true */
var cordova = require('cordova'),
channel = require('cordova/channel');
/* This is the actual implementation part that returns the result on Windows 8
*/
var position = { x: 0, y: 0, width: 0, height: 0 }; // defined by evt.detail.splashScreen.imageLocation
var splash = null; //
var localSplash; // the image to display
var localSplashImage;
var bgColor = "#464646";
function onResize(evt) {
if (splash) {
position = splash.imageLocation;
updateImageLocation();
}
}
function updateImageLocation() {
localSplash.style.width = window.innerWidth + "px";
localSplash.style.height = window.innerHeight + "px";
localSplash.style.top = "0px";
localSplash.style.left = "0px";
localSplashImage.style.top = position.y + "px";
localSplashImage.style.left = position.x + "px";
localSplashImage.style.height = position.height + "px";
localSplashImage.style.width = position.width + "px";
}
var SplashScreen = {
setBGColor:function(cssBGColor) {
bgColor = cssBGColor;
if (localSplash) {
localSplash.style.backgroundColor = bgColor;
}
},
show:function(){
window.addEventListener("resize", onResize, false);
localSplash = document.createElement("div");
localSplash.style.backgroundColor = bgColor;;
localSplash.style.position = "absolute";
var img = localSplashImage = document.createElement("img");
img.src = "img/splashscreen.png";
img.style.position = "absolute";
updateImageLocation();
localSplash.appendChild(localSplashImage);
document.body.appendChild(localSplash);
},
hide:function(){
window.removeEventListener("resize", onResize, false);
document.body.removeChild(localSplash);
localSplash = null;
}
}
module.exports = SplashScreen;
function activated(evt) {
if (evt.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
splash = evt.detail.splashScreen;
position = evt.detail.splashScreen.imageLocation;
SplashScreen.show();
}
}
channel.onCordovaReady.subscribe(function (evt) {
document.addEventListener("DOMContentLoaded", function (evt) {
WinJS.Application.addEventListener("activated", activated, false);
}, false);
});
require("cordova/commandProxy").add("SplashScreen",SplashScreen);