mirror of
https://github.com/apache/cordova-plugin-splashscreen.git
synced 2026-02-05 00:01:30 +08:00
Compare commits
245 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bc7d0d63f | ||
|
|
ed1db6650c | ||
|
|
ed30498177 | ||
|
|
06a76567b9 | ||
|
|
35c41091d1 | ||
|
|
46acbadd70 | ||
|
|
054387e02a | ||
|
|
a7706fef58 | ||
|
|
be85a1b14e | ||
|
|
7936e7ea54 | ||
|
|
0934d126d2 | ||
|
|
e44f9d1f1f | ||
|
|
5339fcf377 | ||
|
|
49769ba2d4 | ||
|
|
6800de23b1 | ||
|
|
76bec98b94 | ||
|
|
61e353f549 | ||
|
|
4d8cd6f2fe | ||
|
|
8490496c0b | ||
|
|
95f91bf50c | ||
|
|
e78f1d10b1 | ||
|
|
8ba8f41637 | ||
|
|
91a8210890 | ||
|
|
c95a26ab34 | ||
|
|
d96c08e00b | ||
|
|
09e1f06fb0 | ||
|
|
f9c88b8ab8 | ||
|
|
9a6ff27008 | ||
|
|
cadc68f75b | ||
|
|
be8be330ac | ||
|
|
4ffaaa2952 | ||
|
|
b5e0c786c5 | ||
|
|
5197c664c3 | ||
|
|
fb606fec6a | ||
|
|
57b553a68e | ||
|
|
031afc5056 | ||
|
|
36bf91c9e8 | ||
|
|
a606af98ca | ||
|
|
2ae821c4a8 | ||
|
|
36c43827bb | ||
|
|
326f13220e | ||
|
|
5f41762722 | ||
|
|
5ca43e8c5d | ||
|
|
278c5d8168 | ||
|
|
7cb318727b | ||
|
|
c2c3a980e1 | ||
|
|
1a4b51fbc8 | ||
|
|
0b75c1faa0 | ||
|
|
09e95a2628 | ||
|
|
3180758a4e | ||
|
|
50a55883d3 | ||
|
|
833dc7f783 | ||
|
|
e443871785 | ||
|
|
fcef678a7f | ||
|
|
e5c6772f17 | ||
|
|
7c0ab0fa51 | ||
|
|
7735ae0598 | ||
|
|
b0e1157c8a | ||
|
|
a18cc8241a | ||
|
|
bf9607e27f | ||
|
|
87d29ad6d3 | ||
|
|
2db7bac571 | ||
|
|
d6db9f3459 | ||
|
|
be635a36c1 | ||
|
|
d63786d33b | ||
|
|
98f83fea5a | ||
|
|
c81df6f274 | ||
|
|
ffda2e81b9 | ||
|
|
e0cf396835 | ||
|
|
7f140e0176 | ||
|
|
85aa605a12 | ||
|
|
7c687957f8 | ||
|
|
13849c3d20 | ||
|
|
90ba3dfc5b | ||
|
|
b1ceb532f8 | ||
|
|
1185561549 | ||
|
|
894d164191 | ||
|
|
caa5534c0d | ||
|
|
a922ce0453 | ||
|
|
6195d6741b | ||
|
|
0f2a069588 | ||
|
|
782939f7ef | ||
|
|
04667e04c0 | ||
|
|
de28cf89bf | ||
|
|
770c264d2c | ||
|
|
5a1ade6114 | ||
|
|
62509f6b47 | ||
|
|
2eb78b3724 | ||
|
|
6e43615e25 | ||
|
|
ac39b04b6f | ||
|
|
66f7ee34d1 | ||
|
|
41ca5809b1 | ||
|
|
0a8b5be3d1 | ||
|
|
d65c0c7cc5 | ||
|
|
4102589bd5 | ||
|
|
1eac08c558 | ||
|
|
80b01049c8 | ||
|
|
4adff6f1c9 | ||
|
|
3d924fce1b | ||
|
|
6a737203da | ||
|
|
acb45f3a38 | ||
|
|
8d66b9e353 | ||
|
|
edb6c3d6f8 | ||
|
|
14061d1999 | ||
|
|
6863886d74 | ||
|
|
9832d2e165 | ||
|
|
bea0a4e408 | ||
|
|
41d9ae94ff | ||
|
|
9ca15db91a | ||
|
|
f8311aaca8 | ||
|
|
abbb07e5ee | ||
|
|
2012ba9ab6 | ||
|
|
e877722bac | ||
|
|
617ad81090 | ||
|
|
03ea0a4e80 | ||
|
|
850159490c | ||
|
|
5ea854d8c3 | ||
|
|
e401a4de0f | ||
|
|
2e1ec32916 | ||
|
|
4bc552848f | ||
|
|
5af0016c67 | ||
|
|
617960ee3e | ||
|
|
109c82b29b | ||
|
|
799b0a1737 | ||
|
|
5b3c2c8b14 | ||
|
|
7a12204ba9 | ||
|
|
eada9a6ac1 | ||
|
|
12dcd57d51 | ||
|
|
0f4a9d3f18 | ||
|
|
50318213c4 | ||
|
|
34bc1dbf16 | ||
|
|
3b2e9e5912 | ||
|
|
d7841c7ec9 | ||
|
|
1e67606c60 | ||
|
|
fa3b665223 | ||
|
|
875ccbf5bc | ||
|
|
ccb3c2f453 | ||
|
|
cfc6d74506 | ||
|
|
78d8ef94eb | ||
|
|
e2239306d6 | ||
|
|
ea3f7f7b07 | ||
|
|
d348168e08 | ||
|
|
848bd487e0 | ||
|
|
d034ceee6e | ||
|
|
93aaf0529e | ||
|
|
60fb0621ae | ||
|
|
7eec7c8b43 | ||
|
|
3a79663680 | ||
|
|
b83392df21 | ||
|
|
2b5187b909 | ||
|
|
fb0764c528 | ||
|
|
9a69f12ada | ||
|
|
9bd0ec7091 | ||
|
|
f675376de1 | ||
|
|
9ea2d4c86f | ||
|
|
5aff6590f8 | ||
|
|
f4a92d21ff | ||
|
|
0916db61b4 | ||
|
|
ac23964ac6 | ||
|
|
57ad3602f4 | ||
|
|
4b1df233ae | ||
|
|
c4ba138de5 | ||
|
|
805bcf505d | ||
|
|
fa29a85fcb | ||
|
|
ab26925e25 | ||
|
|
ed00c63d2d | ||
|
|
52c025bbef | ||
|
|
87f3c3a3ac | ||
|
|
6cc3d1f3fe | ||
|
|
b7750760f4 | ||
|
|
00e8999eeb | ||
|
|
9549ce3a9d | ||
|
|
62e92afae8 | ||
|
|
fa60f01adc | ||
|
|
d23ea4e011 | ||
|
|
0a46c4cbbb | ||
|
|
a510cd21ec | ||
|
|
76bf7655a0 | ||
|
|
9575c92db6 | ||
|
|
a9ac114130 | ||
|
|
48def1443a | ||
|
|
559b300d29 | ||
|
|
35272415d3 | ||
|
|
dd9c88204c | ||
|
|
5dc26d7e65 | ||
|
|
1c41959288 | ||
|
|
43e9c75345 | ||
|
|
9b3f750085 | ||
|
|
ba6730e594 | ||
|
|
89c23fad03 | ||
|
|
1d89a2aa1b | ||
|
|
0ff8d52081 | ||
|
|
bb65993a51 | ||
|
|
6ce8a32865 | ||
|
|
5afde1c62f | ||
|
|
6b1e72c631 | ||
|
|
98edfeb73e | ||
|
|
688b138e31 | ||
|
|
8bc540e454 | ||
|
|
4430cfce6b | ||
|
|
c1d4ca8d83 | ||
|
|
bcbc23958f | ||
|
|
b232cd7447 | ||
|
|
a9f0faa499 | ||
|
|
c3a5867c81 | ||
|
|
e86a9cc7a4 | ||
|
|
ddec7008cb | ||
|
|
e320e2504a | ||
|
|
e593fe3f53 | ||
|
|
50e4887aa1 | ||
|
|
f67216d64a | ||
|
|
67e8b9f01d | ||
|
|
29ac24ff9d | ||
|
|
3947f8570a | ||
|
|
d2e62a551c | ||
|
|
c67622f1b9 | ||
|
|
2f37eed184 | ||
|
|
887f0f6c81 | ||
|
|
8804977c84 | ||
|
|
b46cdca795 | ||
|
|
1009019372 | ||
|
|
129830a76c | ||
|
|
24e6f2e0dd | ||
|
|
21f372acc9 | ||
|
|
4d548e67c2 | ||
|
|
55722de1c4 | ||
|
|
0ffe1c2d46 | ||
|
|
95f407ea0d | ||
|
|
99803ba7c6 | ||
|
|
6b87577801 | ||
|
|
d0614c532b | ||
|
|
483182f33a | ||
|
|
d85c6a9359 | ||
|
|
fcd628ffc9 | ||
|
|
e1f17d6665 | ||
|
|
ec7c6aac30 | ||
|
|
0b001fb209 | ||
|
|
e4d8b77027 | ||
|
|
0f63861e88 | ||
|
|
e364377d4f | ||
|
|
395302ee16 | ||
|
|
333b0e7f90 | ||
|
|
be8d340f31 | ||
|
|
f833c39ed3 | ||
|
|
8eb2533e78 |
32
.appveyor.yml
Normal file
32
.appveyor.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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:
|
||||
matrix:
|
||||
- nodejs_version: "10"
|
||||
- nodejs_version: "12"
|
||||
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- 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\windows-10-store --plugin . --justBuild
|
||||
22
.asf.yaml
Normal file
22
.asf.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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.
|
||||
|
||||
notifications:
|
||||
commits: commits@cordova.apache.org
|
||||
issues: issues@cordova.apache.org
|
||||
pullrequests_status: issues@cordova.apache.org
|
||||
pullrequests_comment: issues@cordova.apache.org
|
||||
42
.github/ISSUE_TEMPLATE.md
vendored
Normal file
42
.github/ISSUE_TEMPLATE.md
vendored
Normal 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
50
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal 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
|
||||
29
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal 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?
|
||||
-->
|
||||
|
||||
|
||||
27
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
Normal 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
35
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal 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
9
.gitignore
vendored
@@ -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
1
.jshintignore
Normal file
@@ -0,0 +1 @@
|
||||
tests/ios
|
||||
16
.jshintrc
Normal file
16
.jshintrc
Normal 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
|
||||
}
|
||||
}
|
||||
3
.npmignore
Normal file
3
.npmignore
Normal file
@@ -0,0 +1,3 @@
|
||||
.*
|
||||
appveyor.yml
|
||||
tests
|
||||
124
.travis.yml
Normal file
124
.travis.yml
Normal file
@@ -0,0 +1,124 @@
|
||||
# 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=12
|
||||
- ANDROID_API_LEVEL=28
|
||||
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||
|
||||
language: node_js
|
||||
node_js: 12
|
||||
|
||||
# yaml anchor/alias: https://medium.com/@tommyvn/travis-yml-dry-with-anchors-8b6a3ac1b027
|
||||
|
||||
_ios: &_ios
|
||||
os: osx
|
||||
osx_image: xcode10.3
|
||||
|
||||
_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
|
||||
@@ -25,13 +25,13 @@ 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).
|
||||
|
||||
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.
|
||||
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
|
||||
- Run the tests so your patch doesn't break existing functionality.
|
||||
|
||||
We look forward to your contributions!
|
||||
|
||||
|
||||
564
README.md
564
README.md
@@ -1,22 +1,548 @@
|
||||
<!---
|
||||
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.
|
||||
---
|
||||
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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|AppVeyor|Travis CI|
|
||||
|:-:|:-:|
|
||||
|[](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-splashscreen)|[](https://travis-ci.org/apache/cordova-plugin-splashscreen)|
|
||||
|
||||
Plugin documentation: [doc/index.md](doc/index.md)
|
||||
# cordova-plugin-splashscreen
|
||||
|
||||
This plugin displays and hides a splash screen while your web application is launching. Using its methods you can also show and hide the splash screen manually.
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Supported Platforms](#supported-platforms)
|
||||
- [Platform Splash Screen Image Configuration](#platform-splash-screen-image-configuration)
|
||||
* [Example Configuration](#example-configuration)
|
||||
* [iOS-specific Information](#ios-specific-information)
|
||||
* [Windows-specific Information](#windows-specific-information)
|
||||
- [Preferences](#preferences)
|
||||
* [config.xml](#configxml)
|
||||
* [Quirks](#quirks)
|
||||
+ [Android Quirks](#android-quirks)
|
||||
+ [Browser Quirks](#browser-quirks)
|
||||
+ [iOS Quirks](#ios-quirks)
|
||||
+ [Windows Quirks](#windows-quirks)
|
||||
- [Methods](#methods)
|
||||
* [splashscreen.hide](#splashscreenhide)
|
||||
* [splashscreen.show](#splashscreenshow)
|
||||
|
||||
## Installation
|
||||
|
||||
// npm hosted (new) id
|
||||
cordova plugin add cordova-plugin-splashscreen
|
||||
|
||||
// you may also install directly from this repo
|
||||
cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
- Android
|
||||
- iOS
|
||||
- Windows (`cordova-windows` version >= 4.4.0 is required)
|
||||
__Note__: Extended splashscreen does not require the plugin on Windows (as opposed to Android and iOS) in case you don't use the plugin API, i.e. programmatic hide/show.
|
||||
- Browser
|
||||
|
||||
## Platform Splash Screen Image Configuration
|
||||
|
||||
### Example Configuration
|
||||
|
||||
In the top-level `config.xml` file (not the one in `platforms`), add configuration elements like those specified here.
|
||||
|
||||
The value of the "src" attribute is relative to the project root directory and NOT to the `www` directory (see `Directory structure` below). You can name the source image file whatever you like. The internal name in the application is automatically determined by Cordova.
|
||||
|
||||
Directory structure:
|
||||
|
||||
```
|
||||
projectRoot
|
||||
hooks
|
||||
platforms
|
||||
plugins
|
||||
www
|
||||
css
|
||||
img
|
||||
js
|
||||
res
|
||||
screen
|
||||
android
|
||||
ios
|
||||
windows
|
||||
```
|
||||
|
||||
```xml
|
||||
<platform name="android">
|
||||
<!-- you can use any density that exists in the Android project -->
|
||||
<splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi" />
|
||||
<splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi" />
|
||||
<splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi" />
|
||||
<splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi" />
|
||||
<splash src="res/screen/android/splash-land-xxhdpi.png" density="land-xxhdpi" />
|
||||
<splash src="res/screen/android/splash-land-xxxhdpi.png" density="land-xxxhdpi" />
|
||||
|
||||
<splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi" />
|
||||
<splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi" />
|
||||
<splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi" />
|
||||
<splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi" />
|
||||
<splash src="res/screen/android/splash-port-xxhdpi.png" density="port-xxhdpi" />
|
||||
<splash src="res/screen/android/splash-port-xxxhdpi.png" density="port-xxxhdpi" />
|
||||
</platform>
|
||||
|
||||
<platform name="ios">
|
||||
<!-- There are two mechanisms for showing launch images.
|
||||
-- Legacy method (supports all devices except iPad Pro 12.9):
|
||||
-- Note: Images are determined by width and height. The following are supported -->
|
||||
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
|
||||
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
|
||||
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
|
||||
<splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
|
||||
<splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
|
||||
<splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
|
||||
<splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
|
||||
<splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/>
|
||||
<splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
|
||||
<splash src="res/screen/ios/Default-Landscape-736h.png" width="2208" height="1242"/>
|
||||
<!-- Storyboard method (supports all devices):
|
||||
-- Important: If you use the storyboard method, legacy images are
|
||||
-- copied but ignored.
|
||||
-- Note: images are determined by scale, idiom, and size traits. The following
|
||||
-- are suggested based on current device form factors -->
|
||||
<splash src="res/screen/ios/Default@2x~universal~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~universal~comany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~universal~comcom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~anycom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~comany.png" />
|
||||
|
||||
</platform>
|
||||
|
||||
<!-- Configuration using MRT concept (Recommended, see "Windows-specific information" section for details): -->
|
||||
<platform name="windows">
|
||||
<splash src="res/screen/windows/splashscreen.png" target="SplashScreen"/>
|
||||
<splash src="res/screen/windows/splashscreenphone.png" target="SplashScreenPhone"/>
|
||||
</platform>
|
||||
|
||||
<!-- Configuration using image size: -->
|
||||
<!--<platform name="windows">
|
||||
<splash src="res/screen/windows/splashscreen.png" width="620" height="300"/>
|
||||
<splash src="res/screen/windows/splashscreenphone.png" width="1152" height="1920"/>
|
||||
</platform>-->
|
||||
|
||||
<preference name="SplashScreenDelay" value="10000" />
|
||||
```
|
||||
|
||||
### iOS-specific Information
|
||||
|
||||
There are two mechanisms for displaying a launch screen on iOS:
|
||||
|
||||
1. Legacy launch images: images are sized exactly for the device's screen size. Does not support the iPad Pro 12.9's native resolution or split-screen/slide-over multitasking.
|
||||
|
||||
2. Launch storyboard images: Images are sized based on scale, idiom, and size classes. Supports all devices, and can be used with split-screen/slide-over multitasking.
|
||||
|
||||
Apple is moving away from legacy launch images. There is no official support for providing a native-resolution launch image for the iPad Pro 12.9 or for providing launch images that work with split-screen multitasking or slide-over. If your app doesn't need to support these contexts, then you can continue to use legacy launch images for as long as you like.
|
||||
|
||||
The preferred method of providing launch images is to use a launch storyboard. For native app developers, the ideal launch storyboard is an unpopulated version of the app's user interface at launch. For non-native app developers who don't wish to learn Interface Builder, however, this plugin simulates the legacy launch image method as much as is feasible.
|
||||
|
||||
**Note:** Since iOS 11, for iPhone X devices and greater (with notch screen), you should switch to the new storyboard splash screens, taking into account to add `viewport-fit=cover` to the viewport meta tag in your `index.html` file to display the app correctly like so: `<meta name="viewport" content="user-scalable=no, initial-scale=1, width=device-width, viewport-fit=cover">` and make some modification to your app style by adding: `padding: env(safe-area-inset-top)` to your `index.css` file to avoid the unsafe areas behind notches in the screen.
|
||||
|
||||
#### Legacy launch images
|
||||
|
||||
If you choose to use legacy launch images, you will use the following syntax in `config.xml`:
|
||||
|
||||
```
|
||||
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
|
||||
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
|
||||
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
|
||||
<splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
|
||||
<splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
|
||||
<splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
|
||||
<splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
|
||||
<splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/>
|
||||
<splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
|
||||
```
|
||||
|
||||
Technically the filename for the `src` attribute can be anything you want; the filenames are used because they match what will be used when your project is compiled. The width and height attributes determine which launch images are displayed on which devices as follows:
|
||||
|
||||
| width | height | device (orientation) |
|
||||
|:-----------:|:------------:|:--------------------------------:|
|
||||
| 320 | 480 | All non-retina iPhones and iPods |
|
||||
| 640 | 960 | iPhone 4/4s (portrait) |
|
||||
| 640 | 1136 | iPhone 5/5s/SE (portrait) |
|
||||
| 750 | 1334 | iPhone 6/6s/7 (portrait) |
|
||||
| 1242 | 2208 | iPhone 6+/6s+/7+ (portrait) |
|
||||
| 2208 | 1242 | iPhone 6+/6s+/7+ (landscape) |
|
||||
| 768 | 1024 | All non-retina iPads (portrait) |
|
||||
| 1024 | 768 | All non-retina iPads (landscape) |
|
||||
| 1536 | 2048 | All retina iPads (portrait) |
|
||||
| 2048 | 1536 | All retina iPads (landscape) |
|
||||
|
||||
Note: It is vitally important that the source image actually matches the size specified in the `width` and `height` attributes. If it does not, the device may fail to render it properly, if at all.
|
||||
|
||||
#### Launch storyboard images
|
||||
|
||||
In order to support newer form factors and split-screen/slide-over multitasking, you should use launch storyboard images. These are similar to the legacy launch images above, but there are crucial differences:
|
||||
|
||||
- images are not specific to a given device.
|
||||
|
||||
- images are scaled to fill the available viewport (while maintaining the aspect ratio).
|
||||
|
||||
- the outer edges of the images will be cropped, and the amount will vary based on device an viewport.
|
||||
|
||||
- there is no need to provide an image for each possible device, viewport, and orientation; iOS will choose the best image for the situation automatically.
|
||||
|
||||
##### Designing launch storyboard images
|
||||
|
||||
The key to designing a launch storyboard image is understanding that the edges of the image will almost certainly be cropped. Therefore, one should not place any important information near the edges of any images provided to the launch storyboard. Only the center is a safe area, and this all but guarantees that following Apple's advice of presenting an unpopulated user interface will not work well.
|
||||
|
||||
Instead, the following tips should enable you to create a launch image that works across a multitude of form factors, viewports, and orientations:
|
||||
|
||||
- Important graphics (logos, icons, titles) should be centered. The safe bounding region will vary, so you will need to test to ensure that the important graphics are never cropped. Better yet, don't supply any important graphics in the first place.
|
||||
|
||||
- You _can_ fine-tune the placement and size of these graphics, but you don't have the same fine-grained control as you did with legacy launch images.
|
||||
|
||||
- Use a simple color wash. If you use two colors, you'll want one color to fill the top half of the image, and the second to fill the bottom half. If you use a gradient, you'll probably want to ensure that the middle of the gradient lines up with the center of the image.
|
||||
|
||||
- Don't worry about pixel perfection -- because the images are scaled, there's almost no chance the images will be perfectly fit to the pixel grid. Since all supported iOS devices use retina screens, users will be hard pressed to notice it anyway.
|
||||
|
||||
It is important to understand the concept of scale, idiom, and size class traits in order to use launch storyboard images effectively. Of the images supplied to the launch storyboard, iOS will choose the image that best matches the device and viewport and render that image. It is possible to supply only one launch image if so desired, but it is also possible to fine-tune the displayed launch image based on traits. When fine-tuning, one can ignore traits that aren't targeted or supported by the app.
|
||||
|
||||
> Note: If you are using launch storyboard images, there is no need to include legacy images. If you do, the legacy images will be copied, but not used.
|
||||
|
||||
##### Scale
|
||||
|
||||
| scale | devices |
|
||||
|:-----------:|:----------------------:|
|
||||
| 1x | All non-retina devices |
|
||||
| 2x | Most retina devices |
|
||||
| 3x | iPhone 6+/6s+,7s+ |
|
||||
|
||||
In general, you'll want to supply 2x and 3x images. Cordova only supports retina devices now, so there's no point in supplying 1x images.
|
||||
|
||||
##### Idioms
|
||||
|
||||
| idiom | devices |
|
||||
|:-----------:|:-------------:|
|
||||
| ipad | All iPads |
|
||||
| iphone | All iPhones and iPod Touches |
|
||||
| universal | All devices |
|
||||
|
||||
You only need to provide universal images unless you need to fine-tune for a specific device idiom.
|
||||
|
||||
##### Size classes
|
||||
|
||||
There are two size classes applies to both screen axes. Narrow viewports are considered to be the "compact" size class, and remaining viewports are considered "regular". When supplying images to Xcode, however, one must choose between "any & compact" and "any & regular". To stay consistent with the native terminology, this feature will match based on "any" and "compact". `any` will match regular-sized viewports.
|
||||
|
||||
Note: this feature uses `com` as an abbreviation for "compact" classes.
|
||||
|
||||
The following classes are supported by this feature:
|
||||
|
||||
| width | height | orientation |
|
||||
|:-----------:|:------------:|:-----------------:|
|
||||
| any | any | any |
|
||||
| com | any | portrait |
|
||||
| any | com | landscape (wide) |
|
||||
| com | com | landscape (narrow)|
|
||||
|
||||
To see the complete list of size classes associated with devices and viewports, see <http://www.sizeclasses.com>.
|
||||
|
||||
##### Single-image launch screen
|
||||
|
||||
If your launch image is simple, you may be able to avoid creating a lot of different launch images and supply only one. The launch image needs to meet the following requirements:
|
||||
|
||||
- the image should be square
|
||||
|
||||
- the image should be large enough to fit on an iPad Pro 12.9": 2732x2732
|
||||
|
||||
- anything important should fit within the center
|
||||
|
||||
Keep in mind that the image will be cropped, possibly quite severely, depending upon the viewport.
|
||||
|
||||
Once the image is created, you can include it in your project by adding the following to `config.xml`:
|
||||
|
||||
```
|
||||
<splash src="res/screen/ios/Default@2x~universal~anyany.png" />
|
||||
```
|
||||
|
||||
Because only one image is provided, iOS will utilize it in every context.
|
||||
|
||||
##### Multi-image launch screen
|
||||
|
||||
If a single launch image won't meet your needs, you will probably need to supply at least six images, if not more. Furthermore, keep in mind that it will not be possible to fine tune the image to a specific device, but only to a device class, display factor, and viewport size.
|
||||
|
||||
If you don't need to target images to a specific idiom, you should create six images, as follows:
|
||||
|
||||
| scale | idiom | width | height | size | filename |
|
||||
|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:|
|
||||
| 2x* | universal | any | any | 2732x2732 | `Default@2x~universal~anyany.png` |
|
||||
| 2x | universal | com | any | 1278x2732 | `Default@2x~universal~comany.png` |
|
||||
| 2x | universal | com | com | 1334x750 | `Default@2x~universal~comcom.png` |
|
||||
| 3x* | universal | any | any | 2208x2208 | `Default@3x~universal~anyany.png` |
|
||||
| 3x | universal | any | com | 2208x1242 | `Default@3x~universal~anycom.png` |
|
||||
| 3x | universal | com | any | 1242x2208 | `Default@3x~universal~comany.png` |
|
||||
|
||||
\* this image is required in order for iOS utilize the other images within this scale and idiom.
|
||||
|
||||
> Note: If the 3x sizes look small too you, that's because there's only one device class that currently has a 3x density: the iPhone 6+/6s+/7+.
|
||||
|
||||
The above looks like the following snippet when present in `config.xml`:
|
||||
|
||||
```
|
||||
<splash src="res/screen/ios/Default@2x~universal~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~universal~comany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~universal~comcom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~anycom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~universal~comany.png" />
|
||||
```
|
||||
|
||||
Should one need to further fine tune based upon device idiom, one can do so. This might look like so:
|
||||
|
||||
| scale | idiom | width | height | size | filename |
|
||||
|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:|
|
||||
| 2x* | iphone | any | any | 1334x1334 | `Default@2x~iphone~anyany.png` |
|
||||
| 2x | iphone | com | any | 750x1334 | `Default@2x~iphone~comany.png` |
|
||||
| 2x | iphone | com | com | 1334x750 | `Default@2x~iphone~comcom.png` |
|
||||
| 3x* | iphone | any | any | 2208x2208 | `Default@3x~iphone~anyany.png` |
|
||||
| 3x | iphone | any | com | 2208x1242 | `Default@3x~iphone~anycom.png` |
|
||||
| 3x | iphone | com | any | 1242x2208 | `Default@3x~iphone~comany.png` |
|
||||
| 2x* | ipad | any | any | 2732x2732 | `Default@2x~ipad~anyany.png` |
|
||||
| 2x | ipad | com | any | 1278x2732 | `Default@2x~ipad~comany.png` |
|
||||
|
||||
\* this image is required in order for iOS utilize the other images within this scale and idiom.
|
||||
|
||||
The above looks like the following in `config.xml`:
|
||||
|
||||
```
|
||||
<splash src="res/screen/ios/Default@2x~iphone~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~iphone~comany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~iphone~comcom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~iphone~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@3x~iphone~anycom.png" />
|
||||
<splash src="res/screen/ios/Default@3x~iphone~comany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~ipad~anyany.png" />
|
||||
<splash src="res/screen/ios/Default@2x~ipad~comany.png" />
|
||||
```
|
||||
|
||||
##### Quirks and Known Issues
|
||||
|
||||
1. **App on target may not reflect changes to images**
|
||||
Once you run the app on a target, iOS caches the launch image. Unfortunately, when you change the image, iOS does _not_ invalidate the cache, which means you'll still see the old launch image. You should either: delete the app, or reset content & settings (simulator).
|
||||
|
||||
2. **Simulator may not show expected images when launched from CLI**
|
||||
When Xcode deploys to a specific simulator, it only copies the assets that match the simulator's characteristics. For example, if you try to run an app on the iPhone 6s Plus simulator, only @3x launch images are copied. When compiling from the CLI, however, the default is to assume an iPhone 5s, which means only @2x launch images are copied. Unless your launch images are markedly different, chances are good the difference would go unnoticed, but this does mean that the only accurate method of testing is to test on a physical device.
|
||||
|
||||
3. **`anyany` must be provided for other variations to be used**
|
||||
If you don't provide an `anyany` version of the launch image for a specific scale and idiom, the other variations (like `anycom`, `comany`, and `comcom`) will ignored.
|
||||
|
||||
### Windows-specific Information
|
||||
|
||||
Splash screen images can be defined using the [MRT](https://cordova.apache.org/docs/en/dev/config_ref/images.html#windows) concept.
|
||||
If you specify `src="res/windows/splashscreen.png"` the following files will be copied into the application's images folder:
|
||||
`res/windows/splashscreen.png` | `res/windows/splashscreen.scale-100.png`, `res/windows/splashscreen.scale-125.png`, etc.
|
||||
|
||||
The following are supported:
|
||||
|
||||
| Scale, % | Project | Width | Height | Filename |
|
||||
|:------------:|:-------------------:|:-----------:|:------------:|:---------------------------------:|
|
||||
| 100 | Windows 10/8.1 | 620 | 300 | `splashscreen.png` \| `splashscreen.scale-100.png` |
|
||||
| 125 | Windows 10 | 775 | 375 | `splashscreen.scale-125.png` |
|
||||
| 150 | Windows 10 | 930 | 450 | `splashscreen.scale-150.png` |
|
||||
| 200 | Windows 10 | 1240 | 600 | `splashscreen.scale-200.png` |
|
||||
| 400 | Windows 10 | 2480 | 1200 | `splashscreen.scale-400.png` |
|
||||
| 140 | Windows 8.1 | 868 | 420 | `splashscreen.scale-140.png` |
|
||||
| 180 | Windows 8.1 | 1116 | 540 | `splashscreen.scale-180.png` |
|
||||
| 100 | Windows Phone 8.1 | 480 | 800 | `splashscreenphone.png` \| `splashscreenphone.scale-100.png` |
|
||||
| 140 | Windows Phone 8.1 | 672 | 1120 | `splashscreenphone.scale-140.png` |
|
||||
| 240 | Windows Phone 8.1 | 1152 | 1920 | `splashscreenphone.scale-240.png` |
|
||||
|
||||
__Note__: SplashScreens size for Windows 10 project should not exceed 200 KBytes.
|
||||
__Note__: Supported formats are `.png`, `.jpg`, `.jpeg`. Mixing of the extensions within a target is not supported. I.e. you can have `splashscreen.jpg` and `splashscreenphone.png` but not `splashscreen.scale-100.png`, `splashscreen.scale-400.jpg`.
|
||||
__Note__: You may need to reopen Visual Studio solution after changing the images and doing a `cordova prepare` for the changes to take effect.
|
||||
|
||||
## Preferences
|
||||
|
||||
### config.xml
|
||||
|
||||
- `AutoHideSplashScreen` (boolean, default to `true`). Indicates whether to hide splash screen automatically or not. The splash screen is hidden after the amount of time specified in the `SplashScreenDelay` preference.
|
||||
|
||||
```xml
|
||||
<preference name="AutoHideSplashScreen" value="true" />
|
||||
```
|
||||
|
||||
- `SplashScreenDelay` (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen.
|
||||
|
||||
```xml
|
||||
<preference name="SplashScreenDelay" value="3000" />
|
||||
```
|
||||
|
||||
This value used to be in seconds (but is now milliseconds) so values less than 30 will continue to be treated as seconds. (Consider this a deprecated patch that will disapear in some future version.)
|
||||
|
||||
To disable the splashscreen add the following preference to `config.xml`:
|
||||
```xml
|
||||
<preference name="SplashScreenDelay" value="0"/>
|
||||
```
|
||||
|
||||
**Windows Quirk**: You should disable the splashscreen in case you are updating the entire document body dynamically (f.e. with a SPA router) to avoid affecting UI/controls.
|
||||
Note that you should also directly reference `WinJS/base.js` in the page HTML in this case to avoid the issues with activation context ([CB-11658](https://issues.apache.org/jira/browse/CB-11658)).
|
||||
|
||||
**iOS Quirk**: to disable the splashscreen on `ios` platform you should also add `<preference name="FadeSplashScreenDuration" value="0"/>` to `config.xml`.
|
||||
|
||||
- `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to
|
||||
prevent the splash screen from fading in and out when its display
|
||||
state changes.
|
||||
|
||||
```xml
|
||||
<preference name="FadeSplashScreen" value="false"/>
|
||||
```
|
||||
|
||||
- `FadeSplashScreenDuration` (float, defaults to `500`): Specifies the
|
||||
number of milliseconds for the splash screen fade effect to execute.
|
||||
|
||||
```xml
|
||||
<preference name="FadeSplashScreenDuration" value="750"/>
|
||||
```
|
||||
|
||||
_Note_: `FadeSplashScreenDuration` is included into `SplashScreenDelay`, for example if you have `<preference name="SplashScreenDelay" value="3000" />` and `<preference name="FadeSplashScreenDuration" value="1000"/>` defined in `config.xml`:
|
||||
|
||||
- 00:00 - splashscreen is shown
|
||||
- 00:02 - fading has started
|
||||
- 00:03 - splashscreen is hidden
|
||||
|
||||
Turning the fading off via `<preference name="FadeSplashScreen" value="false"/>` technically means fading duration to be `0` so that in this example the overall splash screen delay will still be 3 seconds.
|
||||
|
||||
_Note_: This only applies to the application startup - you need to take the fading timeout into account when manually showing/hiding the splash screen in your application's code:
|
||||
|
||||
```javascript
|
||||
navigator.splashscreen.show();
|
||||
window.setTimeout(function () {
|
||||
navigator.splashscreen.hide();
|
||||
}, splashDuration - fadeDuration);
|
||||
```
|
||||
|
||||
- `ShowSplashScreenSpinner` (boolean, defaults to `true`): Set to `false`
|
||||
to hide the splash screen spinner.
|
||||
|
||||
```xml
|
||||
<preference name="ShowSplashScreenSpinner" value="false"/>
|
||||
```
|
||||
|
||||
_Note_: Does not work on Browser or Windows platforms.
|
||||
|
||||
### Quirks
|
||||
|
||||
#### Android Quirks
|
||||
|
||||
In your `config.xml`, you can add the following preferences:
|
||||
|
||||
```xml
|
||||
<preference name="SplashMaintainAspectRatio" value="true|false" />
|
||||
<preference name="SplashShowOnlyFirstTime" value="true|false" />
|
||||
<preference name="SplashScreenSpinnerColor" value="white" />
|
||||
```
|
||||
|
||||
`SplashMaintainAspectRatio` preference is optional. If set to `true`, the splash screen drawable is not stretched to fit the full screen, but instead simply "covers" the screen, like CSS "background-size:cover". This is very useful when splash screen images cannot be distorted in any way, for example when they contain scenery or text. This setting works best with images that have large margins (safe areas) that can be safely cropped on screens with different aspect ratios.
|
||||
|
||||
The splash screen plugin reloads the splash screen whenever the orientation changes so that you can specify different splash screen images for portrait and landscape orientations.
|
||||
|
||||
`SplashShowOnlyFirstTime` preference is optional and defaults to `true`. When set to `true` the splash screen will only appear on application launch. However, if you plan to use `navigator.app.exitApp()` to close the application and force the splash screen appear on the application's next launch, you should set this property to `false` (this also applies to closing the application with the Back button).
|
||||
|
||||
`SplashScreenSpinnerColor` preference is also optional and is ignored when not set. Setting it to a valid color name or HEX color code will change the color of the spinner on Android 5.0+ devices.
|
||||
|
||||
#### Browser Quirks
|
||||
|
||||
You can use the following preferences in your `config.xml`:
|
||||
|
||||
```xml
|
||||
<platform name="browser">
|
||||
<preference name="SplashScreen" value="/images/browser/splashscreen.jpg" /> <!-- defaults to "/img/logo.png" -->
|
||||
<preference name="AutoHideSplashScreen" value="true" /> <!-- defaults to "true" -->
|
||||
<preference name="SplashScreenDelay" value="3000" /> <!-- defaults to "3000" -->
|
||||
<preference name="SplashScreenBackgroundColor" value="green" /> <!-- defaults to "#464646" -->
|
||||
<preference name="ShowSplashScreen" value="false" /> <!-- defaults to "true" -->
|
||||
<preference name="SplashScreenWidth" value="600" /> <!-- defaults to "170" -->
|
||||
<preference name="SplashScreenHeight" value="300" /> <!-- defaults to "200" -->
|
||||
</platform>
|
||||
```
|
||||
|
||||
__Note__: `SplashScreen` value should be absolute in order to work in a sub-page. The `SplashScreen` value is used only for the browser platform. The value will be ignored for other platforms.
|
||||
|
||||
#### iOS Quirks
|
||||
|
||||
- In iOS, the splash screen images are called launch images. These images are mandatory on iOS.
|
||||
|
||||
#### Windows Quirks
|
||||
|
||||
- `SplashScreenSpinnerColor` (string, defaults to system accent color): hash, rgb notation or CSS color name.
|
||||
|
||||
```xml
|
||||
<preference name="SplashScreenSpinnerColor" value="#242424"/>
|
||||
<preference name="SplashScreenSpinnerColor" value="DarkRed"/>
|
||||
<preference name="SplashScreenSpinnerColor" value="rgb(50,128,128)"/>
|
||||
```
|
||||
|
||||
- `SplashScreenBackgroundColor` (string, defaults to #464646): hex notation.
|
||||
|
||||
```xml
|
||||
<preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
- splashscreen.show
|
||||
- splashscreen.hide
|
||||
|
||||
### splashscreen.hide
|
||||
|
||||
Dismiss the splash screen.
|
||||
|
||||
```js
|
||||
navigator.splashscreen.hide();
|
||||
```
|
||||
|
||||
|
||||
#### iOS Quirk
|
||||
|
||||
The `config.xml` file's `AutoHideSplashScreen` setting must be
|
||||
`false`. To delay hiding the splash screen for two seconds, add a
|
||||
timer such as the following in the `deviceready` event handler:
|
||||
|
||||
```js
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
```
|
||||
|
||||
### splashscreen.show
|
||||
|
||||
Displays the splash screen.
|
||||
|
||||
```js
|
||||
navigator.splashscreen.show();
|
||||
```
|
||||
|
||||
Your application cannot call `navigator.splashscreen.show()` until the application has
|
||||
started and the `deviceready` event has fired. But since typically the splash
|
||||
screen is meant to be visible before your application has started, that would seem to
|
||||
defeat the purpose of the splash screen. Providing any parameters in
|
||||
`config.xml` will automatically `show` the splash screen immediately after your
|
||||
application is launched and before it has fully started and received the `deviceready`
|
||||
event. For this reason, it is unlikely you will need to call `navigator.splashscreen.show()` to make the splash
|
||||
screen visible for application startup.
|
||||
|
||||
255
RELEASENOTES.md
255
RELEASENOTES.md
@@ -20,43 +20,188 @@
|
||||
-->
|
||||
# Release Notes
|
||||
|
||||
### 0.2.2 (Sept 25, 2013)
|
||||
* CB-4889 bumping&resetting version
|
||||
* CB-4889 renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
|
||||
* Rename CHANGELOG.md -> RELEASENOTES.md
|
||||
* [CB-4806] Update splashscreen image bounds for iOS 7
|
||||
* [CB-4752] Incremented plugin version on dev branch.
|
||||
### 5.0.4 (Jun 03, 2020)
|
||||
* [GH-261](https://github.com/apache/cordova-plugin-splashscreen/pull/261) chore: add `cordova-ios` requirement <6.0.0
|
||||
* chore(asf): update git notification settings
|
||||
* update CONTRIBUTING.md
|
||||
* [GH-251](https://github.com/apache/cordova-plugin-splashscreen/pull/251) chore(npm): adds ignore list
|
||||
* [GH-252](https://github.com/apache/cordova-plugin-splashscreen/pull/252) ci: updates Node.js versions
|
||||
* [GH-236](https://github.com/apache/cordova-plugin-splashscreen/pull/236) update homepage to github `README` page
|
||||
* [GH-239](https://github.com/apache/cordova-plugin-splashscreen/pull/239) update `README`.md by adding missing info
|
||||
* ci(travis): Upgrade node from 6 to 8
|
||||
* ci(travis): Remove **Android 4.4**, Add **Android** 9.0
|
||||
* [GH-212](https://github.com/apache/cordova-plugin-splashscreen/pull/212) ci(travis): Add ADDITIONAL_TESTS_DIR=./tests/ios
|
||||
|
||||
### 0.2.3 (Oct 9, 2013)
|
||||
* [CB-4806] Re-fix Update splashscreen image bounds for iOS 7
|
||||
* [CB-4934] plugin-splashscreen should not show by default on Windows8
|
||||
* [CB-4929] plugin-splashscreen not loading proxy windows8
|
||||
* [CB-4915] Incremented plugin version on dev branch.
|
||||
### 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
|
||||
|
||||
### 0.2.4 (Oct 28, 2013)
|
||||
* CB-5128: add repo + issue tag to plugin.xml for splashscreen plugin
|
||||
* [CB-5010] Incremented plugin version on dev branch.
|
||||
### 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
|
||||
|
||||
### 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 - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs
|
||||
### 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)
|
||||
|
||||
### 0.2.6 (Jan 02, 2014)
|
||||
* CB-5658 Add doc/index.md for Splashscreen plugin
|
||||
* Handle error when splash image is missing.
|
||||
### 5.0.0 (Dec 15, 2017)
|
||||
* [CB-13677](https://issues.apache.org/jira/browse/CB-13677) Remove deprecated platforms
|
||||
|
||||
### 0.2.7 (Feb 05, 2014)
|
||||
* [CB-3562] Fix aspect ratio on landscape-only iPhone applications
|
||||
* CB-4051 fix for splashscreen rotation problem
|
||||
### 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`.
|
||||
|
||||
### 0.3.0 (Apr 17, 2014)
|
||||
* Add Tizen support to plugin
|
||||
* CB-6422: [windows8] use cordova/exec/proxy
|
||||
* CB-4051: [ios] - Re-fix - Splashscreen rotation problem (closes #13)
|
||||
* CB-6460: Update license headers
|
||||
* CB-6465: Add license headers to Tizen code
|
||||
* Add NOTICE file
|
||||
### 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
|
||||
@@ -64,16 +209,48 @@
|
||||
* 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 Add license to CONTRIBUTING.md
|
||||
* [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 Use splash screen image from manifest on Windows8
|
||||
* CB-6491 add CONTRIBUTING.md
|
||||
* [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.2 (Aug 06, 2014)
|
||||
* CB-6127 Updated translations for docs
|
||||
* CB-7041 ios: Fix image filename logic when setting the iPad splash screen
|
||||
* fixes Splashscreen crash on WP8
|
||||
* Remove outdated doc
|
||||
### 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.
|
||||
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung.
|
||||
|
||||
## Installation
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Unterstützte Plattformen
|
||||
|
||||
* Amazon Fire OS
|
||||
* Android
|
||||
* BlackBerry 10
|
||||
* iOS
|
||||
* Windows Phone 7 und 8
|
||||
* Windows 8
|
||||
|
||||
## Methoden
|
||||
|
||||
* SplashScreen.Show
|
||||
* SplashScreen.Hide
|
||||
|
||||
### Android Macken
|
||||
|
||||
Sie müssen in der Datei config.xml fügen Sie die folgenden Einstellungen:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Stellen Sie sicher, Splashcreen Dateien zu Ihrem Res/Xml-Verzeichnis unter den entsprechenden Ordnern hinzuzufügen. Der zweite Parameter stellt dar, wie lange das Splashscreen in Millisekunden angezeigt werden. Es wird standardmäßig auf 3000 ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens][1] .
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## SplashScreen.Hide
|
||||
|
||||
Schließen Sie den Splash-Screen.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
|
||||
Die `config.xml` der Datei `AutoHideSplashScreen` muss `false` . Verstecken des Begrüßungsbildschirms für zwei Sekunden Verzögerung, fügen Sie einen Timer wie die folgende in der `deviceready` -Ereignishandler:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## SplashScreen.Show
|
||||
|
||||
Zeigt den Begrüßungsbildschirm.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
Ihre Anwendung kann nicht aufgerufen werden `navigator.splashscreen.show()` bis die app gestartet hat und das `deviceready` -Ereignis ausgelöst hat. Aber da in der Regel der Splash-Screen soll sichtbar sein, bevor die Anwendung gestartet wurde, scheint die Niederlage der Zweck des Begrüßungsbildschirms. Somit einige Konfiguration in `config.xml` wird automatisch `show` den Splash-Screen unmittelbar nach Ihrer app starten und bevor es voll gestartet und hat das `deviceready` Ereignis. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens][1] . Aus diesem Grund ist es unwahrscheinlich, dass Sie aufrufen müssen `navigator.splashscreen.show()` den Splash-Screen beim Starten der app sichtbar zu machen.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicación.
|
||||
|
||||
## Instalación
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Plataformas soportadas
|
||||
|
||||
* Amazon fuego OS
|
||||
* Android
|
||||
* BlackBerry 10
|
||||
* iOS
|
||||
* Windows Phone 7 y 8
|
||||
* Windows 8
|
||||
|
||||
## Métodos
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.hide
|
||||
|
||||
### Rarezas Android
|
||||
|
||||
En el archivo config.xml, tienes que añadir las siguientes preferencias:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Donde foo es el nombre del archivo splashscreen, preferiblemente un archivo de 9 parche. Asegúrese de agregar tus archivos splashcreen en tu directorio res/xml bajo las carpetas apropiadas. El segundo parámetro representa cuánto aparecerán el splashscreen en milisegundos. Valor predeterminado es ms 3000. Ver [los iconos y salpicadura pantallas][1] para obtener más información.
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
Despedir a la pantalla de bienvenida.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
|
||||
El `config.xml` del archivo `AutoHideSplashScreen` la configuración debe ser `false` . Para retrasar oculta la pantalla splash durante dos segundos, agregue un temporizador como la siguiente en el `deviceready` controlador de eventos:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
Muestra la pantalla de bienvenida.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
La aplicación no se puede llamar `navigator.splashscreen.show()` hasta que haya iniciado la aplicación y el `deviceready` evento ha despedido. Pero puesto que normalmente la pantalla está destinada a ser visible antes de que comience su aplicación, que parecería que el propósito de la pantalla de bienvenida. Proporcionar cierta configuración en `config.xml` automáticamente `show` la pantalla de presentación inmediatamente después de su lanzamiento de la aplicación y antes de ser completamente ha iniciado y recibió el `deviceready` evento. Ver [los iconos y salpicadura pantallas][1] para obtener más información sobre haciendo esta configuración. Por esta razón, es poco probable que necesitas llamar a `navigator.splashscreen.show()` para hacer la pantalla visible para el inicio de la aplicación.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Ce plugin affiche et masque un écran de démarrage lors du lancement de l'application.
|
||||
|
||||
## Installation
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Plates-formes prises en charge
|
||||
|
||||
* Amazon Fire OS
|
||||
* Android
|
||||
* BlackBerry 10
|
||||
* iOS
|
||||
* Windows Phone 7 et 8
|
||||
* Windows 8
|
||||
|
||||
## Méthodes
|
||||
|
||||
* splashscreen.Show
|
||||
* splashscreen.Hide
|
||||
|
||||
### Quirks Android
|
||||
|
||||
Dans votre fichier config.xml, vous devez ajouter les préférences suivantes :
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Où foo est le nom du fichier splashscreen, préférablement un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre répertoire res/xml dans les dossiers appropriés. Le deuxième paramètre représente combien de temps le splashscreen apparaîtra en millisecondes. Il est par défaut à 3000 ms. Pour plus d'informations, consultez [icônes et écrans de démarrage][1] .
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.Hide
|
||||
|
||||
Faire disparaître de l'écran de démarrage.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
|
||||
La `config.xml` du fichier `AutoHideSplashScreen` doit être `false` . Pour retarder la cacher l'écran de démarrage pendant deux secondes, ajouter un minuteur comme suit dans la `deviceready` gestionnaire d'événements :
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.Show
|
||||
|
||||
Affiche l'écran de démarrage.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'à ce que l'application a commencé et le `deviceready` événement a été déclenché. Mais puisqu'en général, l'écran de démarrage est destiné à être visible avant que votre application a commencé, qui semblerait à l'encontre des objectifs de l'écran de démarrage. Fournir une configuration en `config.xml` sera automatiquement `show` l'écran de démarrage immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu le `deviceready` événement. Voir les [icônes et les écrans de démarrage][1] pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'écran de démarrage visible pour le démarrage de l'application.
|
||||
88
doc/index.md
88
doc/index.md
@@ -1,88 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
This plugin displays and hides a splash screen during application launch.
|
||||
|
||||
## Installation
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
- Amazon Fire OS
|
||||
- Android
|
||||
- BlackBerry 10
|
||||
- iOS
|
||||
- Windows Phone 7 and 8
|
||||
- Windows 8
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
- splashscreen.show
|
||||
- splashscreen.hide
|
||||
|
||||
### Android Quirks
|
||||
|
||||
In your config.xml, you need to add the following preferences:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />`
|
||||
`<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
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. The second parameter represents how long the splashscreen will appear in milliseconds. It defaults to 3000 ms. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)
|
||||
for more information.
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
Dismiss the splash screen.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
|
||||
The `config.xml` file's `AutoHideSplashScreen` setting must be
|
||||
`false`. To delay hiding the splash screen for two seconds, add a
|
||||
timer such as the following in the `deviceready` event handler:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
Displays the splash screen.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
Your application cannot call `navigator.splashscreen.show()` until the app has
|
||||
started and the `deviceready` event has fired. But since typically the splash
|
||||
screen is meant to be visible before your app has started, that would seem to
|
||||
defeat the purpose of the splash screen. Providing some configuration in
|
||||
`config.xml` will automatically `show` the splash screen immediately after your
|
||||
app launch and before it has fully started and received the `deviceready`
|
||||
event. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)
|
||||
for more information on doing this configuration. For this reason, it is
|
||||
unlikely you need to call `navigator.splashscreen.show()` to make the splash
|
||||
screen visible for app startup.
|
||||
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione.
|
||||
|
||||
## Installazione
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Piattaforme supportate
|
||||
|
||||
* Amazon fuoco OS
|
||||
* Android
|
||||
* BlackBerry 10
|
||||
* iOS
|
||||
* Windows Phone 7 e 8
|
||||
* Windows 8
|
||||
|
||||
## Metodi
|
||||
|
||||
* splashscreen
|
||||
* splashscreen.Hide
|
||||
|
||||
### Stranezze Android
|
||||
|
||||
Nel vostro config. xml, è necessario aggiungere le seguenti preferenze:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assicurati di aggiungere i tuoi file splashcreen res/xml nella directory sotto cartelle appropriate. Il secondo parametro rappresenta quanto tempo lo splashscreen apparirà in millisecondi. Il valore predefinito è 3000 ms. Per ulteriori informazioni, vedere [icone e schermate iniziali][1] .
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.Hide
|
||||
|
||||
Respingere la schermata iniziale.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
|
||||
Il `config.xml` di file `AutoHideSplashScreen` impostazione deve essere `false` . Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel `deviceready` gestore di evento:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen
|
||||
|
||||
Visualizza la schermata iniziale.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando ha iniziato l'app e il `deviceready` ha generato l'evento. Ma poiché in genere la schermata iniziale è destinata ad essere visibile prima app ha iniziato, che sembrerebbe per sconfiggere lo scopo della schermata iniziale. Fornendo qualche configurazione in `config.xml` verrà automaticamente `show` la schermata iniziale subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto il `deviceready` evento. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali][1] . Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
このプラグインが表示され、アプリケーションの起動中にスプラッシュ スクリーンを非表示にします。
|
||||
|
||||
## インストール
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## サポートされているプラットフォーム
|
||||
|
||||
* アマゾン火 OS
|
||||
* アンドロイド
|
||||
* ブラックベリー 10
|
||||
* iOS
|
||||
* Windows Phone 7 と 8
|
||||
* Windows 8
|
||||
|
||||
## メソッド
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.hide
|
||||
|
||||
### Android の癖
|
||||
|
||||
あなたの config.xml を以下の設定を追加する必要があります。
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面][1]を参照してください。
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
スプラッシュ スクリーンを閉じます。
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### ブラックベリー 10、WP8、iOS の気まぐれ
|
||||
|
||||
`config.xml`ファイルの `AutoHideSplashScreen` 設定する必要があります `false` 。 遅延を 2 秒間スプラッシュ スクリーンを非表示、タイマーを追加しますで次のように `deviceready` イベント ハンドラー。
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
スプラッシュ画面が表示されます。
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
アプリケーションを呼び出すことはできません `navigator.splashscreen.show()` 、アプリが開始されるまで、 `deviceready` イベントが発生します。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 いくつかの構成を提供する `config.xml` は自動的に `show` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、受信する前に、 `deviceready` イベント。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面][1]を参照してください。 このような理由から、それは可能性を呼び出す必要があります `navigator.splashscreen.show()` アプリ起動時のスプラッシュ画面を見やすくします。
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
이 플러그인은 표시 하 고 응용 프로그램 실행 하는 동안 시작 화면을 숨깁니다.
|
||||
|
||||
## 설치
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## 지원 되는 플랫폼
|
||||
|
||||
* 아마존 화재 운영 체제
|
||||
* 안 드 로이드
|
||||
* 블랙베리 10
|
||||
* iOS
|
||||
* Windows Phone 7과 8
|
||||
* 윈도우 8
|
||||
|
||||
## 메서드
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.hide
|
||||
|
||||
### 안 드 로이드 단점
|
||||
|
||||
당신의 config.xml에 다음 환경 설정에 추가 해야 합니다.
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
여기서 foo splashscreen 파일, 선호 9 패치 파일의 이름입니다. 적절 한 폴더 아래 res/xml 디렉토리에 splashcreen 파일을 추가 해야 합니다. 두 번째 매개 변수는 splashscreen 얼마나 밀리초 단위로 표시 됩니다 나타냅니다. 3000 ms 기본값으로 사용 됩니다. 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오.
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
시작 화면을 닫습니다.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### 블랙베리 10, WP8, iOS 특질
|
||||
|
||||
`config.xml`파일의 `AutoHideSplashScreen` 설정을 해야 합니다 `false` . 2 초 동안 시작 화면을 숨기고 지연에 다음과 같이 타이머 추가 `deviceready` 이벤트 처리기:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
시작 화면을 표시합니다.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
응용 프로그램 호출할 수 없습니다 `navigator.splashscreen.show()` 응용 프로그램은 시작 될 때까지 및 `deviceready` 이벤트를 해 고 했다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. 몇 가지 구성을 제공 `config.xml` 자동으로 `show` 시작 화면 응용 프로그램 실행 후 즉시 및 그것은 완벽 하 게 시작 하 고 받은 전에 `deviceready` 이벤트. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오. 이러한 이유로, 그것은 가능성이 호출 해야 `navigator.splashscreen.show()` 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 합니다.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji.
|
||||
|
||||
## Instalacji
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Obsługiwane platformy
|
||||
|
||||
* Amazon ogień OS
|
||||
* Android
|
||||
* Jeżyna 10
|
||||
* iOS
|
||||
* Windows Phone 7 i 8
|
||||
* Windows 8
|
||||
|
||||
## Metody
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.Hide
|
||||
|
||||
### Android dziwactwa
|
||||
|
||||
W pliku config.xml musisz dodać następujące preferencje:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Gdzie foo jest nazwą pliku ekranu powitalnego, najlepiej 9 łatce. Upewnij się dodać pliki splashcreen do katalogu res/xml w odpowiednich folderach. Drugi parametr reprezentuje, jak długo ekranu powitalnego pojawi się w milisekundach. Domyślnie 3000 ms. Aby uzyskać więcej informacji, zobacz [ikony i ekrany powitalne w aplikacjach][1] .
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.Hide
|
||||
|
||||
Odrzucić ten opryskaæ têcza.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### Jeżyna 10, WP8, iOS dziwactwo
|
||||
|
||||
`config.xml`Pliku `AutoHideSplashScreen` ustawienie musi być `false` . Opóźnienia, ukrywanie ekranu powitalnego przez dwie sekundy, dodać timer następujących w `deviceready` obsługa zdarzeń:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
Wyświetla ekran powitalny.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
Aplikacja nie może wywołać `navigator.splashscreen.show()` aż aplikacja została uruchomiona i `deviceready` imprezy został zwolniony. Ale ponieważ zazwyczaj opryskać tęcza ma być widoczne przed rozpoczęciem aplikacji, wydaje się sprzeczne z celem ekranu powitalnego. Dostarczanie niektórych konfiguracji w `config.xml` będzie automatycznie `show` ekran powitalny, natychmiast po uruchomienie aplikacji i przed pełni rozpoczął i otrzymał `deviceready` zdarzenie. Aby uzyskać więcej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach][1] . Z tego powodu, jest mało prawdopodobne, należy zadzwonić `navigator.splashscreen.show()` Aby wyświetlić ekran powitalny dla uruchamiania aplikacji.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
Этот плагин отображает и скрывает экран-заставку при запуске приложения.
|
||||
|
||||
## Установка
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## Поддерживаемые платформы
|
||||
|
||||
* Amazon Fire ОС
|
||||
* Android
|
||||
* BlackBerry 10
|
||||
* iOS
|
||||
* Windows Phone 7 и 8
|
||||
* Windows 8
|
||||
|
||||
## Методы
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.hide
|
||||
|
||||
### Особенности Android
|
||||
|
||||
В вашем файле config.xml необходимо добавить следующие настройки:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
Где foo это имя файла splashscreen, желательно 9 заплатку. Убедитесь в том добавить ваши splashcreen файлы в папку res/xml в соответствующие папки. Второй параметр представляет, как долго splashscreen появится в миллисекундах. По умолчанию он 3000 МС. Увидеть [иконки и заставки][1] для получения дополнительной информации.
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
Закройте экран-заставка.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### Особенности BlackBerry 10, WP8, iOS
|
||||
|
||||
`config.xml`Файла `AutoHideSplashScreen` должен быть `false` . Для задержки скрытия заставки на две секунды, добавить таймер, например в `deviceready` обработчик событий:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
Отображает экран-заставку.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
Ваше приложение не может вызвать `navigator.splashscreen.show()` до тех пор, пока приложение началась и `deviceready` событие инициировано. Но поскольку обычно экран-заставка должен быть видимым до начала вашего приложения, что казалось бы поражение цели экрана-заставки. Предоставление некоторых конфигурации в `config.xml` будет автоматически `show` экран-заставку сразу же после запуска вашего приложения и перед его полностью запущен и получил `deviceready` событие. Увидеть [иконки и заставки][1] для получения дополнительной информации на делать этой конфигурации. По этой причине маловероятно, вам нужно вызвать `navigator.splashscreen.show()` для отображения экрана-заставки для запуска приложения.
|
||||
@@ -1,76 +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.
|
||||
-->
|
||||
|
||||
# org.apache.cordova.splashscreen
|
||||
|
||||
這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。
|
||||
|
||||
## 安裝
|
||||
|
||||
cordova plugin add org.apache.cordova.splashscreen
|
||||
|
||||
|
||||
## 支援的平臺
|
||||
|
||||
* 亞馬遜火 OS
|
||||
* Android 系統
|
||||
* 黑莓 10
|
||||
* iOS
|
||||
* Windows Phone 7 和 8
|
||||
* Windows 8
|
||||
|
||||
## 方法
|
||||
|
||||
* splashscreen.show
|
||||
* splashscreen.hide
|
||||
|
||||
### Android 的怪癖
|
||||
|
||||
在你的 config.xml,您需要添加以下優惠:
|
||||
|
||||
`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />`
|
||||
|
||||
美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏將顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見[圖示和啟動畫面][1]。
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
## splashscreen.hide
|
||||
|
||||
解雇的初始螢幕。
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### 黑莓 10,WP8,iOS 怪癖
|
||||
|
||||
`config.xml`檔的 `AutoHideSplashScreen` 設置必須為 `false` 。 若要延遲兩秒鐘,隱藏的閃屏,添加一個計時器在以下 `deviceready` 事件處理常式:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
|
||||
|
||||
## splashscreen.show
|
||||
|
||||
顯示初始螢幕。
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
|
||||
您的應用程式不能調用 `navigator.splashscreen.show()` 直到應用程式已經開始和 `deviceready` 觸發了事件。 但通常的閃屏是意味著是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 將自動 `show` 閃屏立即在您的應用程式啟動後,它已完全開始前收到 `deviceready` 事件。 在做這種配置的更多資訊,請參見[圖示和啟動畫面][1]。 為此,它是不太可能你需要調用 `navigator.splashscreen.show()` ,使初始螢幕可見的應用程式的啟動。
|
||||
54
package.json
Normal file
54
package.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "cordova-plugin-splashscreen",
|
||||
"version": "5.0.4",
|
||||
"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-ios": "<6.0.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://github.com/apache/cordova-plugin-splashscreen#readme"
|
||||
}
|
||||
83
plugin.xml
83
plugin.xml
@@ -19,8 +19,8 @@
|
||||
-->
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="org.apache.cordova.splashscreen"
|
||||
version="0.3.2">
|
||||
id="cordova-plugin-splashscreen"
|
||||
version="5.0.4">
|
||||
<name>Splashscreen</name>
|
||||
<description>Cordova Splashscreen Plugin</description>
|
||||
<license>Apache 2.0</license>
|
||||
@@ -28,6 +28,11 @@
|
||||
<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-ios" version="<6.0.0" />
|
||||
<engine name="cordova-windows" version=">=4.4.0" />
|
||||
</engines>
|
||||
|
||||
<js-module src="www/splashscreen.js" name="SplashScreen">
|
||||
<clobbers target="navigator.splashscreen" />
|
||||
@@ -37,30 +42,14 @@
|
||||
<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" />
|
||||
</platform>
|
||||
|
||||
<!-- amazon-fireos -->
|
||||
<platform name="amazon-fireos">
|
||||
<config-file target="res/xml/config.xml" parent="/*">
|
||||
<feature name="SplashScreen">
|
||||
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/android/SplashScreen.java" target-dir="src/org/apache/cordova/splashscreen" />
|
||||
</platform>
|
||||
|
||||
<!-- ubuntu -->
|
||||
<platform name="ubuntu">
|
||||
<header-file src="src/ubuntu/splashscreen.h" />
|
||||
<source-file src="src/ubuntu/splashscreen.cpp" />
|
||||
</platform>
|
||||
|
||||
<!-- ios -->
|
||||
<platform name="ios">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
@@ -70,56 +59,24 @@
|
||||
</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"/>
|
||||
<param name="onload" value="true"/>
|
||||
</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"/>
|
||||
<param name="onload" value="true"/>
|
||||
</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>
|
||||
|
||||
<!-- tizen -->
|
||||
<platform name="tizen">
|
||||
<js-module src="src/tizen/SplashScreenProxy.js" name="SplashScreenProxy">
|
||||
<!-- browser -->
|
||||
<platform name="browser">
|
||||
<js-module src="src/browser/SplashScreenProxy.js" name="SplashScreenProxy">
|
||||
<runs />
|
||||
</js-module>
|
||||
</platform>
|
||||
|
||||
@@ -19,20 +19,160 @@
|
||||
|
||||
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.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 +180,234 @@ 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 (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
|
||||
if ((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;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
170
src/browser/SplashScreenProxy.js
Normal file
170
src/browser/SplashScreenProxy.js
Normal 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -19,14 +19,18 @@
|
||||
|
||||
#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];
|
||||
}
|
||||
@@ -38,7 +42,7 @@
|
||||
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
[self setVisible:NO];
|
||||
[self setVisible:NO andForce:YES];
|
||||
}
|
||||
|
||||
- (void)pageDidLoad
|
||||
@@ -66,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;
|
||||
}
|
||||
|
||||
@@ -91,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];
|
||||
}
|
||||
|
||||
@@ -101,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;
|
||||
@@ -112,37 +142,142 @@
|
||||
_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
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the view's frame and image.
|
||||
- (void)updateImage
|
||||
- (CDV_iOSDevice) getCurrentDevice
|
||||
{
|
||||
UIInterfaceOrientation orientation = self.viewController.interfaceOrientation;
|
||||
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
|
||||
CDVViewController* vc = (CDVViewController*)self.viewController;
|
||||
BOOL supportsLandscape = [vc supportsOrientation:UIInterfaceOrientationLandscapeLeft] || [vc supportsOrientation:UIInterfaceOrientationLandscapeRight];
|
||||
BOOL supportsPortrait = [vc supportsOrientation:UIInterfaceOrientationPortrait] || [vc supportsOrientation:UIInterfaceOrientationPortraitUpsideDown];
|
||||
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) {
|
||||
if (imageName)
|
||||
{
|
||||
imageName = [imageName stringByDeletingPathExtension];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
imageName = @"Default";
|
||||
}
|
||||
|
||||
if (CDV_IsIPhone5()) {
|
||||
// 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 (CDV_IsIPad()) {
|
||||
if (isOrientationLocked) {
|
||||
imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")];
|
||||
}
|
||||
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 {
|
||||
switch (orientation) {
|
||||
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"];
|
||||
@@ -157,27 +292,84 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (![imageName isEqualToString:_curImageName]) {
|
||||
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
|
||||
{
|
||||
NSString* imageName = [self getImageName:[self getCurrentOrientation] delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]];
|
||||
|
||||
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 = (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 = self.viewController.interfaceOrientation;
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
CGAffineTransform imgTransform = CGAffineTransformIdentity;
|
||||
|
||||
/* If and only if an iPhone application is landscape-only as per
|
||||
@@ -185,26 +377,35 @@
|
||||
* landscape. In this case the image must be rotated in order to appear
|
||||
* correctly.
|
||||
*/
|
||||
if (UIInterfaceOrientationIsLandscape(orientation) && !CDV_IsIPad()) {
|
||||
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];
|
||||
if (!(IsAtLeastiOSVersion(@"7.0"))) {
|
||||
if (!(IsAtLeastiOSVersion(@"7.0")))
|
||||
{
|
||||
imgBounds.origin.y -= statusFrame.size.height;
|
||||
}
|
||||
} else if (imgBounds.size.width > 0) {
|
||||
}
|
||||
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;
|
||||
@@ -217,39 +418,96 @@
|
||||
|
||||
- (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
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
})));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
28
src/ios/CDVViewController+SplashScreen.h
Normal file
28
src/ios/CDVViewController+SplashScreen.h
Normal 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
|
||||
89
src/ios/CDVViewController+SplashScreen.m
Normal file
89
src/ios/CDVViewController+SplashScreen.m
Normal 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
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2013 Canonical Ltd.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QQuickItem>
|
||||
|
||||
#include "splashscreen.h"
|
||||
#include <cordova.h>
|
||||
|
||||
#define SPLASHSCREEN_STATE_NAME "splashscreen"
|
||||
|
||||
Splashscreen::Splashscreen(Cordova *cordova): CPlugin(cordova) {
|
||||
}
|
||||
|
||||
void Splashscreen::show(int, int) {
|
||||
m_cordova->rootObject()->setProperty("splashscreenPath", m_cordova->getSplashscreenPath());
|
||||
|
||||
m_cordova->pushViewState(SPLASHSCREEN_STATE_NAME);
|
||||
}
|
||||
|
||||
void Splashscreen::hide(int, int) {
|
||||
m_cordova->popViewState(SPLASHSCREEN_STATE_NAME);
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2013 Canonical Ltd.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SPLASHSCREEN_H
|
||||
#define SPLASHSCREEN_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <cplugin.h>
|
||||
|
||||
class Splashscreen: public CPlugin {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Splashscreen(Cordova *cordova);
|
||||
|
||||
virtual const QString fullName() override {
|
||||
return Splashscreen::fullID();
|
||||
}
|
||||
|
||||
virtual const QString shortName() override {
|
||||
return "SplashScreen";
|
||||
}
|
||||
|
||||
static const QString fullID() {
|
||||
return "SplashScreen";
|
||||
}
|
||||
|
||||
public slots:
|
||||
void show(int, int);
|
||||
void hide(int, int);
|
||||
};
|
||||
|
||||
#endif // SPLASHSCREEN_H
|
||||
39
src/wp/ResolutionHelper.cs
Normal file
39
src/wp/ResolutionHelper.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
@@ -41,127 +41,215 @@ namespace WPCordovaClassLib.Cordova.Commands
|
||||
public class SplashScreen : BaseCommand
|
||||
{
|
||||
private Popup popup;
|
||||
private bool autohide = true;
|
||||
|
||||
// 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
|
||||
popup = new Popup() {IsOpen = false, Child = SplashScreen };
|
||||
// Orient the popup accordingly
|
||||
popup.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||
popup.VerticalAlignment = VerticalAlignment.Center;
|
||||
|
||||
popup = new Popup() { IsOpen = false,
|
||||
Child = SplashScreen,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
|
||||
LoadConfigValues();
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
// we only want to autoload the first time a page is loaded.
|
||||
if (!WasShown)
|
||||
// we only want to autoload on the first page load.
|
||||
// but OnInit is called for every page load.
|
||||
if (!SplashScreen.WasShown)
|
||||
{
|
||||
WasShown = true;
|
||||
SplashScreen.WasShown = true;
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
||||
void LoadConfigValues()
|
||||
private void LoadConfigPrefs()
|
||||
{
|
||||
StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("config.xml", UriKind.Relative));
|
||||
|
||||
if (streamInfo != null)
|
||||
{
|
||||
StreamReader sr = new StreamReader(streamInfo.Stream);
|
||||
//This will Read Keys Collection for the xml file
|
||||
XDocument document = XDocument.Parse(sr.ReadToEnd());
|
||||
|
||||
var preferences = from results in document.Descendants()
|
||||
where (string)results.Attribute("name") == "AutoHideSplashScreen"
|
||||
select (string)results.Attribute("value") == "true";
|
||||
|
||||
if (preferences.Count() > 0 && preferences.First() == false)
|
||||
using (StreamReader sr = new StreamReader(streamInfo.Stream))
|
||||
{
|
||||
autohide = false;
|
||||
//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(() =>
|
||||
{
|
||||
if (popup.IsOpen)
|
||||
if (!popup.IsOpen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
popup.Child.Opacity = 0;
|
||||
|
||||
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 story = new Storyboard();
|
||||
DoubleAnimation animation;
|
||||
animation = new DoubleAnimation();
|
||||
animation.From = 0.0;
|
||||
animation.To = 1.0;
|
||||
animation.Duration = new Duration(TimeSpan.FromSeconds(0.2));
|
||||
Storyboard.SetTarget(animation, popup.Child);
|
||||
Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
|
||||
story.Children.Add(animation);
|
||||
|
||||
Storyboard.SetTarget(animation, popup.Child);
|
||||
Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
|
||||
story.Children.Add(animation);
|
||||
story.Begin();
|
||||
|
||||
Debug.WriteLine("Fading the splash screen in");
|
||||
popup.IsOpen = true;
|
||||
|
||||
story.Begin();
|
||||
|
||||
popup.IsOpen = true;
|
||||
|
||||
if (autohide)
|
||||
{
|
||||
DispatcherTimer timer = new DispatcherTimer();
|
||||
timer.Tick += (object sender, EventArgs e) =>
|
||||
if (prefAutoHide)
|
||||
{
|
||||
hide();
|
||||
};
|
||||
timer.Interval = TimeSpan.FromSeconds(1.2);
|
||||
timer.Start();
|
||||
StartAutoHideTimer();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void hide(string options = null)
|
||||
{
|
||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
if (!popup.IsOpen)
|
||||
if (popup.IsOpen)
|
||||
{
|
||||
return;
|
||||
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();
|
||||
}
|
||||
|
||||
popup.Child.Opacity = 1.0;
|
||||
|
||||
Storyboard story = new Storyboard();
|
||||
DoubleAnimation animation;
|
||||
animation = new DoubleAnimation();
|
||||
animation.From = 1.0;
|
||||
animation.To = 0.0;
|
||||
animation.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
7
tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "container:CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
1
tests/ios/CDVSplashScreenTest/.gitignore
vendored
Normal file
1
tests/ios/CDVSplashScreenTest/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
build
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -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 */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:CDVSplashScreenTest.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
40
tests/ios/README.md
Normal 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
13
tests/ios/package.json
Normal 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
14
tests/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "cordova-plugin-splashscreen-tests",
|
||||
"version": "5.0.4",
|
||||
"description": "",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-splashscreen-tests",
|
||||
"platforms": []
|
||||
},
|
||||
"keywords": [
|
||||
"ecosystem:cordova"
|
||||
],
|
||||
"author": "",
|
||||
"license": "Apache 2.0"
|
||||
}
|
||||
29
tests/plugin.xml
Normal file
29
tests/plugin.xml
Normal 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">
|
||||
<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
64
tests/tests.js
Normal 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
17
types/index.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
@@ -19,25 +19,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
( function() {
|
||||
/*jslint sloppy:true */
|
||||
|
||||
win = null;
|
||||
var splash = require('cordova/splashscreen');
|
||||
|
||||
module.exports = {
|
||||
show: function() {
|
||||
if ( win === null ) {
|
||||
win = window.open('splashscreen.html');
|
||||
}
|
||||
var SplashScreen = {
|
||||
show: function () {
|
||||
splash.show();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if ( win !== null ) {
|
||||
win.close();
|
||||
win = null;
|
||||
}
|
||||
hide: function () {
|
||||
splash.hide();
|
||||
}
|
||||
};
|
||||
|
||||
require("cordova/tizen/commandProxy").add("SplashScreen", module.exports);
|
||||
module.exports = SplashScreen;
|
||||
|
||||
})();
|
||||
require("cordova/exec/proxy").add("SplashScreen", SplashScreen);
|
||||
@@ -1,106 +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.
|
||||
*
|
||||
*/
|
||||
|
||||
/*jslint sloppy:true */
|
||||
/*global Windows:true, require, module, window, document, WinJS */
|
||||
|
||||
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 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";
|
||||
}
|
||||
|
||||
function onResize(evt) {
|
||||
if (splash) {
|
||||
position = splash.imageLocation;
|
||||
updateImageLocation();
|
||||
}
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
localSplashImage = document.createElement("img");
|
||||
localSplashImage.src = "ms-appx:///images/splashscreen.png";
|
||||
localSplashImage.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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
channel.onCordovaReady.subscribe(function (evt) {
|
||||
document.addEventListener("DOMContentLoaded", function (evt) {
|
||||
WinJS.Application.addEventListener("activated", activated, false);
|
||||
}, false);
|
||||
});
|
||||
|
||||
require("cordova/exec/proxy").add("SplashScreen", SplashScreen);
|
||||
|
||||
Reference in New Issue
Block a user