mirror of
https://github.com/apache/cordova-plugin-splashscreen.git
synced 2026-02-05 00:01:30 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4d8b77027 | ||
|
|
0f63861e88 | ||
|
|
e364377d4f | ||
|
|
395302ee16 | ||
|
|
333b0e7f90 | ||
|
|
be8d340f31 | ||
|
|
f833c39ed3 | ||
|
|
8eb2533e78 |
@@ -77,3 +77,9 @@
|
||||
* CB-7041 ios: Fix image filename logic when setting the iPad splash screen
|
||||
* fixes Splashscreen crash on WP8
|
||||
* Remove outdated doc
|
||||
|
||||
### 0.3.3 (Sep 17, 2014)
|
||||
* CB-7249 cordova-plugin-splashscreen documentation translation
|
||||
* Renamed test dir, added nested plugin.xml
|
||||
* added documentation for manual tests
|
||||
* CB-7196 port splashscreen tests to framework
|
||||
|
||||
@@ -40,13 +40,13 @@ Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung.
|
||||
* SplashScreen.Show
|
||||
* SplashScreen.Hide
|
||||
|
||||
### Android Macken
|
||||
### Android Eigenarten
|
||||
|
||||
Sie müssen in der Datei config.xml fügen Sie die folgenden Einstellungen:
|
||||
Sie müssen in der config.xml folgende Einstellungen vornehmen:
|
||||
|
||||
`<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] .
|
||||
"foo" stellt hierbei den Namen der SplashScreen-Datei dar. Vorzugsweise ist dies ein "9-Patch-File". Stellen Sie sicher, dass Sie die erforderlichen Dateien für den SplashScreen auch Ihrem Res/XML-Verzeichnis hinzufügen und dorthin kopieren. Der zweite Parameter stellt dar, wie lange der SplashScreen in Millisekunden angezeigt wird. Standardmäßig beträgt dieser Wert 3000ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens][1] .
|
||||
|
||||
[1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
|
||||
|
||||
@@ -57,9 +57,9 @@ Schließen Sie den Splash-Screen.
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
|
||||
### BlackBerry 10, WP8, iOS Quirk
|
||||
### 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:
|
||||
Der in der `config.xml` enthaltene Befehl `AutoHideSplashScreen` muss auf `false` gesetzt sein. Um das Verstecken des SplashScreens um zwei Sekunden zu verzögern, können Sie einen Countdown in den `deviceready` -Eventhändler wie folgt integrieren:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
@@ -68,9 +68,9 @@ Die `config.xml` der Datei `AutoHideSplashScreen` muss `false` . Verstecken des
|
||||
|
||||
## SplashScreen.Show
|
||||
|
||||
Zeigt den Begrüßungsbildschirm.
|
||||
Zeigt den SplashScreen.
|
||||
|
||||
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.
|
||||
Ihre Anwendung kann die Funktion `navigator.splashscreen.show()` nicht aufrufen, bis die App vollständig gestartet, und das `deviceready` -Event ausgelöst wurde. Aber da der SplashScreen eigentlich beabsichtigt, bereits vor dem vollständigen Laden der App sichtbar zu sein, würde dies die eigentliche Funktion des SplashScreens sinnlos machen. Vorausgesetzt von einigen Konfigurationen in der `config.xml` wird der Splashscreen also dennoch unmittelbar nach dem Laden der App gestartet `show` noch bevor das `deviceready` -Event ausgelöst wurde. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens][1] . Aus diesem Grund ist es unpassend, dass Sie die Funktion `navigator.splashscreen.show()` aufrufen müssen, denn der Splashscreen erscheint unverzüglich nach dem Starten der App.
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="org.apache.cordova.splashscreen"
|
||||
version="0.3.2">
|
||||
version="0.3.3">
|
||||
<name>Splashscreen</name>
|
||||
<description>Cordova Splashscreen Plugin</description>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
29
tests/plugin.xml
Normal file
29
tests/plugin.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="org.apache.cordova.splashscreen.tests"
|
||||
version="0.3.3">
|
||||
<name>Cordova Splashscreen Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
<js-module src="tests.js" name="tests">
|
||||
</js-module>
|
||||
</plugin>
|
||||
62
tests/tests.js
Normal file
62
tests/tests.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
exports.defineAutoTest = function () {
|
||||
describe('Splashscreen (cordova)', function () {
|
||||
it("splashscreen.spec.1 should exist", function () {
|
||||
expect(navigator.splashscreen).toBeDefined();
|
||||
});
|
||||
|
||||
it("splashscreen.spec.2 exec method should exist", function () {
|
||||
expect(navigator.splashscreen.show).toBeDefined();
|
||||
expect(typeof navigator.splashscreen.show).toBe('function');
|
||||
});
|
||||
|
||||
it("splashscreen.spec.3 exec method should exist", function () {
|
||||
expect(navigator.splashscreen.hide).toBeDefined();
|
||||
expect(typeof navigator.splashscreen.hide).toBe('function');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.defineManualTests = function (contentEl, createActionButton) {
|
||||
function showFor(duration) {
|
||||
navigator.splashscreen.show();
|
||||
window.setTimeout(function () {
|
||||
navigator.splashscreen.hide();
|
||||
}, 1000 * duration);
|
||||
}
|
||||
|
||||
contentEl.innerHTML = '<h1>Splashscreen Tests</h1>' +
|
||||
'<h3>Note for WP: AutoHideSplashScreen must be set to false in config.xml</h3>' +
|
||||
'<div id="show1"></div>' +
|
||||
'Expected result: Will show the Cordova splashscreen for 1 second' +
|
||||
'</p> <div id="show5"></div>' +
|
||||
'Expected result: Will show the Cordova splashscreen for 5 seconds';
|
||||
|
||||
createActionButton('Show for 1 second', function () {
|
||||
showFor(1);
|
||||
}, 'show1');
|
||||
|
||||
createActionButton('Show for 5 seconds', function () {
|
||||
showFor(5);
|
||||
}, 'show5');
|
||||
};
|
||||
Reference in New Issue
Block a user