diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-07-31 09:21:51 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-07-31 09:21:51 -0400 |
| commit | f53cb76ed1f89607bb8f8c261fa771d733d04b3f (patch) | |
| tree | 43d2fb4f5882ab78c7dff5f4616c2df0829077b1 /plugins | |
| parent | a6b7582785a396f059be7e901b56845477140558 (diff) | |
modified image access to route through index.php and fixed cookie intercept and insert
Diffstat (limited to 'plugins')
73 files changed, 2423 insertions, 614 deletions
diff --git a/plugins/android.json b/plugins/android.json index 2978230a..9c919fd6 100644 --- a/plugins/android.json +++ b/plugins/android.json @@ -41,10 +41,6 @@ "count": 1 }, { - "xml": "<feature name=\"SplashScreen\"><param name=\"android-package\" value=\"org.apache.cordova.splashscreen.SplashScreen\" /><param name=\"onload\" value=\"true\" /></feature>", - "count": 1 - }, - { "xml": "<feature name=\"StatusBar\"><param name=\"android-package\" value=\"org.apache.cordova.statusbar.StatusBar\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 }, @@ -59,6 +55,10 @@ { "xml": "<feature name=\"OrientationLock\"><param name=\"android-package\" value=\"com.plugin.phonegap.OrientationLock\" /></feature>", "count": 1 + }, + { + "xml": "<feature name=\"SplashScreen\"><param name=\"android-package\" value=\"org.apache.cordova.splashscreen.SplashScreen\" /><param name=\"onload\" value=\"true\" /></feature>", + "count": 1 } ] } @@ -103,9 +103,6 @@ "org.apache.cordova.device": { "PACKAGE_NAME": "com.pliablepixels.zmninja" }, - "org.apache.cordova.splashscreen": { - "PACKAGE_NAME": "com.pliablepixels.zmninja" - }, "org.apache.cordova.statusbar": { "PACKAGE_NAME": "com.pliablepixels.zmninja" }, @@ -117,6 +114,9 @@ }, "com.phonegap.plugins.OrientationLock": { "PACKAGE_NAME": "com.pliablepixels.zmninja" + }, + "cordova-plugin-splashscreen": { + "PACKAGE_NAME": "com.pliablepixels.zmninja" } }, "dependent_plugins": {} diff --git a/plugins/org.apache.cordova.splashscreen/CONTRIBUTING.md b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md index f7dbcaba..f7dbcaba 100644 --- a/plugins/org.apache.cordova.splashscreen/CONTRIBUTING.md +++ b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md diff --git a/plugins/org.apache.cordova.splashscreen/LICENSE b/plugins/cordova-plugin-splashscreen/LICENSE index 7a4a3ea2..7a4a3ea2 100644 --- a/plugins/org.apache.cordova.splashscreen/LICENSE +++ b/plugins/cordova-plugin-splashscreen/LICENSE diff --git a/plugins/org.apache.cordova.splashscreen/NOTICE b/plugins/cordova-plugin-splashscreen/NOTICE index 8ec56a52..8ec56a52 100644 --- a/plugins/org.apache.cordova.splashscreen/NOTICE +++ b/plugins/cordova-plugin-splashscreen/NOTICE diff --git a/plugins/cordova-plugin-splashscreen/README.md b/plugins/cordova-plugin-splashscreen/README.md new file mode 100644 index 00000000..b43c2c59 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/README.md @@ -0,0 +1,131 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +This plugin displays and hides a splash screen during application launch. + +## 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 + +- Amazon Fire OS +- Android +- BlackBerry 10 +- iOS +- Windows Phone 7 and 8 +- Windows 8 +- Windows +- Browser + + +## 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" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + +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. + +"SplashMaintainAspectRatio" preference is optional. If set to true, splash screen drawable is not stretched to fit 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 plugin reloads splash drawable whenever orientation changes, so you can specify different drawables for portrait and landscape orientations. + +### Browser Quirks + +You can use the following preferences in your `config.xml`: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS Quirks + +- `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to + prevent the splash screen from fading in and out when its display + state changes. + + <preference name="FadeSplashScreen" value="false"/> + +- `FadeSplashScreenDuration` (float, defaults to `2`): Specifies the + number of seconds for the splash screen fade effect to execute. + + <preference name="FadeSplashScreenDuration" value="4"/> + +- `ShowSplashScreenSpinner` (boolean, defaults to `true`): Set to `false` + to hide the splash-screen spinner. + + <preference name="ShowSplashScreenSpinner" value="false"/> + +## 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. + diff --git a/plugins/org.apache.cordova.splashscreen/RELEASENOTES.md b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md index 1be97903..2c6b0013 100644 --- a/plugins/org.apache.cordova.splashscreen/RELEASENOTES.md +++ b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md @@ -103,3 +103,41 @@ * CB-8351 ios: Stop using deprecated IsIpad macro * CB-3679 Add engine tag for Android >= 3.6.0 due to use of `preferences` * CB-3679 Make SplashScreen plugin compatible with cordova-android@4.0.x + +### 2.0.0 (Apr 15, 2015) +* give users a way to install the bleeding edge. +* CB-8746 gave plugin major version bump +* CB-8797 - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing +* CB-8836 - Crashes after animating splashscreen +* CB-8753 android: Fix missing import in previous commit +* CB-8753 android: Adds `SplashMaintainAspectRatio` preference (close #43) +* CB-8683 changed plugin-id to pacakge-name +* CB-8653 properly updated translated docs to use new id +* CB-8653 updated translated docs to use new id +* 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 android: Make "splash" the default resource ID instead of null +* docs: added Windows to supported platforms +* CB-7964 Add cordova-plugin-splashscreen support for browser platform +* 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 Integrate TravisCI +* CB-8438 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen +* CB-8538 Added package.json file +* CB-8397 Add support to 'windows' for showing the Windows Phone splashscreen + +### 2.1.0 (Jun 17, 2015) +* added missing license headers +* CB-9128 cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen +* fix npm md issue +* Fixed iOS unit tests. +* CB-3562: Disable screen rotation for iPhone when splash screen is shown. (closes #47) +* CB-8988: Fix rotation on iOS/iPad (closes #46) +* 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 [wp8]: Rewrite resoultion helper +* CB-8750 [wp8]: Allow resolution-specific splashscreen images +* CB-8758 [wp8]: UnauthorizedAccessException on hide() diff --git a/plugins/cordova-plugin-splashscreen/doc/de/README.md b/plugins/cordova-plugin-splashscreen/doc/de/README.md new file mode 100644 index 00000000..f876eff8 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/de/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung. + +## 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 + + +## Unterstützte Plattformen + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 und 8 + * Windows 8 + * Windows + * Browser + +## Methoden + + * SplashScreen.Show + * SplashScreen.Hide + +### Android Eigenarten + +Sie müssen in Ihrem `"config.xml"`fügen Sie die folgenden Einstellungen: + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" Präferenz ist optional. Wenn wahr, Splash-Screen zeichenbaren nicht gestreckt wird, um den Bildschirm passen, sondern stattdessen einfach "" den Bildschirm, wie CSS abdeckt "Hintergrund-Größe: Schutz vor". Dies ist sehr nützlich, wenn Splash-Bildschirm Bilder können nicht, in keiner Weise, zum Beispiel verzerrt werden wenn sie Landschaft oder Text enthalten. Diese Einstellung funktioniert am besten mit Bildern, die große Margen (sichere Bereiche) haben, die sicher auf Bildschirme mit unterschiedlichen Seitenverhältnissen zugeschnitten werden können. + +Das Plugin lädt platsch zeichenbaren wenn Ausrichtung ändert, sodass Sie verschiedene Drawables für hoch- und Querformat Ausrichtungen angeben können. + +### Browser-Eigenheiten + +In Ihrem `"config.xml"`können Sie die folgenden Einstellungen: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS Macken + + * `FadeSplashScreen` (Boolean, standardmäßig auf `true festgelegt`): um zu verhindern, dass den Begrüßungsbildschirm ein-und ausblenden bei ihrer Anzeige Statusänderungen auf `false` festgelegt. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (float, Standardwert ist `2`): gibt die Anzahl der Sekunden für den Begrüßungsbildschirm fade Effekt ausgeführt. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (Boolean, standardmäßig auf `true festgelegt`): auf `false` festgelegt wird, um den Begrüßungsbildschirm Spinner auszublenden. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## SplashScreen.Hide + +Schließen Sie den Splash-Screen. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Eigenarten + +Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. 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 `navigator.splashscreen.show()` aufrufen, bis die app begonnen 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 der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist für app-Start aufrufen müssen.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/de/index.md b/plugins/cordova-plugin-splashscreen/doc/de/index.md index be0c3337..b9fc40d2 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/de/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/de/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung. ## Installation - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## Unterstützte Plattformen @@ -44,9 +44,11 @@ Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung. Sie müssen in der config.xml folgende Einstellungen vornehmen: -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <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] . +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 @@ -54,14 +56,15 @@ Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Ste Schließen Sie den Splash-Screen. - Navigator.SplashScreen.Hide(); + navigator.splashscreen.hide(); ### BlackBerry 10, WP8, iOS Eigenarten -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: +Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. 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(); + setTimeout(function() { + navigator.splashscreen.hide(); }, 2000); @@ -69,7 +72,7 @@ Die `config.xml` der Datei `AutoHideSplashScreen` muss `false` . Verstecken des Zeigt den Begrüßungsbildschirm. - Navigator.SplashScreen.Show(); + 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.
\ No newline at end of file +Ihre Anwendung kann nicht `navigator.splashscreen.show()` aufrufen, bis die app begonnen 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 der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens][1]. Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist für app-Start aufrufen müssen. diff --git a/plugins/cordova-plugin-splashscreen/doc/es/README.md b/plugins/cordova-plugin-splashscreen/doc/es/README.md new file mode 100644 index 00000000..1a94161a --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/es/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicación. + +## Instalación + + // 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 + + +## Plataformas soportadas + + * Amazon fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 y 8 + * Windows 8 + * Windows + * Explorador + +## Métodos + + * splashscreen.show + * splashscreen.hide + +### Rarezas Android + +En el `archivo config.xml`, es necesario agregar las siguientes preferencias: + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) para obtener más información. + +Preferencia "SplashMaintainAspectRatio" es opcional. Si establece en true, pantalla dibujable no es estirado para caber la pantalla, pero en su lugar simplemente "cover" la pantalla, como CSS "background-size: cover". Esto es muy útil cuando las imágenes de pantallas splash no distorsionadas de cualquier manera, por ejemplo cuando contienen texto o paisaje. Esta opción funciona mejor con imágenes que tienen bordes grandes (zonas seguras) que pueden ser recortadas con seguridad en pantallas con diferentes relaciones de aspecto. + +El plugin recarga splash dibujable cuando cambia de orientación, por lo que puede especificar diferente dibujo para orientaciones vertical y horizontal. + +### Navegador rarezas + +Puede utilizar las siguientes preferencias en el `archivo config.xml`: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS rarezas + + * `FadeSplashScreen` (booleano, por defecto `true`): establecida en `false` para evitar que la pantalla de bienvenida de descolorarse adentro y hacia fuera cuando cambia su estado de presentación. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (float, por defecto es `2`): especifica el número de segundos para que la pantalla se descolora efecto para ejecutar. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (booleano, por defecto `true`): establecida en `false` para ocultar la ruleta de la pantalla de bienvenida. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## 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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 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.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/es/index.md b/plugins/cordova-plugin-splashscreen/doc/es/index.md index 644bec3e..3295c27f 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/es/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/es/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-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 + cordova plugin add cordova-plugin-splashscreen ## Plataformas soportadas @@ -44,7 +44,8 @@ Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la En el archivo config.xml, tienes que añadir las siguientes preferencias: -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + < nombre de preferencia = "SplashScreen" value = "foo" / >< nombre de preferencia = "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. @@ -72,4 +73,4 @@ 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.
\ No newline at end of file +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. diff --git a/plugins/cordova-plugin-splashscreen/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/doc/fr/README.md new file mode 100644 index 00000000..65f58803 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/fr/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Ce plugin affiche et masque un écran de démarrage lors du lancement de l'application. + +## 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 + + +## Plates-formes supportées + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 et 8 + * Windows 8 + * Windows + * Navigateur + +## 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" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +Préférence de « SplashMaintainAspectRatio » est facultative. Si défini à true, écran de démarrage drawable n'est pas étirée pour s'adapter écran, mais plutôt simplement « couvre » l'écran, comme CSS "fond-taille : couverture". Ceci est très utile lorsque images écran de démarrage ne peut pas être déformées en quelque sorte, par exemple lorsqu'ils contiennent des décors ou texte. Ce paramètre fonctionne mieux avec des images qui ont des marges importantes (zones de sécurité) qui peuvent être recadrées en toute sécurité sur les écrans avec des proportions différentes. + +Le plugin recharge splash drawable chaque fois que l'orientation change, donc vous pouvez spécifier différents drawables pour les orientations portrait et paysage. + +### Bizarreries navigateur + +Vous pouvez utiliser les préférences suivantes dans votre `fichier config.xml`: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### Notes au sujet d'iOS + + * `FadeSplashScreen` (boolean, par défaut est `true`): la valeur `false` pour empêcher l'écran de démarrage de fading in et out lorsque son état d'affichage est modifié. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (float, la valeur par défaut `2`): spécifie le nombre de secondes que l'écran de démarrage s'estomper l'effet d'exécuter. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (boolean, par défaut est `true`): la valeur `false` pour masquer le cône de l'écran de démarrage. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## splashscreen.Hide + +Faire disparaître de l'écran de démarrage. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'écran de démarrage pendant deux secondes, ajouter un minuteur semblable à la suivante dans le gestionnaire d'événements `deviceready` : + + 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 l'événement `deviceready` est 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 dans le fichier `config.xml` automatiquement `show` le splash projettera immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu l'événement `deviceready`. Voir les [icônes et les écrans de démarrage](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 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.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/fr/index.md b/plugins/cordova-plugin-splashscreen/doc/fr/index.md index a898d80f..6d2fd088 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/fr/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/fr/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-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 + cordova plugin add cordova-plugin-splashscreen ## Plates-formes prises en charge @@ -44,9 +44,11 @@ Ce plugin affiche et masque un écran de démarrage lors du lancement de l'appli Dans votre fichier config.xml, vous devez ajouter les préférences suivantes : -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <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] . +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 @@ -54,22 +56,23 @@ Où foo est le nom du fichier splashscreen, préférablement un fichier de 9 cor Faire disparaître de l'écran de démarrage. - Navigator.SplashScreen.Hide() ; + 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 : +Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'écran de démarrage pendant deux secondes, ajouter un minuteur semblable à la suivante dans le gestionnaire d'événements `deviceready` : - setTimeout(function() {navigator.splashscreen.hide() ; - }, 2000) ; + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); ## splashscreen.Show Affiche l'écran de démarrage. - Navigator.SplashScreen.Show() ; + 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.
\ No newline at end of file +Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'à ce que l'application a commencé et l'événement `deviceready` est 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 dans le fichier `config.xml` automatiquement `show` le splash projettera immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu l'événement `deviceready`. 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. diff --git a/plugins/cordova-plugin-splashscreen/doc/it/README.md b/plugins/cordova-plugin-splashscreen/doc/it/README.md new file mode 100644 index 00000000..2a6c6ba4 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/it/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione. + +## Installazione + + // 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 + + +## Piattaforme supportate + + * Amazon fuoco OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 e 8 + * Windows 8 + * Windows + * Browser + +## 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" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" preferenza è facoltativo. Se impostato su true, schermata iniziale drawable non viene adattata per misura lo schermo, ma invece semplicemente "copre" lo schermo, come CSS "sfondo-dimensione: copertina". Questo è molto utile quando immagini schermata iniziale non possono essere distorta in qualche modo, per esempio quando contengono testo o scenario. Questa impostazione funziona meglio con immagini che hanno grandi margini (zone sicure) che possono essere ritagliati in modo sicuro su schermi con proporzioni diverse. + +Il plugin viene ricaricata splash drawable ogni volta che cambia orientamento, è possibile specificare diversi parte per orientamento verticale e orizzontale. + +### Stranezze browser + +Nel vostro `config. XML`, è possibile utilizzare le seguenti preferenze: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS stranezze + + * `FadeSplashScreen` (boolean, impostazioni predefinite a `true`): impostare su `false` per impedire che la schermata iniziale e scompaiono quando cambia il relativo stato di visualizzazione. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (float, il valore predefinito è `2`): specifica il numero di secondi per la schermata iniziale dissolvenza effetto da eseguire. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (boolean, impostazioni predefinite a `true`): impostare su `false` per nascondere la filatrice schermata iniziale. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## splashscreen.Hide + +Respingere la schermata iniziale. + + navigator.splashscreen.hide(); + + +### BlackBerry 10, WP8, iOS Quirk + +Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`: + + 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 l'app ha iniziato e ha generato l'evento `deviceready`. 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 nel `file config.xml` sarà automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/it/index.md b/plugins/cordova-plugin-splashscreen/doc/it/index.md index 2f6d2f1c..70435415 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/it/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/it/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione. ## Installazione - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## Piattaforme supportate @@ -44,9 +44,11 @@ Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell' Nel vostro config. xml, è necessario aggiungere le seguenti preferenze: -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <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] . +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 @@ -54,14 +56,15 @@ Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assi Respingere la schermata iniziale. - Navigator.SplashScreen.Hide(); + 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: +Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`: - setTimeout(function() {navigator.splashscreen.hide(); + setTimeout(function() { + navigator.splashscreen.hide(); }, 2000); @@ -69,7 +72,7 @@ Il `config.xml` di file `AutoHideSplashScreen` impostazione deve essere `false` Visualizza la schermata iniziale. - Navigator.SplashScreen.Show(); + 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.
\ No newline at end of file +L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando l'app ha iniziato e ha generato l'evento `deviceready`. 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 nel `file config.xml` sarà automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. 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. diff --git a/plugins/cordova-plugin-splashscreen/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/doc/ja/README.md new file mode 100644 index 00000000..a688b279 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ja/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +このプラグインが表示され、アプリケーションの起動中にスプラッシュ スクリーンを非表示にします。 + +## インストール + + // 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 + + +## サポートされているプラットフォーム + + * アマゾン火 OS + * アンドロイド + * ブラックベリー 10 + * iOS + * Windows Phone 7 と 8 + * Windows 8 + * Windows + * ブラウザー + +## メソッド + + * splashscreen.show + * splashscreen.hide + +### Android の癖 + +あなたの`config.xml`内の次の設定を追加する必要があります。 + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照してください。 + +"SplashMaintainAspectRatio"の設定はオプションです。 True の場合、スプラッシュ画面描画に設定画面を埋めるために拡大されませんが、代わりに単に「カバー」画面では、CSS のような場合「背景-サイズ: カバー」. これは、たとえば風景またはテキストが含まれている場合、任意の方法でスプラッシュ画面画像が歪むことができない非常に便利です。 この設定は、画面と異なる縦横比で安全にトリミングすることができます大規模なマージン (安全な地域) の画像に適しています。 + +縦長と横長の異なるドロウアブルを指定できるように、プラグインは向きを変更するたびにスプラッシュ ドロウアブルをリロードします。 + +### ブラウザーの癖 + +あなたの`config.xml`で次の設定を使用できます。 + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS の癖 + + * `FadeSplashScreen`(ブール値、既定で [ `true`): スプラッシュ画面がフェードインとフェードアウトの表示状態が変更されたときすることを防ぐために`false`に設定します。 + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration`(float, デフォルトは`2`): スプラッシュ画面の秒数のフェードを実行する効果を指定します。 + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner`(ブール値、既定で [ `true`): スプラッシュ スクリーン スピナーを非表示にするを`false`に設定します。 + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## 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(); + + +アプリが開始され、`deviceready` イベントが発生するまで、アプリケーションは `navigator.splashscreen.show()` を呼び出すことはできません。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 `config.xml` にいくつかの構成を提供するは自動的に `表示` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、`deviceready` イベントを受信する前に。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照してください。 この理由のためにアプリ起動時のスプラッシュ スクリーンを確認 `navigator.splashscreen.show()` をコールする必要がある可能性が高いです。
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/ja/index.md b/plugins/cordova-plugin-splashscreen/doc/ja/index.md index d96a6140..24e72e5a 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/ja/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/ja/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen このプラグインが表示され、アプリケーションの起動中にスプラッシュ スクリーンを非表示にします。 ## インストール - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## サポートされているプラットフォーム @@ -44,9 +44,11 @@ あなたの config.xml を以下の設定を追加する必要があります。 -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + -Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面][1]を参照してください。 +Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面][1] を参照してください。 [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html @@ -59,9 +61,11 @@ Foo ができれば 9 パッチファイル splashscreen ファイルの名前 ### ブラックベリー 10、WP8、iOS の気まぐれ -`config.xml`ファイルの `AutoHideSplashScreen` 設定する必要があります `false` 。 遅延を 2 秒間スプラッシュ スクリーンを非表示、タイマーを追加しますで次のように `deviceready` イベント ハンドラー。 +`config.xml` ファイルの `AutoHideSplashScreen` の設定は `false` である必要があります。 遅延を 2 秒間スプラッシュ スクリーンを非表示に `deviceready` イベント ハンドラーで、次のようタイマーを追加します。 - setTimeout(function() {navigator.splashscreen.hide();}, 2000年); + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); ## splashscreen.show @@ -71,4 +75,4 @@ Foo ができれば 9 パッチファイル splashscreen ファイルの名前 navigator.splashscreen.show(); -アプリケーションを呼び出すことはできません `navigator.splashscreen.show()` 、アプリが開始されるまで、 `deviceready` イベントが発生します。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 いくつかの構成を提供する `config.xml` は自動的に `show` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、受信する前に、 `deviceready` イベント。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面][1]を参照してください。 このような理由から、それは可能性を呼び出す必要があります `navigator.splashscreen.show()` アプリ起動時のスプラッシュ画面を見やすくします。
\ No newline at end of file +アプリが開始され、`deviceready` イベントが発生するまで、アプリケーションは `navigator.splashscreen.show()` を呼び出すことはできません。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 `config.xml` にいくつかの構成を提供するは自動的に `表示` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、`deviceready` イベントを受信する前に。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面][1] を参照してください。 この理由のためにアプリ起動時のスプラッシュ スクリーンを確認 `navigator.splashscreen.show()` をコールする必要がある可能性が高いです。 diff --git a/plugins/cordova-plugin-splashscreen/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/doc/ko/README.md new file mode 100644 index 00000000..5e10d207 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/ko/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +이 플러그인은 표시 하 고 응용 프로그램 실행 하는 동안 시작 화면을 숨깁니다. + +## 설치 + + // 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 + + +## 지원 되는 플랫폼 + + * 아마존 화재 운영 체제 + * 안 드 로이드 + * 블랙베리 10 + * iOS + * Windows Phone 7과 8 + * 윈도우 8 + * 윈도우 + * 브라우저 + +## 메서드 + + * splashscreen.show + * splashscreen.hide + +### 안 드 로이드 단점 + +`Config.xml`에 다음 환경 설정에 추가 해야 합니다. + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +여기서 foo splashscreen 파일, 선호 9 패치 파일의 이름입니다. 적절 한 폴더 아래 res/xml 디렉토리에 splashcreen 파일을 추가 해야 합니다. 두 번째 매개 변수는 splashscreen 얼마나 밀리초 단위로 표시 됩니다 나타냅니다. 3000 ms 기본값으로 사용 됩니다. 자세한 내용은 [아이콘 및 시작 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 하십시오. + +"SplashMaintainAspectRatio" 취향은 선택 사항입니다. Drawable, 시작 화면 설정 화면에 맞게 확장 되지 하지만 대신 단순히 "커버" CSS 같은 화면 "배경-크기: 덮개". 시작 화면 이미지 예: 풍경 또는 텍스트를 포함 하는 경우 어떤 식으로든에서 왜곡 될 수 없는 경우에 매우 유용 합니다. 이 설정은 큰 여백 (안전 지역) 안전 하 게 다른 종횡비와 화면에 자를 수 있는 이미지에 가장 적합 합니다. + +플러그인 다시 로드 스플래시 drawable 방향이 변경 될 때마다 세로 및 가로 방향에 대 한 다른 drawables를 지정할 수 있도록 합니다. + +### 브라우저 만지면 + +`Config.xml`에 다음 기본 설정을 사용할 수 있습니다. + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS 단점 + + * `FadeSplashScreen` (부울 `true`로 기본값): 시작 화면 표시 상태로 변경 될 때 밖으로 퇴색 하지 않도록 하려면 `false` 로 설정. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (부동, `2`기본값): 시작 화면에 대 한 초 페이드 효과를 실행 하는 지정 합니다. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (부울 `true`로 기본값): 스플래시 화면 회전자를 숨기려면 `false` 로 설정. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## 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(); + + +응용 프로그램 시작 및 `deviceready` 이벤트는 발생 될 때까지 응용 프로그램이 `navigator.splashscreen.show()`을 호출할 수 없습니다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. `config.xml에서` 몇 가지 구성을 제공 하 자동으로 스플래시 `표시` 화면 애플 리 케이 션 출시 직후와 그것은 완벽 하 게 시작 하 고 `deviceready` 이벤트를 받은 전에. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 하십시오. 이러한 이유로, 그것은 가능성이 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 `navigator.splashscreen.show()`를 호출 해야입니다.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/ko/index.md b/plugins/cordova-plugin-splashscreen/doc/ko/index.md index 86a4e837..6a0ea989 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/ko/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/ko/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen 이 플러그인은 표시 하 고 응용 프로그램 실행 하는 동안 시작 화면을 숨깁니다. ## 설치 - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## 지원 되는 플랫폼 @@ -44,7 +44,9 @@ 당신의 config.xml에 다음 환경 설정에 추가 해야 합니다. -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + 여기서 foo splashscreen 파일, 선호 9 패치 파일의 이름입니다. 적절 한 폴더 아래 res/xml 디렉토리에 splashcreen 파일을 추가 해야 합니다. 두 번째 매개 변수는 splashscreen 얼마나 밀리초 단위로 표시 됩니다 나타냅니다. 3000 ms 기본값으로 사용 됩니다. 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오. @@ -59,9 +61,10 @@ ### 블랙베리 10, WP8, iOS 특질 -`config.xml`파일의 `AutoHideSplashScreen` 설정을 해야 합니다 `false` . 2 초 동안 시작 화면을 숨기고 지연에 다음과 같이 타이머 추가 `deviceready` 이벤트 처리기: +`config.xml` 파일의 `AutoHideSplashScreen` 설정을 `false` 여야 합니다. 2 초 동안 시작 화면을 숨기고 지연, `deviceready` 이벤트 처리기에서 다음과 같은 타이머를 추가: - setTimeout(function() {navigator.splashscreen.hide(); + setTimeout(function() { + navigator.splashscreen.hide(); }, 2000); @@ -72,4 +75,4 @@ navigator.splashscreen.show(); -응용 프로그램 호출할 수 없습니다 `navigator.splashscreen.show()` 응용 프로그램은 시작 될 때까지 및 `deviceready` 이벤트를 해 고 했다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. 몇 가지 구성을 제공 `config.xml` 자동으로 `show` 시작 화면 응용 프로그램 실행 후 즉시 및 그것은 완벽 하 게 시작 하 고 받은 전에 `deviceready` 이벤트. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오. 이러한 이유로, 그것은 가능성이 호출 해야 `navigator.splashscreen.show()` 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 합니다.
\ No newline at end of file +응용 프로그램 시작 및 `deviceready` 이벤트는 발생 될 때까지 응용 프로그램이 `navigator.splashscreen.show()`을 호출할 수 없습니다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. `config.xml에서` 몇 가지 구성을 제공 하 자동으로 스플래시 `표시` 화면 애플 리 케이 션 출시 직후와 그것은 완벽 하 게 시작 하 고 `deviceready` 이벤트를 받은 전에. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오. 이러한 이유로, 그것은 가능성이 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 `navigator.splashscreen.show()`를 호출 해야입니다. diff --git a/plugins/cordova-plugin-splashscreen/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/doc/pl/README.md new file mode 100644 index 00000000..0156be56 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/pl/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji. + +## Instalacja + + // 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 + + +## Obsługiwane platformy + + * Amazon Fire OS + * Android + * BlackBerry 10 + * iOS + * Windows Phone 7 i 8 + * Windows 8 + * Windows + * Przeglądarka + +## Metody + + * splashscreen.show + * splashscreen.Hide + +### Dziwactwa Androida + +W pliku `config.xml`musisz dodać następujące preferencje: + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +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](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). + +"SplashMaintainAspectRatio" preferencji jest opcjonalne. Jeśli zestaw na wartość true, ekran powitalny dolarowe nie jest rozciągnięty do ekranów, ale zamiast po prostu "obejmuje" ekranu, jak CSS "tło-rozmiar: okładka". Jest to bardzo przydatne, kiedy opryskać tęcza obrazy nie zniekształcony w jakikolwiek sposób, na przykład, gdy zawierają one dekoracje lub tekst. To ustawienie działa najlepiej z obrazów, które mają duże marginesy (bezpiecznych obszarów), które mogą być bezpiecznie przycięte na ekrany z różnych proporcji. + +Plugin ładuje rozchlapać dolarowe, gdy zmienia orientację, tak można określić różnych drawables do orientacji pionowej i poziomej. + +### Quirks przeglądarki + +W pliku `config.xml`można użyć następujące preferencje: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### Dziwactwa iOS + + * `FadeSplashScreen` (wartość logiczna, domyślnie `true`): zestaw na `false` , aby zapobiec Znikająca i odkładane po zmianie stanu wyświetlania ekranu powitalnego. + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration` (float, domyślnie `2`): określa liczbę sekund dla ekranu powitalnego zanikanie efekt do wykonać. + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner` (wartość logiczna, domyślnie `true`): zestaw na `false` , aby ukryć pokrętła ekran powitalny. + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## splashscreen.Hide + +Odrzucić ten opryskaæ têcza. + + navigator.splashscreen.hide(); + + +### Jeżyna 10, WP8, iOS dziwactwo + +Plik `config.xml` `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żna wywołać `navigator.splashscreen.show()`, aż aplikacja została uruchomiona i zdarzenie `deviceready` 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 `pliku config.xml` będzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed pełni rozpoczął i odebrał zdarzenie `deviceready`. Aby uzyskać więcej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Z tego powodu jest mało prawdopodobne, należy zadzwonić `navigator.splashscreen.show()`, aby wyświetlić ekran powitalny dla uruchamiania aplikacji.
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/pl/index.md b/plugins/cordova-plugin-splashscreen/doc/pl/index.md index c23a332e..33045cb7 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/pl/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/pl/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji. ## Instalacja - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## Obsługiwane platformy @@ -44,9 +44,11 @@ Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji. W pliku config.xml musisz dodać następujące preferencje: -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <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] . +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 @@ -54,14 +56,15 @@ Gdzie foo jest nazwą pliku ekranu powitalnego, najlepiej 9 łatce. Upewnij się Odrzucić ten opryskaæ têcza. - Navigator.splashscreen.Hide(); + 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ń: +Plik `config.xml` `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(); + setTimeout(function() { + navigator.splashscreen.hide(); }, 2000); @@ -69,7 +72,7 @@ Odrzucić ten opryskaæ têcza. Wyświetla ekran powitalny. - Navigator.splashscreen.show(); + 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.
\ No newline at end of file +Aplikacja nie można wywołać `navigator.splashscreen.show()`, aż aplikacja została uruchomiona i zdarzenie `deviceready` 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 `pliku config.xml` będzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed pełni rozpoczął i odebrał zdarzenie `deviceready`. 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. diff --git a/plugins/org.apache.cordova.splashscreen/doc/ru/index.md b/plugins/cordova-plugin-splashscreen/doc/ru/index.md index 1f872273..635c22d8 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/ru/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/ru/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen Этот плагин отображает и скрывает экран-заставку при запуске приложения. ## Установка - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## Поддерживаемые платформы @@ -72,4 +72,4 @@ Navigator.SplashScreen.Show(); -Ваше приложение не может вызвать `navigator.splashscreen.show()` до тех пор, пока приложение началась и `deviceready` событие инициировано. Но поскольку обычно экран-заставка должен быть видимым до начала вашего приложения, что казалось бы поражение цели экрана-заставки. Предоставление некоторых конфигурации в `config.xml` будет автоматически `show` экран-заставку сразу же после запуска вашего приложения и перед его полностью запущен и получил `deviceready` событие. Увидеть [иконки и заставки][1] для получения дополнительной информации на делать этой конфигурации. По этой причине маловероятно, вам нужно вызвать `navigator.splashscreen.show()` для отображения экрана-заставки для запуска приложения.
\ No newline at end of file +Ваше приложение не может вызвать `navigator.splashscreen.show()` до тех пор, пока приложение началась и `deviceready` событие инициировано. Но поскольку обычно экран-заставка должен быть видимым до начала вашего приложения, что казалось бы поражение цели экрана-заставки. Предоставление некоторых конфигурации в `config.xml` будет автоматически `show` экран-заставку сразу же после запуска вашего приложения и перед его полностью запущен и получил `deviceready` событие. Увидеть [иконки и заставки][1] для получения дополнительной информации на делать этой конфигурации. По этой причине маловероятно, вам нужно вызвать `navigator.splashscreen.show()` для отображения экрана-заставки для запуска приложения. diff --git a/plugins/cordova-plugin-splashscreen/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/doc/zh/README.md new file mode 100644 index 00000000..da37405b --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/doc/zh/README.md @@ -0,0 +1,119 @@ +<!-- +# 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. +--> + +# cordova-plugin-splashscreen + +[](https://travis-ci.org/apache/cordova-plugin-splashscreen) + +這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。 + +## 安裝 + + // 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 + + +## 支援的平臺 + + * 亞馬遜火 OS + * Android 系統 + * 黑莓 10 + * iOS + * Windows Phone 7 和 8 + * Windows 8 + * Windows + * 瀏覽器 + +## 方法 + + * splashscreen.show + * splashscreen.hide + +### Android 的怪癖 + +在你的`config.xml`,您需要添加以下優惠: + + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + <preference name="SplashMaintainAspectRatio" value="true|false" /> + + +美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 + +"SplashMaintainAspectRatio"首選項是可選的。 如果設置為 true,可繪製的初始螢幕不會拉伸以適合螢幕,但相反只是"覆蓋"螢幕,像 CSS"背景-大小: 蓋"。 這是非常有用的不能以任何方式,例如當他們包含文本或風景畸變閃屏圖像時。 此設置適用于有大利潤 (安全區),可以安全地裁剪不同長寬比與螢幕上的圖像。 + +該外掛程式重新載入初始可繪製只要方向發生變化,所以您可以指定不同的畫板為縱向和橫向方向。 + +### 瀏覽器的怪癖 + +你可以用你的`config.xml`下列優先選項: + + <platform name="browser"> + <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" --> + <preference name="SplashScreenDelay" value="10000" /> <!-- 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> + + +### iOS 的怪癖 + + * `FadeSplashScreen`(預設為`true`的布林值): 設置為`false` ,以防止出現閃屏衰落和退出其顯示狀態發生變化時。 + + <preference name="FadeSplashScreen" value="false"/> + + + * `FadeSplashScreenDuration`(float,預設為`2`): 指定的閃屏秒數淡出效果來執行。 + + <preference name="FadeSplashScreenDuration" value="4"/> + + + * `ShowSplashScreenSpinner`(boolean, `true`的布林值): 設置為`false`來隱藏初始螢幕微調框。 + + <preference name="ShowSplashScreenSpinner" value="false"/> + + +## splashscreen.hide + +解雇的閃屏。 + + navigator.splashscreen.hide(); + + +### 黑莓 10,WP8,iOS 怪癖 + +`config.xml` 檔 `AutoHideSplashScreen` 設置必須是 `假` 的。 若要延遲兩秒鐘隱藏的閃屏,`deviceready` 事件處理常式中添加一個計時器,如下所示: + + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); + + +## splashscreen.show + +顯示初始螢幕。 + + navigator.splashscreen.show(); + + +您的應用程式無法調用 `navigator.splashscreen.show()`,直到該應用程式已啟動,且觸發了 `deviceready` 事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 中的會自動 `show` 初始螢幕您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 出於此原因,不太可能您需要調用 `navigator.splashscreen.show()`,使初始螢幕可見為應用程式啟動。
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/doc/zh/index.md b/plugins/cordova-plugin-splashscreen/doc/zh/index.md index 40e66918..efb309d0 100644 --- a/plugins/org.apache.cordova.splashscreen/doc/zh/index.md +++ b/plugins/cordova-plugin-splashscreen/doc/zh/index.md @@ -17,13 +17,13 @@ under the License. --> -# org.apache.cordova.splashscreen +# cordova-plugin-splashscreen 這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。 ## 安裝 - cordova plugin add org.apache.cordova.splashscreen + cordova plugin add cordova-plugin-splashscreen ## 支援的平臺 @@ -44,9 +44,11 @@ 在你的 config.xml,您需要添加以下優惠: -`<preference name="SplashScreen" value="foo" />` `<preference name="SplashScreenDelay" value="10000" />` + <preference name="SplashScreen" value="foo" /> + <preference name="SplashScreenDelay" value="10000" /> + -美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見[圖示和啟動畫面][1]。 +美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見 [圖示和啟動畫面][1]。 [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html @@ -54,21 +56,23 @@ 解雇的閃屏。 - navigator.splashscreen.hide() ; + navigator.splashscreen.hide(); ### 黑莓 10,WP8,iOS 怪癖 -`config.xml`檔的 `AutoHideSplashScreen` 設置必須為 `false` 。 若要延遲兩秒鐘隱藏的閃屏,添加如下所示在計時器 `deviceready` 事件處理常式: +`config.xml` 檔 `AutoHideSplashScreen` 設置必須是 `假` 的。 若要延遲兩秒鐘隱藏的閃屏,`deviceready` 事件處理常式中添加一個計時器,如下所示: - setTimeout(function() {navigator.splashscreen.hide() ;},2000年) ; + setTimeout(function() { + navigator.splashscreen.hide(); + }, 2000); ## splashscreen.show 顯示初始螢幕。 - navigator.splashscreen.show() ; + navigator.splashscreen.show(); -您的應用程式無法調用 `navigator.splashscreen.show()` 直到應用程式已經開始, `deviceready` 觸發了事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 將自動 `show` 閃屏您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱[圖示和啟動畫面][1]。 出於這個原因,它不太可能您需要調用 `navigator.splashscreen.show()` ,使初始螢幕可見為應用程式啟動。
\ No newline at end of file +您的應用程式無法調用 `navigator.splashscreen.show()`,直到該應用程式已啟動,且觸發了 `deviceready` 事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 中的會自動 `show` 初始螢幕您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱 [圖示和啟動畫面][1]。 出於此原因,不太可能您需要調用 `navigator.splashscreen.show()`,使初始螢幕可見為應用程式啟動。 diff --git a/plugins/cordova-plugin-splashscreen/package.json b/plugins/cordova-plugin-splashscreen/package.json new file mode 100644 index 00000000..447ac7e9 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/package.json @@ -0,0 +1,45 @@ +{ + "name": "cordova-plugin-splashscreen", + "version": "2.1.0", + "description": "Cordova Splashscreen Plugin", + "cordova": { + "id": "cordova-plugin-splashscreen", + "platforms": [ + "android", + "amazon-fireos", + "ubuntu", + "ios", + "blackberry10", + "wp8", + "windows8", + "windows", + "tizen" + ] + }, + "repository": { + "type": "git", + "url": "https://github.com/apache/cordova-plugin-splashscreen" + }, + "keywords": [ + "cordova", + "splashscreen", + "ecosystem:cordova", + "cordova-android", + "cordova-amazon-fireos", + "cordova-ubuntu", + "cordova-ios", + "cordova-blackberry10", + "cordova-wp8", + "cordova-windows8", + "cordova-windows", + "cordova-tizen" + ], + "engines": [ + { + "name": "cordova-android", + "version": ">=3.6.0" + } + ], + "author": "Apache Software Foundation", + "license": "Apache 2.0" +} diff --git a/plugins/org.apache.cordova.splashscreen/plugin.xml b/plugins/cordova-plugin-splashscreen/plugin.xml index fd70fd2c..e6370fa9 100644 --- a/plugins/org.apache.cordova.splashscreen/plugin.xml +++ b/plugins/cordova-plugin-splashscreen/plugin.xml @@ -19,8 +19,8 @@ --> <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" - id="org.apache.cordova.splashscreen" - version="1.0.0"> + id="cordova-plugin-splashscreen" + version="2.1.0"> <name>Splashscreen</name> <description>Cordova Splashscreen Plugin</description> <license>Apache 2.0</license> @@ -58,7 +58,7 @@ <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" /> @@ -74,8 +74,10 @@ </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> @@ -88,19 +90,6 @@ </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="/*"> @@ -111,12 +100,20 @@ </config-file> <source-file src="src/wp/SplashScreen.cs" /> + <source-file src="src/wp/ResolutionHelper.cs" /> </platform> <!-- windows8 --> <platform name="windows8"> - <js-module src="www/windows8/SplashScreenProxy.js" name="SplashScreenProxy"> + <js-module src="www/windows/SplashScreenProxy.js" name="SplashScreenProxy"> + <merges target="" /> + </js-module> + </platform> + + <!-- windows --> + <platform name="windows"> + <js-module src="www/windows/SplashScreenProxy.js" name="SplashScreenProxy"> <merges target="" /> </js-module> </platform> @@ -127,4 +124,11 @@ <runs /> </js-module> </platform> + + <!-- browser --> + <platform name="browser"> + <js-module src="src/browser/SplashScreenProxy.js" name="SplashScreenProxy"> + <runs /> + </js-module> + </platform> </plugin> diff --git a/plugins/org.apache.cordova.splashscreen/src/android/SplashScreen.java b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java index ec3ad931..75ad724c 100644 --- a/plugins/org.apache.cordova.splashscreen/src/android/SplashScreen.java +++ b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java @@ -23,12 +23,14 @@ import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.res.Configuration; import android.graphics.Color; import android.os.Handler; import android.view.Display; import android.view.View; -import android.view.ViewGroup; +import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; +import android.widget.ImageView; import android.widget.LinearLayout; import org.apache.cordova.CallbackContext; @@ -46,7 +48,17 @@ public class SplashScreen extends CordovaPlugin { private static ProgressDialog spinnerDialog; private static boolean firstShow = true; - // Helper to be compile-time compatable with both Cordova 3.x and 4.x. + /** + * 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); @@ -64,7 +76,7 @@ public class SplashScreen extends CordovaPlugin { getView().setVisibility(View.INVISIBLE); int drawableId = preferences.getInteger("SplashDrawableId", 0); if (drawableId == 0) { - String splashResource = preferences.getString("SplashScreen", null); + String splashResource = preferences.getString("SplashScreen", "screen"); if (splashResource != null) { drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName()); if (drawableId == 0) { @@ -74,11 +86,21 @@ public class SplashScreen extends CordovaPlugin { } } + // Save initial orientation. + orientation = cordova.getActivity().getResources().getConfiguration().orientation; + firstShow = false; loadSpinner(); showSplashScreen(true); } + /** + * Shorter way to check value of "SplashMaintainAspectRatio" preference. + */ + private boolean isMaintainAspectRatio () { + return preferences.getBoolean("SplashMaintainAspectRatio", false); + } + @Override public void onPause(boolean multitasking) { if (HAS_BUILT_IN_SPLASH_SCREEN) { @@ -95,7 +117,8 @@ public class SplashScreen extends CordovaPlugin { } // hide the splash screen to avoid leaking a window this.removeSplashScreen(); - firstShow = true; + // If we set this to true onDestroy, we lose track when we go from page to page! + //firstShow = true; } @Override @@ -152,12 +175,28 @@ public class SplashScreen extends CordovaPlugin { 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 = preferences.getInteger("SplashDrawableId", 0); + if (drawableId != 0) { + splashImageView.setImageDrawable(cordova.getActivity().getResources().getDrawable(drawableId)); + } + } + } + } + private void removeSplashScreen() { cordova.getActivity().runOnUiThread(new Runnable() { public void run() { if (splashDialog != null && splashDialog.isShowing()) { splashDialog.dismiss(); splashDialog = null; + splashImageView = null; } } }); @@ -172,7 +211,7 @@ public class SplashScreen extends CordovaPlugin { final int drawableId = preferences.getInteger("SplashDrawableId", 0); // If the splash dialog is showing don't try to show it again - if (this.splashDialog != null && splashDialog.isShowing()) { + if (splashDialog != null && splashDialog.isShowing()) { return; } if (drawableId == 0 || (splashscreenTime <= 0 && hideAfterDelay)) { @@ -185,18 +224,26 @@ public class SplashScreen extends CordovaPlugin { Display display = cordova.getActivity().getWindowManager().getDefaultDisplay(); Context context = webView.getContext(); - // Create the layout for the dialog - LinearLayout root = new LinearLayout(context); - root.setMinimumHeight(display.getHeight()); - root.setMinimumWidth(display.getWidth()); - root.setOrientation(LinearLayout.VERTICAL); + // 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); - // TODO: Use the background color of the webview's parent instead of using the - // preference. - root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK)); - root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); - root.setBackgroundResource(drawableId); + 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); @@ -206,7 +253,7 @@ public class SplashScreen extends CordovaPlugin { splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } - splashDialog.setContentView(root); + splashDialog.setContentView(splashImageView); splashDialog.setCancelable(false); splashDialog.show(); diff --git a/plugins/org.apache.cordova.splashscreen/src/blackberry10/index.js b/plugins/cordova-plugin-splashscreen/src/blackberry10/index.js index bd7e48c8..bd7e48c8 100644 --- a/plugins/org.apache.cordova.splashscreen/src/blackberry10/index.js +++ b/plugins/cordova-plugin-splashscreen/src/blackberry10/index.js diff --git a/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js new file mode 100644 index 00000000..76d51bfa --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js @@ -0,0 +1,138 @@ +/* + * + * 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 splash = null; // +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 configHelper = cordova.require('cordova/confighelper'); + +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"; + + localSplashImage = document.createElement("img"); + localSplashImage.src = imageSrc; + localSplashImage.style.position = "absolute"; + + updateImageLocation(); + + localSplash.appendChild(localSplashImage); + document.body.appendChild(localSplash); + } + }, + hide: function () { + if(localSplash) { + window.removeEventListener("resize", onResize, false); + document.body.removeChild(localSplash); + localSplash = null; + } + } +}; + +/** + * 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; + imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc; + bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor; + splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth; + splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight; + } catch(e) { + var msg = '[Browser][SplashScreen] Error occured on loading preferences from config.xml: ' + JSON.stringify(e); + console.error(msg); + 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 splashcreen if it is enabled. + */ +(function initAndShow() { + configHelper.readConfig(function(config) { + readPreferencesFromCfg(config); + showAndHide(); + }, function(err) { + console.error(err); + }); +})(); + +module.exports = SplashScreen; + +require("cordova/exec/proxy").add("SplashScreen", SplashScreen); + diff --git a/plugins/org.apache.cordova.splashscreen/src/ios/CDVSplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h index 0d6ae397..3feede64 100644 --- a/plugins/org.apache.cordova.splashscreen/src/ios/CDVSplashScreen.h +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h @@ -27,7 +27,7 @@ typedef struct { BOOL iPhone6; BOOL iPhone6Plus; BOOL retina; - + } CDV_iOSDevice; @interface CDVSplashScreen : CDVPlugin { diff --git a/plugins/org.apache.cordova.splashscreen/src/ios/CDVSplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m index c28ae2f5..43b356ad 100644 --- a/plugins/org.apache.cordova.splashscreen/src/ios/CDVSplashScreen.m +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m @@ -20,6 +20,7 @@ #import "CDVSplashScreen.h" #import <Cordova/CDVViewController.h> #import <Cordova/CDVScreenOrientationDelegate.h> +#import "CDVViewController+SplashScreen.h" #define kSplashScreenDurationDefault 0.25f @@ -68,6 +69,16 @@ * 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) ? + [(CDVViewController *)self.viewController shouldAutorotateDefaultValue] : + NO; + + [(CDVViewController *)self.viewController setEnabledAutorotation:autorotateValue]; + NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]]; UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray; @@ -107,6 +118,8 @@ - (void)destroyViews { + [(CDVViewController *)self.viewController setEnabledAutorotation:[(CDVViewController *)self.viewController shouldAutorotateDefaultValue]]; + [_imageView removeFromSuperview]; [_activityView removeFromSuperview]; _imageView = nil; @@ -204,7 +217,7 @@ // Sets the view's frame and image. - (void)updateImage { - NSString* imageName = [self getImageName:self.viewController.interfaceOrientation delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]]; + NSString* imageName = [self getImageName:[[UIApplication sharedApplication] statusBarOrientation] delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]]; if (![imageName isEqualToString:_curImageName]) { UIImage* img = [UIImage imageNamed:imageName]; @@ -289,19 +302,28 @@ } else if (fadeDuration == 0) { [self destroyViews]; } else { - [UIView transitionWithView:self.viewController.view - duration:fadeDuration - options:UIViewAnimationOptionTransitionNone - animations:^(void) { - [_imageView setAlpha:0]; - [_activityView setAlpha:0]; - } - completion:^(BOOL finished) { - if (finished) { - [self destroyViews]; - } - } - ]; + __weak __typeof(self) weakSelf = self; + + [UIView transitionWithView:self.viewController.view + duration:fadeDuration + options:UIViewAnimationOptionTransitionNone + animations:^(void) { + __typeof(self) strongSelf = weakSelf; + if (strongSelf != nil) { + dispatch_async(dispatch_get_main_queue(), ^{ + [strongSelf->_activityView setAlpha:0]; + [strongSelf->_imageView setAlpha:0]; + }); + } + } + completion:^(BOOL finished) { + if (finished) { + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf destroyViews]; + }); + } + } + ]; } } diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h new file mode 100644 index 00000000..a948ea31 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h @@ -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 diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m new file mode 100644 index 00000000..5736b6f2 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m @@ -0,0 +1,82 @@ +/* + 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)); + 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 diff --git a/plugins/org.apache.cordova.splashscreen/src/tizen/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js index fbd9f35f..fbd9f35f 100644 --- a/plugins/org.apache.cordova.splashscreen/src/tizen/SplashScreenProxy.js +++ b/plugins/cordova-plugin-splashscreen/src/tizen/SplashScreenProxy.js diff --git a/plugins/org.apache.cordova.splashscreen/src/ubuntu/splashscreen.cpp b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp index 1c9ecac8..1c9ecac8 100644 --- a/plugins/org.apache.cordova.splashscreen/src/ubuntu/splashscreen.cpp +++ b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.cpp diff --git a/plugins/org.apache.cordova.splashscreen/src/ubuntu/splashscreen.h b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h index 1d437f84..1d437f84 100644 --- a/plugins/org.apache.cordova.splashscreen/src/ubuntu/splashscreen.h +++ b/plugins/cordova-plugin-splashscreen/src/ubuntu/splashscreen.h diff --git a/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs new file mode 100644 index 00000000..2c02e744 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs @@ -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"); + } + } + } +} diff --git a/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs new file mode 100644 index 00000000..680a8058 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs @@ -0,0 +1,252 @@ +/* + 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 System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using Microsoft.Phone.Info; +using System.Windows.Controls.Primitives; +using System.Diagnostics; +using System.Windows.Media.Imaging; +using System.Windows.Resources; +using System.IO; +using System.Xml.Linq; +using System.Linq; +using System.Windows.Threading; + +namespace WPCordovaClassLib.Cordova.Commands +{ + /// <summary> + /// Listens for changes to the state of the battery on the device. + /// Currently only the "isPlugged" parameter available via native APIs. + /// </summary> + public class SplashScreen : BaseCommand + { + private Popup popup; + + // Time until we dismiss the splashscreen + private int prefDelay = 3000; + + // Whether we hide it by default + private bool prefAutoHide = true; + + // Path to image to use + private string prefImagePath = "SplashScreenImage.jpg"; + + // static because autodismiss is only ever applied once, at app launch + // subsequent page loads should not cause the SplashScreen to be shown. + private static bool WasShown = false; + + public SplashScreen() + { + 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, + HorizontalAlignment = HorizontalAlignment.Stretch, + VerticalAlignment = VerticalAlignment.Center + + }; + } + + public override void OnInit() + { + // we only want to autoload on the first page load. + // but OnInit is called for every page load. + if (!SplashScreen.WasShown) + { + SplashScreen.WasShown = true; + show(); + } + } + + private void LoadConfigPrefs() + { + StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("config.xml", UriKind.Relative)); + if (streamInfo != null) + { + using (StreamReader sr = new StreamReader(streamInfo.Stream)) + { + //This will Read Keys Collection for the xml file + XDocument configFile = XDocument.Parse(sr.ReadToEnd()); + + string configAutoHide = configFile.Descendants() + .Where(x => (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 => (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 => (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) + { + popup.Child.Opacity = 0; + + Storyboard story = new Storyboard(); + DoubleAnimation animation = new DoubleAnimation() + { + From = 0.0, + To = 1.0, + Duration = new Duration(TimeSpan.FromSeconds(0.2)) + }; + + Storyboard.SetTarget(animation, popup.Child); + Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); + story.Children.Add(animation); + + story.Begin(); + + popup.IsOpen = true; + + if (prefAutoHide) + { + StartAutoHideTimer(); + } + } + }); + } + + public void hide(string options = null) + { + Deployment.Current.Dispatcher.BeginInvoke(() => + { + if (popup.IsOpen) + { + popup.Child.Opacity = 1.0; + + Storyboard story = new Storyboard(); + DoubleAnimation animation = new DoubleAnimation() + { + From = 1.0, + To = 0.0, + Duration = new Duration(TimeSpan.FromSeconds(0.4)) + }; + + Storyboard.SetTarget(animation, popup.Child); + Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity")); + story.Children.Add(animation); + story.Completed += (object sender, EventArgs e) => + { + popup.IsOpen = false; + }; + story.Begin(); + } + }); + } + + private void StartAutoHideTimer() + { + var timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(prefDelay) }; + timer.Tick += (object sender, EventArgs e) => + { + hide(); + timer.Stop(); + }; + timer.Start(); + } + } +} diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata index 2dd325a0..2dd325a0 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout index 7e4cdb93..7e4cdb93 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme index 13f9a157..13f9a157 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore new file mode 100644 index 00000000..c795b054 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore @@ -0,0 +1 @@ +build
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m index 1637d247..1637d247 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h index be4a7883..4756c79e 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h @@ -6,9 +6,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m index b5a1b23e..b5a1b23e 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist new file mode 100644 index 00000000..95c8addb --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist @@ -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> diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj index ce820d81..ce820d81 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 8f912784..8f912784 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout index 7e4cdb93..7e4cdb93 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme index b97b8633..b97b8633 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme index 6a2a5261..6a2a5261 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme +++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/README.md new file mode 100644 index 00000000..97ee9dff --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/README.md @@ -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 diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md new file mode 100644 index 00000000..9c7f0a4f --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md @@ -0,0 +1,39 @@ +<!-- +# 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 für CDVSplashScreen + +Sie müssen installieren `node.js` in `Cordova-Ios` zu ziehen. + +Installieren Sie Cordova-Ios zum ersten Mal: + + npm install + + +... im aktuellen Ordner. + +# Testen von Xcode + + 1. Starten Sie die Datei `CDVSplashScreenTest.xcworkspace` . + 2. Wählen Sie im Dropdown-Schema "CDVSplashScreenLibTests" + 3. Klicken Sie und halten Sie auf den `Play` -Button und wählen Sie das `Schraubenschlüssel` -Symbol zum Ausführen der tests + +# Tests von der Befehlszeile aus + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md new file mode 100644 index 00000000..2176c921 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# Pruebas de iOS para CDVSplashScreen + +Necesita instalar `node.js` en `Córdoba-ios`. + +Primero instalar cordova-ios: + + npm install + + +... en la carpeta actual. + +# Prueba de Xcode + + 1. Iniciar el archivo `CDVSplashScreenTest.xcworkspace` . + 2. Elija "CDVSplashScreenLibTests" en el menú de lista desplegable esquema + 3. Haga clic y mantenga el botón de `Play` y elegir el icono de `llave inglesa` para ejecutar las pruebas + +# Pruebas desde la línea de comandos + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md new file mode 100644 index 00000000..0dbbd0d2 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# Tests d'iOS pour CDVSplashScreen + +Vous devez installer `node.js` à `cordova-ios`. + +Commencez par installer cordova-ios : + + npm install + + +... dans le dossier actuel. + +# Tests de Xcode + + 1. Lancez le fichier `CDVSplashScreenTest.xcworkspace` . + 2. Choisissez « CDVSplashScreenLibTests » dans le menu déroulant de régime + 3. Cliquez et maintenez sur la touche `Play` et cliquez sur l'icône de `clé` pour exécuter les tests + +# Test de la ligne de commande + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md new file mode 100644 index 00000000..2a42df67 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# Test di iOS per CDVSplashScreen + +È necessario installare `node. js` per tirare in `cordova-ios`. + +In primo luogo installare cordova-ios: + + npm install + + +... nella cartella corrente. + +# Test da Xcode + + 1. Lanciare il file `CDVSplashScreenTest.xcworkspace` . + 2. Scegli "CDVSplashScreenLibTests" dal menu a discesa Schema + 3. Fare clic e tenere premuto il pulsante `Play` e scegliere l'icona della `chiave inglese` per eseguire i test + +# Test dalla riga di comando + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md new file mode 100644 index 00000000..011b8242 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# CDVSplashScreen の iOS のテスト + +`Node.js` `コルドバ`ios をプルするをインストールする必要があります。. + +コルドバ ios をインストールします。 + + npm install + + +現在のフォルダーに. + +# Xcode からテスト + + 1. `CDVSplashScreenTest.xcworkspace`ファイルを起動します。 + 2. スキーム] ドロップダウン メニューから"CDVSplashScreenLibTests"を選択します。 + 3. クリックし、`再生`ボタンを押し、テストを実行する`レンチ`のアイコンを選択 + +# コマンドラインからテスト + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md new file mode 100644 index 00000000..6981207a --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# CDVSplashScreen에 대 한 iOS 테스트 + +`Node.js` `코르도바` ios에서를 설치 해야. + +코르도바-ios를 설치 하는 첫번째는: + + npm install + + +현재 폴더에.... + +# Xcode에서 테스트 + + 1. `CDVSplashScreenTest.xcworkspace` 파일을 시작 합니다. + 2. 구성표 드롭 다운 메뉴에서 "CDVSplashScreenLibTests"를 선택 + 3. 클릭 하 고 `재생` 버튼에는 테스트를 실행 하려면 `공구 모양` 아이콘을 선택 + +# 명령줄에서 테스트 + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md new file mode 100644 index 00000000..f13828fe --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md @@ -0,0 +1,39 @@ +<!-- +# 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 testy dla CDVSplashScreen + +Musisz zainstalować `node.js` ciągnąć w `cordova-ios`. + +Najpierw zainstalować cordova-ios: + + npm install + + +... w folderze bieżącym. + +# Badania z Xcode + + 1. Uruchom plik `CDVSplashScreenTest.xcworkspace` . + 2. Wybierz z menu rozwijanego systemu "CDVSplashScreenLibTests" + 3. Kliknij i przytrzymaj przycisk `Play` i wybrać ikonę `klucz` do testów + +# Badania z wiersza polecenia + + npm test diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md new file mode 100644 index 00000000..3a04bcd1 --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md @@ -0,0 +1,39 @@ +<!-- +# 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. +--> + +# CDVSplashScreen 的 iOS 測試 + +您需要安裝`node.js`拉`科爾多瓦 ios`中. + +第一次安裝科爾多瓦 ios: + + npm install + + +在當前資料夾中。 + +# 從 Xcode 測試 + + 1. 啟動`CDVSplashScreenTest.xcworkspace`檔。 + 2. 從方案下拉式功能表中選擇"CDVSplashScreenLibTests" + 3. 按一下並堅持`播放`按鈕,然後選擇要運行的測試的`扳手`圖示 + +# 從命令列測試 + + npm test diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/package.json b/plugins/cordova-plugin-splashscreen/tests/ios/package.json index ca5db593..761436c5 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/package.json +++ b/plugins/cordova-plugin-splashscreen/tests/ios/package.json @@ -8,6 +8,6 @@ "cordova-ios": "^3.6.0" }, "scripts": { - "test": "xcodebuild -scheme CordovaLib && xcodebuild test -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5'" - } -}
\ No newline at end of file + "test": "xcodebuild test -workspace CDVSplashScreenTest.xcworkspace -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp'" + } +} diff --git a/plugins/org.apache.cordova.splashscreen/tests/plugin.xml b/plugins/cordova-plugin-splashscreen/tests/plugin.xml index 008a851f..bf9cb0ac 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/plugin.xml +++ b/plugins/cordova-plugin-splashscreen/tests/plugin.xml @@ -19,8 +19,8 @@ --> <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" - id="org.apache.cordova.splashscreen.tests" - version="0.4.0"> + id="cordova-plugin-splashscreen-tests" + version="2.1.0"> <name>Cordova Splashscreen Plugin Tests</name> <license>Apache 2.0</license> diff --git a/plugins/org.apache.cordova.splashscreen/tests/tests.js b/plugins/cordova-plugin-splashscreen/tests/tests.js index 8c4d22b4..8c4d22b4 100644 --- a/plugins/org.apache.cordova.splashscreen/tests/tests.js +++ b/plugins/cordova-plugin-splashscreen/tests/tests.js diff --git a/plugins/org.apache.cordova.splashscreen/www/splashscreen.js b/plugins/cordova-plugin-splashscreen/www/splashscreen.js index 7cb48bdd..7cb48bdd 100644 --- a/plugins/org.apache.cordova.splashscreen/www/splashscreen.js +++ b/plugins/cordova-plugin-splashscreen/www/splashscreen.js diff --git a/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js new file mode 100644 index 00000000..1974b7dc --- /dev/null +++ b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js @@ -0,0 +1,77 @@ +/* + * + * 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'); + +var isPhone = (cordova.platformId == "windows") && WinJS.Utilities.isPhone; +var localSplash = null; +var bgColor = "#464646"; // default backgrond color; TDOO - read it from .appxmanifest +var splashImageSrc = isPhone ? "ms-appx:///images/splashscreenphone.png" : "ms-appx:///images/splashscreen.png"; + +var SplashScreen = { + setBGColor: function (cssBGColor) { + bgColor = cssBGColor; + if (localSplash) { + localSplash.style.backgroundColor = bgColor; + } + }, + show: function () { + if (localSplash) { + return; // already showed + } + + localSplash = document.createElement("div"); + localSplash.style.backgroundColor = bgColor; + localSplash.style.position = "fixed"; + localSplash.style.top = "0"; + localSplash.style.width = "100%"; + localSplash.style.height = "100%"; + + localSplashImage = document.createElement("img"); + localSplashImage.src = splashImageSrc; + localSplashImage.style.maxWidth = "100%"; + localSplashImage.style.maxHeight = "100%"; + // center horizontally + localSplashImage.style.margin = "0 auto"; + localSplashImage.style.display = "block"; + // center vertically + localSplashImage.style.position = "relative"; + localSplashImage.style.top = "50%"; + localSplashImage.style.transform = "translateY(-50%)"; + + localSplash.appendChild(localSplashImage); + document.body.appendChild(localSplash); + }, + hide: function () { + if (localSplash) { + document.body.removeChild(localSplash); + localSplash = null; + } + } +}; + +module.exports = SplashScreen; + +require("cordova/exec/proxy").add("SplashScreen", SplashScreen); diff --git a/plugins/fetch.json b/plugins/fetch.json index d4ce0140..4701fbf0 100644 --- a/plugins/fetch.json +++ b/plugins/fetch.json @@ -19,14 +19,6 @@ "is_top_level": true, "variables": {} }, - "org.apache.cordova.splashscreen": { - "source": { - "type": "registry", - "id": "org.apache.cordova.splashscreen" - }, - "is_top_level": true, - "variables": {} - }, "org.apache.cordova.statusbar": { "source": { "type": "registry", @@ -59,14 +51,6 @@ "is_top_level": true, "variables": {} }, - "cordova-plugin-splashscreen": { - "source": { - "type": "registry", - "id": "cordova-plugin-splashscreen" - }, - "is_top_level": true, - "variables": {} - }, "nl.x-services.plugins.insomnia": { "source": { "type": "git", @@ -128,5 +112,13 @@ }, "is_top_level": true, "variables": {} + }, + "cordova-plugin-splashscreen": { + "source": { + "type": "registry", + "id": "cordova-plugin-splashscreen" + }, + "is_top_level": true, + "variables": {} } } diff --git a/plugins/ios.json b/plugins/ios.json index 637e10e9..a44da041 100644 --- a/plugins/ios.json +++ b/plugins/ios.json @@ -37,10 +37,6 @@ "count": 1 }, { - "xml": "<feature name=\"SplashScreen\"><param name=\"ios-package\" value=\"CDVSplashScreen\" /><param name=\"onload\" value=\"true\" /></feature>", - "count": 1 - }, - { "xml": "<feature name=\"StatusBar\"><param name=\"ios-package\" value=\"CDVStatusBar\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 }, @@ -59,6 +55,10 @@ { "xml": "<feature name=\"Canvas2ImagePlugin\"><param name=\"ios-package\" value=\"Canvas2ImagePlugin\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 + }, + { + "xml": "<feature name=\"SplashScreen\"><param name=\"ios-package\" value=\"CDVSplashScreen\" /><param name=\"onload\" value=\"true\" /></feature>", + "count": 1 } ] } @@ -80,7 +80,7 @@ "CoreGraphics.framework": [ { "xml": false, - "count": 2 + "count": 1 } ], "MessageUI.framework": [ @@ -121,9 +121,6 @@ "org.apache.cordova.device": { "PACKAGE_NAME": "com.pliablepixels.zmninja" }, - "org.apache.cordova.splashscreen": { - "PACKAGE_NAME": "com.pliablepixels.zmninja" - }, "org.apache.cordova.statusbar": { "PACKAGE_NAME": "com.pliablepixels.zmninja" }, @@ -135,6 +132,9 @@ }, "com.phonegap.plugins.OrientationLock": { "PACKAGE_NAME": "com.pliablepixels.zmninja" + }, + "cordova-plugin-splashscreen": { + "PACKAGE_NAME": "com.pliablepixels.zmninja" } }, "dependent_plugins": {} diff --git a/plugins/org.apache.cordova.splashscreen/README.md b/plugins/org.apache.cordova.splashscreen/README.md deleted file mode 100644 index 7ad24017..00000000 --- a/plugins/org.apache.cordova.splashscreen/README.md +++ /dev/null @@ -1,22 +0,0 @@ -<!--- - license: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -# org.apache.cordova.splashscreen - -Plugin documentation: [doc/index.md](doc/index.md) diff --git a/plugins/org.apache.cordova.splashscreen/doc/index.md b/plugins/org.apache.cordova.splashscreen/doc/index.md deleted file mode 100644 index c3070cc4..00000000 --- a/plugins/org.apache.cordova.splashscreen/doc/index.md +++ /dev/null @@ -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. - diff --git a/plugins/org.apache.cordova.splashscreen/package.json b/plugins/org.apache.cordova.splashscreen/package.json deleted file mode 100644 index 02b30c34..00000000 --- a/plugins/org.apache.cordova.splashscreen/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": "1.0.0", - "name": "org.apache.cordova.splashscreen", - "cordova_name": "Splashscreen", - "description": "Cordova Splashscreen Plugin", - "license": "Apache 2.0", - "repo": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git", - "issue": "https://issues.apache.org/jira/browse/CB/component/12320653", - "keywords": [ - "cordova", - "splashscreen" - ], - "platforms": [ - "android", - "amazon-fireos", - "ubuntu", - "ios", - "blackberry10", - "wp7", - "wp8", - "windows8", - "tizen" - ], - "engines": [ - { - "name": "cordova-android", - "version": ">=3.6.0" - } - ], - "englishdoc": "<!---\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership. The ASF licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing,\n software distributed under the License is distributed on an\n \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n KIND, either express or implied. See the License for the\n specific language governing permissions and limitations\n under the License.\n-->\n\n# org.apache.cordova.splashscreen\n\nThis plugin displays and hides a splash screen during application launch.\n\n## Installation\n\n cordova plugin add org.apache.cordova.splashscreen\n\n\n## Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Windows Phone 7 and 8\n- Windows 8\n\n\n## Methods\n\n- splashscreen.show\n- splashscreen.hide\n\n### Android Quirks\n\nIn your config.xml, you need to add the following preferences:\n\n <preference name=\"SplashScreen\" value=\"foo\" />\n <preference name=\"SplashScreenDelay\" value=\"10000\" />\n\nWhere 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)\nfor more information.\n\n## splashscreen.hide\n\nDismiss the splash screen.\n\n navigator.splashscreen.hide();\n\n\n### BlackBerry 10, WP8, iOS Quirk\n\nThe `config.xml` file's `AutoHideSplashScreen` setting must be\n`false`. To delay hiding the splash screen for two seconds, add a\ntimer such as the following in the `deviceready` event handler:\n\n setTimeout(function() {\n navigator.splashscreen.hide();\n }, 2000);\n\n## splashscreen.show\n\nDisplays the splash screen.\n\n navigator.splashscreen.show();\n\n\nYour application cannot call `navigator.splashscreen.show()` until the app has\nstarted and the `deviceready` event has fired. But since typically the splash\nscreen is meant to be visible before your app has started, that would seem to\ndefeat the purpose of the splash screen. Providing some configuration in\n`config.xml` will automatically `show` the splash screen immediately after your\napp launch and before it has fully started and received the `deviceready`\nevent. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)\nfor more information on doing this configuration. For this reason, it is\nunlikely you need to call `navigator.splashscreen.show()` to make the splash\nscreen visible for app startup.\n\n" -}
\ No newline at end of file diff --git a/plugins/org.apache.cordova.splashscreen/src/wp/SplashScreen.cs b/plugins/org.apache.cordova.splashscreen/src/wp/SplashScreen.cs deleted file mode 100644 index 4d3545b0..00000000 --- a/plugins/org.apache.cordova.splashscreen/src/wp/SplashScreen.cs +++ /dev/null @@ -1,167 +0,0 @@ -/* - 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 System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Info; -using System.Windows.Controls.Primitives; -using System.Diagnostics; -using System.Windows.Media.Imaging; -using System.Windows.Resources; -using System.IO; -using System.Xml.Linq; -using System.Linq; -using System.Windows.Threading; - -namespace WPCordovaClassLib.Cordova.Commands -{ - /// <summary> - /// Listens for changes to the state of the battery on the device. - /// Currently only the "isPlugged" parameter available via native APIs. - /// </summary> - public class SplashScreen : BaseCommand - { - private Popup popup; - private bool autohide = true; - - 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; - - // 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; - - - LoadConfigValues(); - } - - public override void OnInit() - { - // we only want to autoload the first time a page is loaded. - if (!WasShown) - { - WasShown = true; - show(); - } - } - - void LoadConfigValues() - { - 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) - { - autohide = false; - } - } - } - - public void show(string options = null) - { - Deployment.Current.Dispatcher.BeginInvoke(() => - { - if (popup.IsOpen) - { - return; - } - - popup.Child.Opacity = 0; - - 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); - - Debug.WriteLine("Fading the splash screen in"); - - story.Begin(); - - popup.IsOpen = true; - - if (autohide) - { - DispatcherTimer timer = new DispatcherTimer(); - timer.Tick += (object sender, EventArgs e) => - { - hide(); - }; - timer.Interval = TimeSpan.FromSeconds(1.2); - timer.Start(); - } - }); - } - - - public void hide(string options = null) - { - Deployment.Current.Dispatcher.BeginInvoke(() => - { - if (!popup.IsOpen) - { - return; - } - - 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(); - }); - } - } -} diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist b/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist deleted file mode 100644 index a949946d..00000000 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ -<?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>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> diff --git a/plugins/org.apache.cordova.splashscreen/tests/ios/README.md b/plugins/org.apache.cordova.splashscreen/tests/ios/README.md deleted file mode 100644 index b6bf31b2..00000000 --- a/plugins/org.apache.cordova.splashscreen/tests/ios/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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 diff --git a/plugins/org.apache.cordova.splashscreen/www/windows8/SplashScreenProxy.js b/plugins/org.apache.cordova.splashscreen/www/windows8/SplashScreenProxy.js deleted file mode 100644 index 42068ddf..00000000 --- a/plugins/org.apache.cordova.splashscreen/www/windows8/SplashScreenProxy.js +++ /dev/null @@ -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); - |
