incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [4/4] docs commit: Adding SplashScreen docs
Date Thu, 18 Oct 2012 18:35:28 GMT
Adding SplashScreen docs


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/commit/b090e550
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/tree/b090e550
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/diff/b090e550

Branch: refs/heads/master
Commit: b090e5506fe07c4dfdcac349a2688586ef04aca1
Parents: 1484d2e
Author: Simon MacDonald <simon.macdonald@gmail.com>
Authored: Thu Oct 18 14:16:51 2012 -0400
Committer: Simon MacDonald <simon.macdonald@gmail.com>
Committed: Thu Oct 18 14:16:51 2012 -0400

----------------------------------------------------------------------
 docs/en/edge/config.json                           |    5 +
 .../edge/cordova/splashscreen/splashscreen.hide.md |   68 +++++++++++++++
 docs/en/edge/cordova/splashscreen/splashscreen.md  |   61 +++++++++++++
 .../edge/cordova/splashscreen/splashscreen.show.md |   68 +++++++++++++++
 docs/en/edge/index.md                              |    4 +
 5 files changed, 206 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/b090e550/docs/en/edge/config.json
----------------------------------------------------------------------
diff --git a/docs/en/edge/config.json b/docs/en/edge/config.json
index 384ae1c..4583fce 100644
--- a/docs/en/edge/config.json
+++ b/docs/en/edge/config.json
@@ -169,6 +169,11 @@
             "cordova/notification/notification.beep.md",
             "cordova/notification/notification.vibrate.md"
         ],
+        "splashscreen.md": [
+            "cordova/splashscreen/splashscreen.md",
+            "cordova/splashscreen/splashscreen.show.md",
+            "cordova/splashscreen/splashscreen.hide.md"
+        ],
         "storage.md": [
             "cordova/storage/storage.md",
             "cordova/storage/storage.opendatabase.md",

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

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/b090e550/docs/en/edge/cordova/splashscreen/splashscreen.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/splashscreen/splashscreen.md b/docs/en/edge/cordova/splashscreen/splashscreen.md
new file mode 100644
index 0000000..2618aa4
--- /dev/null
+++ b/docs/en/edge/cordova/splashscreen/splashscreen.md
@@ -0,0 +1,61 @@
+---
+license: Licensed to the Apache Software Foundation (ASF) under one
+         or more contributor license agreements.  See the NOTICE file
+         distributed with this work for additional information
+         regarding copyright ownership.  The ASF licenses this file
+         to you under the Apache License, Version 2.0 (the
+         "License"); you may not use this file except in compliance
+         with the License.  You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+         Unless required by applicable law or agreed to in writing,
+         software distributed under the License is distributed on an
+         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+         KIND, either express or implied.  See the License for the
+         specific language governing permissions and limitations
+         under the License.
+---
+
+Splashscreen
+==========
+
+> Enables developers to show/hide the applications splash screen.
+
+
+Methods
+-------
+
+- show
+- hide
+
+Permissions
+-----------
+
+### Android
+
+#### app/res/xml/config.xml
+
+    <plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
+    
+Setup
+-----
+
+### Android
+
+1. Copy your splash screen image into the res/drawable directories of your Android project.
The sizes of each image should be:
+
+   - xlarge (xhdpi): at least 960 x 720
+   - large (hdpi): at least 640 x 480
+   - medium (mdpi): at least 470 x 320
+   - small (ldpi): at least 426 x 320
+   
+   It is highly recommended that you use a [9-patch image](https://developer.android.com/tools/help/draw9patch.html)
for your splash screen.
+
+2. In the onCreate method of the class that extends DroidGap add the following two lines:
+
+        super.setIntegerProperty("splashscreen", R.drawable.splash);
+        super.loadUrl("file:///android_asset/www/index.html", 10000);
+    
+    The first line 'super.setIntegerProperty' sets the image to be displayed as the splashscreen.
If you have named your image anything other than splash.png you will have to modify this line.
+    The second line is the normal 'super.loadUrl' line but it has a second parameter which
is the timeout value for the splash screen. In this example the splash screen will display
for 10 seconds. If you want to dismiss the splash screen once you get the "deviceready" event
you should call the navigator.splashscreen.hide() method.
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/b090e550/docs/en/edge/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/index.md b/docs/en/edge/index.md
index 460c211..1bdaa72 100644
--- a/docs/en/edge/index.md
+++ b/docs/en/edge/index.md
@@ -73,6 +73,10 @@ license: Licensed to the Apache Software Foundation (ASF) under one
             <span>Visual, audible, and tactile device notifications.</span>
         </li>
         <li>
+            <h2>Splashscreen</h2>
+            <span>Show and hide the applications splash screen.</span>
+        </li>
+        <li>
             <h2>Storage</h2>
             <span>Hook into the devices native storage options.</span>
         </li>


Mime
View raw message