Initial commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
You need to install the plugin before running the example.
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="com.mesmotronic.fullscreen.test" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<name>Cordova Full Screen Test</name>
|
||||
<description>
|
||||
A sample Apache Cordova application that responds to the deviceready event.
|
||||
</description>
|
||||
<author email="dev@cordova.apache.org" href="http://cordova.io">
|
||||
Apache Cordova Team
|
||||
</author>
|
||||
<content src="index.html" />
|
||||
<access origin="*" />
|
||||
<!-- <preference name="Fullscreen" value="false" /> -->
|
||||
</widget>
|
||||
@@ -0,0 +1,83 @@
|
||||
<!--
|
||||
#
|
||||
# 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 Hooks
|
||||
|
||||
This directory may contain scripts used to customize cordova commands. This
|
||||
directory used to exist at `.cordova/hooks`, but has now been moved to the
|
||||
project root. Any scripts you add to these directories will be executed before
|
||||
and after the commands corresponding to the directory name. Useful for
|
||||
integrating your own build systems or integrating with version control systems.
|
||||
|
||||
__Remember__: Make your scripts executable.
|
||||
|
||||
## Hook Directories
|
||||
The following subdirectories will be used for hooks:
|
||||
|
||||
after_build/
|
||||
after_compile/
|
||||
after_docs/
|
||||
after_emulate/
|
||||
after_platform_add/
|
||||
after_platform_rm/
|
||||
after_platform_ls/
|
||||
after_plugin_add/
|
||||
after_plugin_ls/
|
||||
after_plugin_rm/
|
||||
after_plugin_search/
|
||||
after_prepare/
|
||||
after_run/
|
||||
after_serve/
|
||||
before_build/
|
||||
before_compile/
|
||||
before_docs/
|
||||
before_emulate/
|
||||
before_platform_add/
|
||||
before_platform_rm/
|
||||
before_platform_ls/
|
||||
before_plugin_add/
|
||||
before_plugin_ls/
|
||||
before_plugin_rm/
|
||||
before_plugin_search/
|
||||
before_prepare/
|
||||
before_run/
|
||||
before_serve/
|
||||
pre_package/ <-- Windows 8 and Windows Phone only.
|
||||
|
||||
## Script Interface
|
||||
|
||||
All scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
|
||||
|
||||
* CORDOVA_VERSION - The version of the Cordova-CLI.
|
||||
* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
|
||||
* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
|
||||
* CORDOVA_HOOK - Path to the hook that is being executed.
|
||||
* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
|
||||
|
||||
If a script returns a non-zero exit code, then the parent cordova command will be aborted.
|
||||
|
||||
|
||||
## Writing hooks
|
||||
|
||||
We highly recommend writting your hooks using Node.js so that they are
|
||||
cross-platform. Some good examples are shown here:
|
||||
|
||||
[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
<title>Full Screen Example</title>
|
||||
|
||||
<style type="text/css">
|
||||
body, html
|
||||
{
|
||||
margin: 4px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 42px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Android 4.0+</h1>
|
||||
<button id="leanModeButton">Lean Mode</button>
|
||||
<button id="showUiButton">Show UI</button>
|
||||
<button id="customButton">Custom Mode</button>
|
||||
|
||||
<h1>Android 4.4+</h1>
|
||||
<button id="immersiveModeButton">Immersive Mode</button>
|
||||
<button id="showUnderUiButton">Show Under UI</button>
|
||||
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function successFunction()
|
||||
{
|
||||
console.log("It worked!");
|
||||
}
|
||||
|
||||
function errorFunction(error)
|
||||
{
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
function leanMode()
|
||||
{
|
||||
AndroidFullScreen.leanMode(successFunction, errorFunction);
|
||||
}
|
||||
|
||||
function immersiveMode()
|
||||
{
|
||||
AndroidFullScreen.immersiveMode(successFunction, errorFunction);
|
||||
}
|
||||
|
||||
function showUnderSystemUI()
|
||||
{
|
||||
AndroidFullScreen.showUnderSystemUI(successFunction, errorFunction);
|
||||
}
|
||||
|
||||
function showSystemUI()
|
||||
{
|
||||
AndroidFullScreen.showSystemUI(successFunction, errorFunction);
|
||||
}
|
||||
|
||||
function setSystemUiVisibility()
|
||||
{
|
||||
AndroidFullScreen.setSystemUiVisibility(AndroidFullScreen.SYSTEM_UI_FLAG_FULLSCREEN | AndroidFullScreen.SYSTEM_UI_FLAG_LOW_PROFILE, successFunction, errorFunction);
|
||||
}
|
||||
|
||||
function deviceReady()
|
||||
{
|
||||
document.getElementById('leanModeButton').addEventListener('click', leanMode);
|
||||
document.getElementById('immersiveModeButton').addEventListener('click', immersiveMode)
|
||||
document.getElementById('showUnderUiButton').addEventListener('click', showUnderSystemUI);
|
||||
document.getElementById('showUiButton').addEventListener('click', showSystemUI);
|
||||
document.getElementById('customButton').addEventListener('click', setSystemUiVisibility);
|
||||
}
|
||||
|
||||
document.addEventListener('deviceready', deviceReady);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user