Touchgui/plugins/org.apache.cordova.splashscreen/doc/index.md

Thu, 04 Jun 2015 14:50:33 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Jun 2015 14:50:33 +0200
changeset 0
e8ccd40d0ef6
permissions
-rw-r--r--

Genesis of lecture sources for Droidcon Berlin 2015 in Postbahnhof.

     1 <!---
     2     Licensed to the Apache Software Foundation (ASF) under one
     3     or more contributor license agreements.  See the NOTICE file
     4     distributed with this work for additional information
     5     regarding copyright ownership.  The ASF licenses this file
     6     to you under the Apache License, Version 2.0 (the
     7     "License"); you may not use this file except in compliance
     8     with the License.  You may obtain a copy of the License at
    10       http://www.apache.org/licenses/LICENSE-2.0
    12     Unless required by applicable law or agreed to in writing,
    13     software distributed under the License is distributed on an
    14     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    15     KIND, either express or implied.  See the License for the
    16     specific language governing permissions and limitations
    17     under the License.
    18 -->
    20 # org.apache.cordova.splashscreen
    22 This plugin displays and hides a splash screen during application launch.
    24 ## Installation
    26     cordova plugin add org.apache.cordova.splashscreen
    29 ## Supported Platforms
    31 - Amazon Fire OS
    32 - Android
    33 - BlackBerry 10
    34 - iOS
    35 - Windows Phone 7 and 8
    36 - Windows 8
    39 ## Methods
    41 - splashscreen.show
    42 - splashscreen.hide
    44 ### Android Quirks
    46 In your config.xml, you need to add the following preferences:
    48     <preference name="SplashScreen" value="foo" />
    49     <preference name="SplashScreenDelay" value="10000" />
    51 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)
    52 for more information.
    54 ## splashscreen.hide
    56 Dismiss the splash screen.
    58     navigator.splashscreen.hide();
    61 ### BlackBerry 10, WP8, iOS Quirk
    63 The `config.xml` file's `AutoHideSplashScreen` setting must be
    64 `false`. To delay hiding the splash screen for two seconds, add a
    65 timer such as the following in the `deviceready` event handler:
    67         setTimeout(function() {
    68             navigator.splashscreen.hide();
    69         }, 2000);
    71 ## splashscreen.show
    73 Displays the splash screen.
    75     navigator.splashscreen.show();
    78 Your application cannot call `navigator.splashscreen.show()` until the app has
    79 started and the `deviceready` event has fired. But since typically the splash
    80 screen is meant to be visible before your app has started, that would seem to
    81 defeat the purpose of the splash screen.  Providing some configuration in
    82 `config.xml` will automatically `show` the splash screen immediately after your
    83 app launch and before it has fully started and received the `deviceready`
    84 event. See [Icons and Splash Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)
    85 for more information on doing this configuration. For this reason, it is
    86 unlikely you need to call `navigator.splashscreen.show()` to make the splash
    87 screen visible for app startup.

mercurial