Compare commits

...

93 Commits

Author SHA1 Message Date
Shazron Abdullah
a50208bda2 CB-12224 Updated version and RELEASENOTES.md for release 2.2.1 2016-12-07 16:39:46 -08:00
Jonathan Li
6bfc749f84 CB-10288 statusbar plugin interaction with iOS multitasking
This closes #62
2016-11-13 23:14:11 +01:00
Julio Cesar Sanchez Hernandez
b7dc5ef7cb CB-10158 (ios) fix StatusBar issue when recovering from fullscreen video
This closes #70
2016-10-30 17:48:37 +01:00
Julio Cesar Sanchez Hernandez
086234b881 CB-10341 ios, document statusTap event
This closes #69
2016-10-30 17:46:36 +01:00
Julio César
2c036c9c91 CB-11191: Statusbar plugin causing issues with webview size
This closes #65
2016-10-29 00:10:20 +02:00
Shazron Abdullah
940a8ee920 CB-11917 - Remove pull request template checklist item: "iCLA has been submitted…"
This closes #66
2016-10-04 21:34:54 -07:00
Steve Gill
53d0b04ed6 CB-11832 Incremented plugin version. 2016-09-09 16:08:04 -07:00
Steve Gill
ad5f7d912c CB-11832 Updated version and RELEASENOTES.md for release 2.2.0 2016-09-08 23:38:55 -07:00
Vladimir Kotikov
dbc7b29680 CB-11795 Add 'protective' entry to cordovaDependencies
The entry is required to protect end-users from fetching edge versions of the plugin by incompatible version of cordova. This also assumes that we will not introduce any regressions in compatibility w/ cordova in minor and patch releases. On every major release we will need to add similar entry with _next_ major version.

 This closes #63
2016-09-08 12:03:01 +03:00
Julio César
1d1ac928a8 Removed duplicate code 2016-09-01 20:12:20 +02:00
Gosha Arinich
554e65e60f Handle extended status bar on iOS
This closes #55
2016-09-01 20:01:42 +02:00
Simon MacDonald
f2c49454da Plugin uses Android Log class and not Cordova LOG class 2016-08-22 16:52:13 -04:00
Julio César
aca5eceaf9 Closing stale pull request: close #19 2016-07-31 00:27:54 +02:00
Julio César
86cfafeaf9 CB-11287: (ios) - fix webview resize after modal on iPhones 2016-07-05 00:12:20 +02:00
Julio César
8159e1b307 CB-11485 fix resize on rotation with popover 2016-07-04 21:20:33 +02:00
Vladimir Kotikov
f8873fd481 Add badges for paramedic builds on Jenkins 2016-06-10 12:13:59 +03:00
Vladimir Kotikov
cfce729912 CB-11197 Keep status bar hidden when keyboard pops up
This closes #59
2016-05-24 10:44:00 +03:00
Nikhil Khandelwal
c34e3a02c2 Add pull request template. 2016-05-23 13:54:00 -07:00
Richard Knoll
16c653747e CB-10866: Adding engine info to package.json
This closes #52
2016-05-18 10:50:47 -07:00
Jesse MacFadyen
b448166624 patched missing _ready method, and changed the way the proxy is installed 2016-05-16 18:01:34 -07:00
t1st3
fc56eb211f chore: edit package.json license to match SPDX id. This closes #46.
See [NPM package.json spec for licenses](https://docs.npmjs.com/files/package.json#license) and [SPDX license IDs](https://spdx.org/licenses/)

X-ref: https://github.com/apache/cordova-plugin-device/pull/48
2016-04-25 11:54:47 -07:00
Dmitry Blotsky
259cdb65ef CB-10996 Adding front matter to README.md 2016-04-22 19:35:51 -07:00
Steve Gill
c3705fe46e CB-11091 Incremented plugin version. 2016-04-15 13:45:28 -07:00
Steve Gill
ef7266874a Updated version and RELEASENOTES.md for release 2.1.3 2016-04-15 13:08:27 -07:00
daserge
16ff9b449f CB-11018 Fix statusbar with inappbrowser causing incorrect orientation on iOS8 2016-04-05 17:39:36 +03:00
daserge
244eb717fd CB-10884 Inappbrowser breaks UI while Screen orientation changes from landscape to portrait on iOS 2016-03-29 16:49:29 +03:00
Carlos Santana
15043c1db2 clean releasenotes bold font 2016-03-10 13:51:47 -05:00
Carlos Santana
1011b2a162 CB-10820 Incremented plugin version. 2016-03-09 22:34:18 -05:00
Carlos Santana
f1aa062557 CB-10820 Updated version and RELEASENOTES.md for release 2.1.2 2016-03-09 22:12:41 -05:00
Julio César
7ca3552224 Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases
We don’t allow the statusbar to overlay the webview on iOS 6, but in
some cases it happens. This changes avoid it.
2016-03-06 11:55:49 +01:00
daserge
bf7869cec7 CB-10683 Fix wrong StatusBar.isVisible initial value on Windows 2016-02-24 10:32:46 +03:00
daserge
8a3f9edb9d CB-10636 Add JSHint for plugins 2016-02-24 10:28:04 +03:00
Julio César
47f245462d CB-10047 fix iOS 8 deprecated warnings
Removed all references to self.viewController.interfaceOrientation,
they weren’t really used on invertFrameIfNeeded and are deprecated on
iOS 8
Removed orientation param on invertFrameIfNeeded as it wasn’t being
used.

closes #26
2016-02-22 19:49:18 +01:00
Vladimir Kotikov
241577c3c8 CB-10557 Incremented plugin version. 2016-02-09 13:09:55 +03:00
Vladimir Kotikov
573176e3a7 CB-10557 Updated version and RELEASENOTES.md for release 2.1.1 2016-02-09 13:09:54 +03:00
Julio César
a464526477 Fix for CB-10102
The removeObserver code was wrong and it might crash on plugin
deallocation

github: close #45
2016-01-17 13:56:20 +01:00
Steve Gill
97f87d36c1 CB-10368 Incremented plugin version. 2016-01-15 16:58:32 -08:00
Steve Gill
e6e8c5be10 CB-10368 Updated version and RELEASENOTES.md for release 2.1.0 2016-01-15 16:35:06 -08:00
Vladimir Kotikov
a4a1065c4f CB-9513 Allow to show/hide status bar in fullscreen mode. This closes #42 2016-01-05 13:37:25 +03:00
Vladimir Kotikov
d853f828d6 CB-8720 Fix status bar position when app started upside down on iOS 7. This closes #44 2016-01-05 13:34:37 +03:00
Vladimir Kotikov
3e9ce84a56 CB-10118 Fixes plugin loading error for browser platform
This closes #43
2016-01-05 13:16:26 +03:00
Steve Gill
999ad4f6c2 CB-10035 Incremented plugin version. 2015-11-30 17:57:07 -08:00
Steve Gill
7c27000b3a CB-10035 linked issues in RELEASENOTES.md 2015-11-18 22:11:41 -08:00
Steve Gill
a63282219c CB-10035 Updated version and RELEASENOTES.md for release 2.0.0 2015-11-18 19:45:06 -08:00
Steve Gill
265fde25a0 removed r prefix from tags 2015-11-18 14:53:11 -08:00
Steve Gill
dc945bdc95 CB-10035 Updated RELEASENOTES to be newest to oldest 2015-11-18 13:54:08 -08:00
Jesse MacFadyen
60686a944a Pushed too soon, missed a _ 2015-11-11 13:53:41 -08:00
Jesse MacFadyen
cf1092fe81 Added weakSelf reference for block use 2015-11-11 13:45:13 -08:00
Julio César
86b9edba5d Fixes CB-4712, CB-5439 statusbar issues
Fixes CB-4712, CB-5439 and hopefully all the statusbar issues related
to the size or resize of the cordova webview  when the status bar
changes the size and/or rotation and resizes first time
2015-11-07 18:21:54 +01:00
Dmitry Blotsky
3795486e33 Actually fixing the contribute link. 2015-10-23 12:11:50 -07:00
Dmitry Blotsky
fbfaeaa7ab Fixing contribute link. 2015-10-23 12:03:42 -07:00
Simon MacDonald
7fa66c0b61 CB-9250 - Fix iOS warnings in Statusbar plugin
Closes PR #35

Merge branch 'CB-9250' of https://github.com/jcesarmobile/cordova-plugin-statusbar
2015-09-21 11:44:32 -04:00
Jesse MacFadyen
1923d4e91e Close #34, merged 2015-09-18 12:55:11 -07:00
Julien Bouquillon
baefe6d109 add JIRA issue tracker link 2015-09-18 12:53:30 -07:00
Jesse MacFadyen
1b3fbf3f9a Close #7 2015-09-18 12:50:13 -07:00
Julio César
986516cf97 removed silly copy/paste mistakes
removed silly copy/paste mistakes
2015-09-14 23:04:53 +02:00
Julio César
145fad6764 fix ios warnings
fix ios 7 deprecate warnigns
2015-09-14 20:43:48 +02:00
Jesse MacFadyen
b0b61af61a removed proxy and renamed platform file, merge instead of clobber, fixed failing tests for missing methods. 2015-09-02 00:22:57 -07:00
Jesse MacFadyen
da924e16fe Merge branch 'browserSupport' of https://github.com/surajpindoria/cordova-plugin-statusbar 2015-09-01 22:55:32 -07:00
Suraj Pindoria
a0e5b517e0 [CB-7965] Add cordova-plugin-statusbar support for browser platform 2015-08-31 16:36:10 -07:00
Jesse MacFadyen
c4dcdacf6b Merge branch 'master' of https://github.com/cwannerstedt/cordova-plugin-statusbar 2015-07-28 10:45:43 -07:00
Jesse MacFadyen
1dfc83d57d remove travis-ci 2015-07-07 18:00:25 -07:00
Christian Wannerstedt
3e821abfc2 Don't use IsAtLeastiOSVersion macro to determine height 2015-07-01 13:49:50 +02:00
Christian Wannerstedt
07b55b7529 Use correct statusbar height for landscape orientation in iOS >= 8 2015-07-01 13:25:26 +02:00
Steve Gill
2e8164693e CB-9192 Incremented plugin version. 2015-06-17 17:42:14 -07:00
Steve Gill
d07ecff31a CB-9202 updated repo url to github mirror in package.json 2015-06-17 17:42:14 -07:00
Steve Gill
3f5f727629 CB-9192 Updated version and RELEASENOTES.md for release 1.0.1 2015-06-17 17:42:14 -07:00
Jesse MacFadyen
5ac69e4962 Added verbose install text for users on < cordova 5.0, This closes #23 2015-06-17 12:56:24 -07:00
Jesse MacFadyen
e2cea32ab4 Fix merge. This closes #20 2015-06-17 12:48:29 -07:00
Jesse MacFadyen
77ce75d4dd Merge branch 'master' of https://github.com/pbakondy/cordova-plugin-statusbar 2015-06-17 12:33:17 -07:00
Jesse MacFadyen
a345f376b9 add auto-tests for basic api 2015-06-16 17:15:00 -07:00
Gillardo
8e1e88a30a CB-9180 Add correct supported check for Windows 8.1 desktop
If you called show or hide, you would get an "object has no method"
error as getViewStatusBar would return null.. This closes #25
2015-06-15 10:10:56 -07:00
Victor Sosa
47fef8450c CB-9128 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar 2015-06-12 09:42:43 -05:00
Raymond Camden
f9ec3c09c3 fix npm md issue 2015-06-02 11:04:14 -05:00
Peter Bakondy
e8c448100c fix warning message
This change is fix for the following warning message at startup:

W/CordovaPlugin( 6470): Attempted to send a second callback for ID:
StatusBar1091036409
W/CordovaPlugin( 6470): Result was: "Invalid action"
2015-04-20 16:39:10 +02:00
Steve Gill
2b3935af31 CB-8858 Incremented plugin version. 2015-04-15 16:00:22 -07:00
Steve Gill
261f9576fe CB-8858 Updated version in package.json for release 1.0.0 2015-04-15 15:50:47 -07:00
Steve Gill
7c59f7dac6 Revert "CB-8858 Incremented plugin version."
This reverts commit 18e33cafc7.
2015-04-15 14:31:13 -07:00
Steve Gill
18e33cafc7 CB-8858 Incremented plugin version. 2015-04-15 13:55:47 -07:00
Steve Gill
aa07a30c3c CB-8858 Updated version and RELEASENOTES.md for release 1.0.0 2015-04-15 11:06:38 -07:00
Steve Gill
07c18077e5 CB-8746 gave plugin major version bump 2015-04-09 17:04:26 -07:00
Steve Gill
a4298897b3 CB-8683 changed plugin-id to pacakge-name 2015-04-01 16:44:02 -07:00
Steve Gill
2d25d2ec4c CB-8653 properly updated translated docs to use new id 2015-03-31 16:06:02 -07:00
Steve Gill
56f038efc4 CB-8653 updated translated docs to use new id 2015-03-31 10:53:33 -07:00
Jesse MacFadyen
ad786647ff Use TRAVIS_BUILD_DIR, install paramedic by npm 2015-03-24 23:44:27 -07:00
Steve Gill
c55bbcc153 CB-8653 Updated Readme 2015-03-13 19:43:44 -07:00
Jesse MacFadyen
bf17f43973 Merge branch 'master' of https://github.com/EddyVerbruggen/cordova-plugin-statusbar 2015-03-03 17:28:50 -08:00
Jesse MacFadyen
29b42dd93e CB-8575 Integrate TravisCI 2015-03-02 17:46:03 -08:00
EddyVerbruggen
7f135a46e1 - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme. 2015-02-28 08:59:47 +01:00
EddyVerbruggen
84ee94cb41 - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up 2015-02-27 22:35:30 +01:00
Victor Sosa
b492b1f4b0 CB-8438 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar 2015-02-27 12:53:05 -06:00
EddyVerbruggen
43c8c15bf4 Allow setting the statusbar backgroundcolor on Android 2015-02-27 10:29:39 +01:00
Connor Pearson
607e5d66ad update docs for StatusBarBackgroundColor
The default value is no longer black. (CB-7486)
2015-01-07 19:55:34 -05:00
34 changed files with 3291 additions and 493 deletions

22
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,22 @@
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
### What does this PR do?
### What testing has been done on this change?
### Checklist
- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ ] Added automated test coverage as appropriate for this change.

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
#If ignorance is bliss, then somebody knock the smile off my face
*.csproj.user
*.suo
*.cache
Thumbs.db
*.DS_Store
*.bak
*.cache
*.log
*.swp
*.user
node_modules

16
.jshintrc Normal file
View File

@@ -0,0 +1,16 @@
{
"browser": true
, "devel": true
, "bitwise": true
, "undef": true
, "trailing": true
, "quotmark": false
, "indent": 4
, "unused": "vars"
, "latedef": "nofunc"
, "globals": {
"module": false,
"exports": false,
"require": false
}
}

4
.travis.yml Normal file
View File

@@ -0,0 +1,4 @@
language: node_js
sudo: false
node_js:
- "4.2"

View File

@@ -27,7 +27,7 @@ There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/#contribute).
[contribution overview](http://cordova.apache.org/contribute/).
The details are explained there, but the important items are:
- Sign and submit an Apache ICLA (Contributor License Agreement).

347
README.md
View File

@@ -1,22 +1,333 @@
---
title: Statusbar
description: Control the device status bar.
---
<!---
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.
# 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.statusbar
|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI |
|:-:|:-:|:-:|:-:|:-:|:-:|
|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-statusbar)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-statusbar/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-statusbar)|
Plugin documentation: [doc/index.md](doc/index.md)
# cordova-plugin-statusbar
StatusBar
======
> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Statusbar%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
## Installation
This installation method requires cordova 5.0+
cordova plugin add cordova-plugin-statusbar
Older versions of cordova can still install via the __deprecated__ id
cordova plugin add org.apache.cordova.statusbar
It is also possible to install via repo url directly ( unstable )
cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
Preferences
-----------
#### config.xml
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
<preference name="StatusBarOverlaysWebView" value="true" />
- __StatusBarBackgroundColor__ (color hex string, no default value). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.
<preference name="StatusBarBackgroundColor" value="#000000" />
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Android Quirks
The Android 5+ guidelines specify using a different color for the statusbar than your main app color (unlike the uniform statusbar color of many iOS 7+ apps), so you may want to set the statusbar color at runtime instead via `StatusBar.backgroundColorByHexString` or `StatusBar.backgroundColorByName`. One way to do that would be:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
Hiding at startup
-----------
During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file.
Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Methods
-------
This plugin defines global `StatusBar` object.
Although in the global scope, it is not available until after the `deviceready` event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
- StatusBar.overlaysWebView
- StatusBar.styleDefault
- StatusBar.styleLightContent
- StatusBar.styleBlackTranslucent
- StatusBar.styleBlackOpaque
- StatusBar.backgroundColorByName
- StatusBar.backgroundColorByHexString
- StatusBar.hide
- StatusBar.show
Properties
--------
- StatusBar.isVisible
Events
------
- statusTap
Permissions
-----------
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
StatusBar.overlaysWebView
=================
On iOS 7, make the statusbar overlay or not overlay the WebView.
StatusBar.overlaysWebView(true);
Description
-----------
On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions.
Supported Platforms
-------------------
- iOS
Quick Example
-------------
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
StatusBar.styleDefault
=================
Use the default statusbar (dark text, for light backgrounds).
StatusBar.styleDefault();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleLightContent
=================
Use the lightContent statusbar (light text, for dark backgrounds).
StatusBar.styleLightContent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackTranslucent
=================
Use the blackTranslucent statusbar (light text, for dark backgrounds).
StatusBar.styleBlackTranslucent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackOpaque
=================
Use the blackOpaque statusbar (light text, for dark backgrounds).
StatusBar.styleBlackOpaque();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByName
=================
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
StatusBar.backgroundColorByName("red");
Supported color names are:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
Supported Platforms
-------------------
- iOS
- Android 5+
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByHexString
=================
Sets the background color of the statusbar by a hex string.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS shorthand properties are also supported.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
Supported Platforms
-------------------
- iOS
- Android 5+
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.hide
=================
Hide the statusbar.
StatusBar.hide();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.show
=================
Shows the statusbar.
StatusBar.show();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.isVisible
=================
Read this property to see if the statusbar is visible or not.
if (StatusBar.isVisible) {
// do something
}
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
statusTap
=========
Listen for this event to know if the statusbar was tapped.
window.addEventListener('statusTap', function() {
// scroll-up with document.body.scrollTop = 0; or do whatever you want
});
Supported Platforms
-------------------
- iOS

View File

@@ -20,49 +20,121 @@
-->
# Release Notes
### 0.1.5 (Apr 17, 2014) (First release as a core Cordova Plugin)
* CB-6316: Added README.md which point to the new location for docs
* CB-6316: Added license header to the documentation. Added README.md which point to the new location for docs
* CB-6316: Moved StatusBar plugin documentation to docs folder
* CB-6314: [android] Add StatusBar.isVisible support to Android
* CB-6460: Update license headers
### 2.2.1 (Dec 07, 2016)
* [CB-10288](https://issues.apache.org/jira/browse/CB-10288) statusbar plugin interaction with iOS multitasking
* [CB-10158](https://issues.apache.org/jira/browse/CB-10158) (ios) fix StatusBar issue when recovering from fullscreen video
* [CB-10341](https://issues.apache.org/jira/browse/CB-10341) ios, document statusTap event
* [CB-11191](https://issues.apache.org/jira/browse/CB-11191) Statusbar plugin causing issues with webview size
* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
### 0.1.6 (Jun 05, 2014)
* CB-6783 - added StatusBarStyle config preference, updated docs (closes #9)
* CB-6812 Add license
* CB-6491 add CONTRIBUTING.md
* CB-6264 minor formatting issue
* Update docs with recent WP changes, remove 'clear' from the loist of named colors in documentation
* CB-6513 - Statusbar plugin for Android is not compiling
### 2.2.0 (Sep 08, 2016)
* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
* Handle extended status bar on **iOS**
* Plugin uses `Android Log class` and not `Cordova LOG class`
* [CB-11287](https://issues.apache.org/jira/browse/CB-11287) (**ios**) - fix webview resize after modal on **iPhones**
* [CB-11485](https://issues.apache.org/jira/browse/CB-11485) fix resize on rotation with popover
* Add badges for paramedic builds on Jenkins
* [CB-11197](https://issues.apache.org/jira/browse/CB-11197) Keep status bar hidden when keyboard pops up
* Add pull request template.
* [CB-10866](https://issues.apache.org/jira/browse/CB-10866) Adding engine info to `package.json`
* patched missing `_ready` method, and changed the way the proxy is installed
* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
### 2.1.3 (Apr 15, 2016)
* [CB-11018](https://issues.apache.org/jira/browse/CB-11018) Fix statusbar with `inappbrowser` causing incorrect orientation on **iOS8**
* [CB-10884](https://issues.apache.org/jira/browse/CB-10884) `Inappbrowser` breaks UI while Screen orientation changes from landscape to portrait on **iOS**
### 2.1.2 (Mar 09, 2016)
* [CB-10752](https://issues.apache.org/jira/browse/CB-10752) for for status bar overlays the webview on **iOS** 6 in some cases
* [CB-10683](https://issues.apache.org/jira/browse/CB-10683) Fix wrong StatusBar.isVisible initial value on **Windows**
* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
* [CB-10047](https://issues.apache.org/jira/browse/CB-10047) fix **iOS** 8 deprecated warnings
### 2.1.1 (Feb 09, 2016)
* [CB-10102](https://issues.apache.org/jira/browse/CB-10102) The removeObserver code was wrong and it might crash on plugin deallocation
### 2.1.0 (Jan 15, 2016)
* [CB-9513](https://issues.apache.org/jira/browse/CB-9513) Allow to show/hide status bar in fullscreen mode.
* [CB-8720](https://issues.apache.org/jira/browse/CB-8720) Fix status bar position when app started upside down on **iOS 7**.
* [CB-10118](https://issues.apache.org/jira/browse/CB-10118) Fixes plugin loading error for **Browser** platform
### 2.0.0 (Nov 18, 2015)
* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
* Added `weakSelf` reference for block use
* Fixes [CB-4712](https://issues.apache.org/jira/browse/CB-4712), [CB-5439](https://issues.apache.org/jira/browse/CB-5439) statusbar issues
* Fixing contribute link.
* [CB-7965](https://issues.apache.org/jira/browse/CB-7965) Add cordova-plugin-statusbar support for **Browser** platform
* Don't use `IsAtLeastiOSVersion` macro to determine height
* Use correct statusbar height for landscape orientation in iOS >= 8
* remove travis-ci
* [CB-9202](https://issues.apache.org/jira/browse/CB-9202) updated repo url to github mirror in package.json
* Added verbose install text for users on < cordova 5.0
* update docs for `StatusBarBackgroundColor`
### 1.0.1 (Jun 17, 2015)
* add auto-tests for basic api
* [CB-9180](https://issues.apache.org/jira/browse/CB-9180) Add correct supported check for Windows 8.1 desktop
* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* fix npm md issue
### 1.0.0 (Apr 15, 2015)
* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
* Use TRAVIS_BUILD_DIR, install paramedic by npm
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
* - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme.
* - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up
* Allow setting the statusbar backgroundcolor on Android
* [CB-8575](https://issues.apache.org/jira/browse/CB-8575) Integrate TravisCI
* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
### 0.1.10 (Feb 04, 2015)
* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
### 0.1.9 (Dec 02, 2014)
* Fix onload attribute within <feature> to be a <param>
* [CB-8010](https://issues.apache.org/jira/browse/CB-8010) - Statusbar colour does not change to orange
* added checks for running on windows when StatusBar is NOT available
* [CB-7986](https://issues.apache.org/jira/browse/CB-7986) Add cordova-plugin-statusbar support for **Windows Phone 8.1**
* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
* [CB-7979](https://issues.apache.org/jira/browse/CB-7979) Each plugin doc should have a ## Installation section
* Inserting leading space after # for consistency
* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) - (Re-fix) `StatusBar` **iOS 8** Landscape issue (closes #15)
* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
### 0.1.8 (Sep 17, 2014)
* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) [StatusBar][iOS 8] Landscape issue
* [CB-7486](https://issues.apache.org/jira/browse/CB-7486) Remove StatusBarBackgroundColor intial preference (black background) so background will be initially transparent
* Renamed test dir, added nested plugin.xml
* added documentation for manual tests, moved background color test below overlay test
* [CB-7195](https://issues.apache.org/jira/browse/CB-7195) ported statusbar tests to framework
### 0.1.7 (Aug 06, 2014)
* Add LICENSE and NOTICE
* Update statusbar.js
* Update backgroundColorByHexString function
* ios: Use a persistent callbackId instead of calling sendJs
* CB-6626 ios: Add a JS event for tapping on statusbar
* [CB-6626](https://issues.apache.org/jira/browse/CB-6626) ios: Add a JS event for tapping on statusbar
* ios: Fix hide to adjust webview's frame only when status bar is not overlaying webview
* CB-6127 Updated translations for docs
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
* android: Fix StatusBar.initialize() not running on UI thread
### 0.1.8 (Sep 17, 2014)
* CB-7549 [StatusBar][iOS 8] Landscape issue
* CB-7486 Remove StatusBarBackgroundColor intial preference (black background) so background will be initially transparent
* Renamed test dir, added nested plugin.xml
* added documentation for manual tests, moved background color test below overlay test
* CB-7195 ported statusbar tests to framework
### 0.1.6 (Jun 05, 2014)
* [CB-6783](https://issues.apache.org/jira/browse/CB-6783) - added StatusBarStyle config preference, updated docs (closes #9)
* [CB-6812](https://issues.apache.org/jira/browse/CB-6812) Add license
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
* [CB-6264](https://issues.apache.org/jira/browse/CB-6264) minor formatting issue
* Update docs with recent WP changes, remove 'clear' from the loist of named colors in documentation
* [CB-6513](https://issues.apache.org/jira/browse/CB-6513) - Statusbar plugin for Android is not compiling
### 0.1.9 (Dec 02, 2014)
* Fix onload attribute within <feature> to be a <param>
* CB-8010 - Statusbar colour does not change to orange
* added checks for running on windows when StatusBar is NOT available
* CB-7986 Add cordova-plugin-statusbar support for **Windows Phone 8.1**
* CB-7977 Mention `deviceready` in plugin docs
* CB-7979 Each plugin doc should have a ## Installation section
* Inserting leading space after # for consistency
* CB-7549 - (Re-fix) `StatusBar` **iOS 8** Landscape issue (closes #15)
* CB-7700 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* CB-7571 Bump version of nested plugin to match parent plugin
### 0.1.10 (Feb 04, 2015)
* CB-8351 ios: Use argumentForIndex rather than NSArray extension
### 0.1.5 (Apr 17, 2014) (First release as a core Cordova Plugin)
* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added README.md which point to the new location for docs
* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added license header to the documentation. Added README.md which point to the new location for docs
* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Moved StatusBar plugin documentation to docs folder
* [CB-6314](https://issues.apache.org/jira/browse/CB-6314): [android] Add StatusBar.isVisible support to Android
* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers

276
doc/de/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## "Einstellungen"
#### "config.xml"
* **StatusBarOverlaysWebView** (Boolean, der Standardwert ist True). Stellen Sie auf iOS 7 die Statusbar-Overlay oder keine Überlagerung der WebView beim Start.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (Farbe hex String, Standardwert ist #000000). Auf iOS legen 7 und Android 5, Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) beim Start.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (Status Bar-Stil, der Standardwert ist Lightcontent). Legen Sie auf iOS 7 den Status-Bar-Stil. Verfügbaren Optionen Standard, Lightcontent, Blacktranslucent, Blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Android Eigenarten
Die Android 5 + Leitlinien angeben, verwenden eine andere Farbe für die Statusbar als Ihre Hauptanwendung Farbe (anders als die einheitliche Statusbar Farbe viele iOS 7 + apps), so Sie die Statusbar Farbe zur Laufzeit statt über `StatusBar.backgroundColorByHexString` oder `StatusBar.backgroundColorByName`festzulegen möchten vielleicht. Eine Möglichkeit dazu wäre:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## Beim Start ausblenden
Während der Laufzeit können Sie die StatusBar.hide-Funktion unten, aber die StatusBar beim Start der app versteckt werden soll, müssen Sie Ihre app Info.plist Datei ändern.
Diese beiden Attribute hinzufügen/bearbeiten, wenn nicht vorhanden. Legen Sie **"Statusleiste ist anfangs ausgeblendet"** auf **"YES"** und **"View Controller-basierte Status Bar aussehen"** auf **"NO"**. Wenn Sie es manuell ohne Xcode bearbeiten, werden die Schlüssel und Werte:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## Methoden
Dieses Plugin wird globales `StatusBar`-Objekt definiert.
Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## Eigenschaften
* StatusBar.isVisible
## Berechtigungen
#### "config.xml"
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
Stellen Sie auf iOS 7 Statusbar überlagern oder nicht überlagert die WebView.
StatusBar.overlaysWebView(true);
## Beschreibung
Auf iOS 7 zu der Statusbar wie iOS 6 erscheinen auf False festgelegt. Legen Sie die Stil und Hintergrund Farbe entsprechend mit den anderen Funktionen.
## Unterstützte Plattformen
* iOS
## Kurzes Beispiel
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
Verwenden Sie die Standard-Statusbar (dunkle Text, für helle Hintergründe).
StatusBar.styleDefault();
## Unterstützte Plattformen
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleLightContent
Verwenden Sie die LightContent-Statusbar (heller Text, für dunkle Hintergründe).
StatusBar.styleLightContent();
## Unterstützte Plattformen
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackTranslucent
Verwenden Sie die BlackTranslucent-Statusbar (heller Text, für dunkle Hintergründe).
StatusBar.styleBlackTranslucent();
## Unterstützte Plattformen
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackOpaque
Verwenden Sie die BlackOpaque-Statusbar (heller Text, für dunkle Hintergründe).
StatusBar.styleBlackOpaque();
## Unterstützte Plattformen
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByName
Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von Farbnamen festlegen.
StatusBar.backgroundColorByName("red");
Unterstützte Farbnamen sind:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## Unterstützte Plattformen
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByHexString
Legt die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge fest.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS-Kurzschrift-Eigenschaften werden ebenfalls unterstützt.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) festlegen.
Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-Wert ist
## Unterstützte Plattformen
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.hide
Ausblenden der Statusleiste.
StatusBar.hide();
## Unterstützte Plattformen
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.show
Zeigt die Statusleiste.
StatusBar.show();
## Unterstützte Plattformen
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.isVisible
Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder nicht ist.
if (StatusBar.isVisible) {
// do something
}
## Unterstützte Plattformen
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## "Einstellungen"
#### config.xml
@@ -56,6 +61,16 @@ Diese beiden Attribute hinzufügen/bearbeiten, wenn nicht vorhanden. Legen Sie *
## Methoden
Dieses Plugin wird globales `StatusBar`-Objekt definiert.
Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Verwenden Sie die Standard-Statusbar (dunkle Text, für helle Hintergründe).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Verwenden Sie die LightContent-Statusbar (heller Text, für dunkle Hintergründe
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Verwenden Sie die BlackTranslucent-Statusbar (heller Text, für dunkle Hintergr
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Verwenden Sie die BlackOpaque-Statusbar (heller Text, für dunkle Hintergründe)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Unterstützte Farbnamen sind:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Ausblenden der Statusleiste.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Zeigt die Statusleiste.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder ni
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone-8.1

276
doc/es/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar.
## Instalación
cordova plugin add cordova-plugin-statusbar
## Preferencias
#### config.xml
* **StatusBarOverlaysWebView** (boolean, true por defecto). En iOS 7, hacer la superposición statusbar o no superponer la WebView al inicio.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (color hex string por defecto #000000). IOS 7 y 5 Android, configurar el color de fondo de la barra de estado por una cadena hexadecimal (#RRGGBB) en el arranque.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (status bar estilo por defecto lightcontent). En iOS 7, definir el estilo de barra de estado. Por defecto las opciones disponibles, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Rarezas Android
Android 5 + pautas especifican utilizando un color diferente para la barra de estado que la aplicación principal de color (a diferencia del color de barra de estado uniforme de muchas apps de iOS 7 +), por lo que puede establecer el color de la barra de estado en tiempo de ejecución en su lugar a través de `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Una forma de hacerlo sería:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## Escondido en el arranque
Durante el tiempo de ejecución puede utilizar la función StatusBar.hide abajo, pero si quieres la barra de estado que está escondido en el inicio de la aplicación, se debe modificar el archivo Info.plist de su aplicación.
Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"Aparición de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## Métodos
Este plugin define global `StatusBar` objeto.
Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## Propiedades
* StatusBar.isVisible
## Permisos
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
En iOS 7, hacer la barra de estado superposición o no superponer la vista Web.
StatusBar.overlaysWebView(true);
## Descripción
En iOS 7, establecida en false para que la barra de estado aparezca como iOS 6. Establece el color de fondo y estilo para utilizar las otras funciones.
## Plataformas soportadas
* iOS
## Ejemplo rápido
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
Utilice la barra de estado por defecto (texto oscuro, para fondos de luz).
StatusBar.styleDefault();
## Plataformas soportadas
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
Utilice la barra de estado lightContent (texto ligero, para fondos oscuros).
StatusBar.styleLightContent();
## Plataformas soportadas
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros).
StatusBar.styleBlackTranslucent();
## Plataformas soportadas
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros).
StatusBar.styleBlackOpaque();
## Plataformas soportadas
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede establecer el color de fondo de la barra de estado nombre del color.
StatusBar.backgroundColorByName("red");
Nombres de los colores admitidos son:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## Plataformas soportadas
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
Establece el color de fondo de la barra de estado por una cadena hexadecimal.
StatusBar.backgroundColorByHexString("#C0C0C0");
Propiedades CSS abreviada también son compatibles.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB).
En WP7 y WP8 también puede especificar valores como #AARRGGBB, donde AA es un valor alfa
## Plataformas soportadas
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
Ocultar la barra de estado.
StatusBar.hide();
## Plataformas soportadas
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
Muestra la barra de estado.
StatusBar.show();
## Plataformas soportadas
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Lea esta propiedad para ver si la barra de estado es visible o no.
if (StatusBar.isVisible) {
// do something
}
## Plataformas soportadas
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar.
## Instalación
Cordova plugin agregar cordova-plugin-statusbar
## Preferencias
#### config.xml
@@ -48,14 +53,19 @@ Durante el tiempo de ejecución puede utilizar la función StatusBar.hide abajo,
Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"Aparición de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
< llave > UIStatusBarHidden < / key >< verdadero / >< llave > UIViewControllerBasedStatusBarAppearance < / key >< falso / >
## Métodos
Este plugin define global `StatusBar` objeto.
Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
document.addEventListener ("deviceready", onDeviceReady, false);
function onDeviceReady() {console.log(StatusBar)};
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -74,9 +84,7 @@ Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
< nombre de la función = "StatusBar" >< nombre param = "ios-paquete" value = "CDVStatusBar" onload = "true" / >< / característica >
# StatusBar.overlaysWebView
@@ -112,6 +120,7 @@ Utilice la barra de estado por defecto (texto oscuro, para fondos de luz).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +134,7 @@ Utilice la barra de estado lightContent (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +148,7 @@ Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +162,7 @@ Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -161,7 +173,7 @@ En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede est
Nombres de los colores admitidos son:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
negro, gris oscuro, lightGray, blanco, gris, rojo, verde, azul, cian, amarillo, magenta, naranja, púrpura, marrón
## Plataformas soportadas
@@ -169,6 +181,7 @@ Nombres de los colores admitidos son:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -179,8 +192,7 @@ Establece el color de fondo de la barra de estado por una cadena hexadecimal.
Propiedades CSS abreviada también son compatibles.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
StatusBar.backgroundColorByHexString("#333"); = > StatusBar.backgroundColorByHexString("#FAB") #333333; = > #FFAABB
En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB).
@@ -192,6 +204,7 @@ En WP7 y WP8 también puede especificar valores como #AARRGGBB, donde AA es un v
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +219,7 @@ Ocultar la barra de estado.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,14 +234,13 @@ Muestra la barra de estado.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Lea esta propiedad para ver si la barra de estado es visible o no.
if (StatusBar.isVisible) {
// do something
}
Si (StatusBar.isVisible) {/ / hacer algo}
## Plataformas soportadas
@@ -235,4 +248,5 @@ Lea esta propiedad para ver si la barra de estado es visible o no.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

276
doc/fr/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## Préférences
#### config.Xml
* **StatusBarOverlaysWebView** (boolean, la valeur par défaut true). Sur iOS 7, faire la superposition de statusbar ou pas superposition le WebView au démarrage.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (chaîne hexadécimale de couleur, par défaut, #000000). Sur iOS 7 et 5 Android, définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB) au démarrage.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (style de barre de statut, par défaut, lightcontent). Sur iOS 7, définir le style de barre de statut. Par défaut les options disponibles, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Quirks Android
Les lignes directrices 5 + Android spécifient à l'aide d'une couleur différente pour la barre d'État à votre application principale couleur (contrairement à la couleur uniforme statusbar de nombreuses applications iOS 7 +), donc vous pouvez définir la couleur de la barre d'état lors de l'exécution au lieu de cela via `StatusBar.backgroundColorByHexString` ou `StatusBar.backgroundColorByName`. Une façon de le faire serait :
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## Cacher au démarrage
Pendant l'exécution, vous pouvez utiliser la fonction StatusBar.hide en bas, mais si vous souhaitez que la barre d'État pour être caché au démarrage de l'application, vous devez modifier le fichier Info.plist de votre application.
Ajouter/modifier ces deux attributs si n'est pas présent. **"Barre d'État est initialement masqué"** la valeur **"** Yes" et **"À l'apparence vue sur contrôleur statut bar"** la valeur **"Non"**. Si vous modifiez manuellement sans Xcode, les clés et les valeurs sont :
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## Méthodes
Ce plugin définit objet `StatusBar` global.
Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## Propriétés
* StatusBar.isVisible
## Autorisations
#### config.Xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView.
StatusBar.overlaysWebView(true);
## Description
Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions.
## Plates-formes supportées
* iOS
## Exemple court
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans lumineux).
StatusBar.styleDefault();
## Plates-formes supportées
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres).
StatusBar.styleLightContent();
## Plates-formes supportées
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans sombres).
StatusBar.styleBlackTranslucent();
## Plates-formes supportées
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres).
StatusBar.styleBlackOpaque();
## Plates-formes supportées
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par nom de couleur.
StatusBar.backgroundColorByName("red");
Les noms de couleurs prises en charge sont :
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## Plates-formes supportées
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
Définit la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale.
StatusBar.backgroundColorByHexString("#C0C0C0");
Propriétés de raccourci CSS sont également pris en charge.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB).
Sur WP7 et WP8, vous pouvez également spécifier des valeurs comme #AARRGGBB, où AA représente une valeur alpha
## Plates-formes supportées
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
Masquer la barre d'État.
StatusBar.hide();
## Plates-formes supportées
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
Affiche la barre d'État.
StatusBar.show();
## Plates-formes supportées
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Lire cette propriété afin de voir si la barre d'État est visible ou non.
if (StatusBar.isVisible) {
// do something
}
## Plates-formes supportées
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## Préférences
#### config.xml
@@ -56,6 +61,16 @@ Ajouter/modifier ces deux attributs si n'est pas présent. **"Barre d'État est
## Méthodes
Ce plugin définit objet `StatusBar` global.
Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -90,11 +105,11 @@ Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView.
Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions.
## Plates-formes prises en charge
## Plates-formes supportées
* iOS
## Petit exemple
## Exemple court
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
@@ -104,7 +119,7 @@ Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définiss
Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans lumineux).
StatusBar.styleDefault() ;
StatusBar.styleDefault();
## Plates-formes prises en charge
@@ -112,6 +127,7 @@ Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans l
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans somb
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Les noms de couleurs prises en charge sont :
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Sur WP7 et WP8, vous pouvez également spécifier des valeurs comme #AARRGGBB, o
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Masquer la barre d'État.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Affiche la barre d'État.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -230,9 +253,10 @@ Lire cette propriété afin de voir si la barre d'État est visible ou non.
}
## Plates-formes prises en charge
## Plates-formes supportées
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -1,284 +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.statusbar
StatusBar
======
> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
## Installation
cordova plugin add org.apache.cordova.statusbar
Preferences
-----------
#### config.xml
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
<preference name="StatusBarOverlaysWebView" value="true" />
- __StatusBarBackgroundColor__ (color hex string, defaults to #000000). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup.
<preference name="StatusBarBackgroundColor" value="#000000" />
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
Hiding at startup
-----------
During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file.
Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Methods
-------
This plugin defines global `StatusBar` object.
Although in the global scope, it is not available until after the `deviceready` event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
- StatusBar.overlaysWebView
- StatusBar.styleDefault
- StatusBar.styleLightContent
- StatusBar.styleBlackTranslucent
- StatusBar.styleBlackOpaque
- StatusBar.backgroundColorByName
- StatusBar.backgroundColorByHexString
- StatusBar.hide
- StatusBar.show
Properties
--------
- StatusBar.isVisible
Permissions
-----------
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
StatusBar.overlaysWebView
=================
On iOS 7, make the statusbar overlay or not overlay the WebView.
StatusBar.overlaysWebView(true);
Description
-----------
On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions.
Supported Platforms
-------------------
- iOS
Quick Example
-------------
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
StatusBar.styleDefault
=================
Use the default statusbar (dark text, for light backgrounds).
StatusBar.styleDefault();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleLightContent
=================
Use the lightContent statusbar (light text, for dark backgrounds).
StatusBar.styleLightContent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackTranslucent
=================
Use the blackTranslucent statusbar (light text, for dark backgrounds).
StatusBar.styleBlackTranslucent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackOpaque
=================
Use the blackOpaque statusbar (light text, for dark backgrounds).
StatusBar.styleBlackOpaque();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByName
=================
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
StatusBar.backgroundColorByName("red");
Supported color names are:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByHexString
=================
Sets the background color of the statusbar by a hex string.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS shorthand properties are also supported.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.hide
=================
Hide the statusbar.
StatusBar.hide();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.show
=================
Shows the statusbar.
StatusBar.show();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.isVisible
=================
Read this property to see if the statusbar is visible or not.
if (StatusBar.isVisible) {
// do something
}
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1

276
doc/it/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar.
## Installazione
cordova plugin add cordova-plugin-statusbar
## Preferenze
#### config. XML
* **StatusBarOverlaysWebView** (boolean, default è true). IOS 7, rendono la statusbar sovrapposizione o la non sovrapposizione WebView all'avvio.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (stringa esadecimale di colore, il valore predefinito è #000000). Su iOS 7 e 5 Android, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB) all'avvio.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (status bar in stile, default è lightcontent). IOS 7, impostare lo stile di barra di stato. Predefinita di opzioni disponibili, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Stranezze Android
Le linee 5 + Android Guida specificano utilizzando un colore diverso per la barra di stato che l'app principale di colore (a differenza di colore uniforme statusbar di molte applicazioni di iOS 7 +), quindi si consiglia di impostare il colore della barra di stato in fase di esecuzione invece tramite `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Un modo per farlo sarebbe:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## Nascondendo all'avvio
In fase di esecuzione è possibile utilizzare la funzione di StatusBar.hide qui sotto, ma se si desidera che la barra di stato venga nascosta all'avvio di app, è necessario modificare il file info. plist dell'app.
Aggiungere o modificare questi due attributi, se non presente. Impostare la **"barra di stato è inizialmente nascosto"** a **"YES"** e **"Aspetto di vista basati su controller status bar"** a **"NO"**. Se si modifica manualmente senza Xcode, le chiavi e i valori sono:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## Metodi
Questo plugin definisce globale oggetto `StatusBar`.
Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## Proprietà
* StatusBar.isVisible
## Autorizzazioni
#### config. XML
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
IOS 7, rendono la statusbar sovrapposizione o non sovrapporre WebView.
StatusBar.overlaysWebView(true);
## Descrizione
IOS 7, impostato su false per rendere la barra di stato vengono visualizzati come iOS 6. Impostare il colore di sfondo e stile per soddisfare utilizzando altre funzioni.
## Piattaforme supportate
* iOS
## Esempio rapido
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce).
StatusBar.styleDefault();
## Piattaforme supportate
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri).
StatusBar.styleLightContent();
## Piattaforme supportate
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri).
StatusBar.styleBlackTranslucent();
## Piattaforme supportate
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri).
StatusBar.styleBlackOpaque();
## Piattaforme supportate
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato con il nome di colore.
StatusBar.backgroundColorByName("red");
Nomi di colore supportati sono:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## Piattaforme supportate
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
Imposta il colore di sfondo della barra di stato di una stringa esadecimale.
StatusBar.backgroundColorByHexString("#C0C0C0");
Proprietà di scrittura stenografica CSS sono supportati anche.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB).
Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA è un valore alfa
## Piattaforme supportate
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
Nascondere la barra di stato.
StatusBar.hide();
## Piattaforme supportate
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
Mostra la barra di stato.
StatusBar.show();
## Piattaforme supportate
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Leggere questa proprietà per vedere se la barra di stato è visibile o no.
if (StatusBar.isVisible) {
// do something
}
## Piattaforme supportate
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar.
## Installazione
cordova plugin add cordova-plugin-statusbar
## Preferenze
#### config.xml
@@ -56,6 +61,16 @@ Aggiungere o modificare questi due attributi, se non presente. Impostare la **"b
## Metodi
Questo plugin definisce globale oggetto `StatusBar`.
Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Nomi di colore supportati sono:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Nascondere la barra di stato.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Mostra la barra di stato.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Leggere questa proprietà per vedere se la barra di stato è visibile o no.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

276
doc/ja/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> `StatusBar`オブジェクトは、iOS と Android ステータス バーをカスタマイズするいくつかの機能を提供します。
## インストール
cordova plugin add cordova-plugin-statusbar
## 基本設定
#### config.xml
* **StatusBarOverlaysWebView**(ブール値、デフォルトは true)。IOS 7、起動時にステータスバー オーバーレイまたはないオーバーレイ、WebView を作る。
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor**(カラー 16 進文字列、既定値は #000000)。IOS 7 とアンドロイド 5、16 進文字列 (#RRGGBB) 起動時にステータスバーの背景色を設定します。
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle**(ステータス バーのスタイル、既定値は lightcontent)。Ios 7、ステータス バーのスタイルを設定します。使用可能なオプションのデフォルト、lightcontent、blacktranslucent、blackopaque。
<preference name="StatusBarStyle" value="lightcontent" />
### Android の癖
Android のガイドライン 5 + 指定メイン アプリよりもステータスバーの異なる色を使用して`StatusBar.backgroundColorByHexString`または`StatusBar.backgroundColorByName`経由で代わりに実行時にステータス バーの色を設定する場合がありますので (とは違って制服ステータスバー色多くの iOS 7 + アプリの) 色します。 それを行う方法の 1 つになります。
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## 起動時に非表示
実行時に下に、StatusBar.hide 関数を使用できますが、StatusBar アプリ起動時に非表示にする場合は、アプリの Info.plist ファイルを変更する必要があります。
これら 2 つの属性の追加/編集存在しない場合。 **「ステータス バーが非表示最初」** **"YES"**を設定し、 **「ビュー コント ローラー ベースのステータス バーの外観」** **"NO"**にします。 Xcode せず手動で編集する、キーと値は。
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## メソッド
このプラグインでは、グローバル `StatusBar` オブジェクトを定義します。
グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## プロパティ
* StatusBar.isVisible
## アクセス許可
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
IOS 7、statusbar オーバーレイまたはない WebView をオーバーレイします。
StatusBar.overlaysWebView(true);
## 解説
IOS 7、iOS の 6 のように表示されるステータスバーを false に設定します。他の関数の使用に合わせてスタイルや背景色を設定します。
## サポートされているプラットフォーム
* iOS
## 簡単な例
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
既定ステータス バー (暗いテキスト、淡色の背景) を使用します。
StatusBar.styleDefault();
## サポートされているプラットフォーム
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
LightContent ステータスバー (暗い背景の明るいテキスト) を使用します。
StatusBar.styleLightContent();
## サポートされているプラットフォーム
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
BlackTranslucent ステータスバー (暗い背景の明るいテキスト) を使用します。
StatusBar.styleBlackTranslucent();
## サポートされているプラットフォーム
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
BlackOpaque ステータスバー (暗い背景の明るいテキスト) を使用します。
StatusBar.styleBlackOpaque();
## サポートされているプラットフォーム
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色の色の名前によって設定できます。
StatusBar.backgroundColorByName("red");
サポートされている色の名前は次のとおりです。
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## サポートされているプラットフォーム
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
16 進文字列をステータス バーの背景色を設定します。
StatusBar.backgroundColorByHexString("#C0C0C0");
速記の CSS プロパティもサポートされています。
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色を 16 進文字列 (#RRGGBB) で設定できます。
WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値として
## サポートされているプラットフォーム
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
ステータスバーを隠します。
StatusBar.hide();
## サポートされているプラットフォーム
* iOS
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
ステータス バーが表示されます。
StatusBar.show();
## サポートされているプラットフォーム
* iOS
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
このプロパティ、ステータスバーが表示されるかどうかをお読みください。
if (StatusBar.isVisible) {
// do something
}
## サポートされているプラットフォーム
* iOS
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`オブジェクトは、iOS と Android ステータス バーをカスタマイズするいくつかの機能を提供します。
## インストール
cordova plugin add cordova-plugin-statusbar
## 基本設定
#### config.xml
@@ -56,6 +61,16 @@
## メソッド
このプラグインでは、グローバル `StatusBar` オブジェクトを定義します。
グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -86,7 +101,7 @@ IOS 7、statusbar オーバーレイまたはない WebView をオーバーレ
StatusBar.overlaysWebView(true);
## 説
##
IOS 7、iOS の 6 のように表示されるステータスバーを false に設定します。他の関数の使用に合わせてスタイルや背景色を設定します。
@@ -112,6 +127,7 @@ IOS 7、iOS の 6 のように表示されるステータスバーを false に
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ LightContent ステータスバー (暗い背景の明るいテキスト) を
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ BlackTranslucent ステータスバー (暗い背景の明るいテキスト)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ BlackOpaque ステータスバー (暗い背景の明るいテキスト) を
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はス
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* iOS
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

276
doc/ko/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> `StatusBar`개체 iOS와 안 드 로이드 상태 표시줄을 사용자 지정 하려면 몇 가지 기능을 제공 합니다.
## 설치
cordova plugin add cordova-plugin-statusbar
## 환경 설정
#### config.xml
* **StatusBarOverlaysWebView** (boolean, 기본값: true)입니다. IOS 7, 시작 시 상태 표시줄 오버레이 또는 WebView 중첩 되지 확인 합니다.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (색상 16 진수 문자열 기본값: #000000). IOS에서 7과 안 드 로이드 5 시작 시 16 진수 문자열 (#RRGGBB) 상태 표시줄의 배경색을 설정 합니다.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (상태 표시줄 스타일, 기본값: lightcontent). Ios 7, 상태 표시줄 스타일을 설정 합니다. 사용 가능한 옵션 기본, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### 안 드 로이드 단점
안 드 로이드 5 + 지침 보다 귀하의 주요 응용 프로그램 상태 표시줄에 대 한 다른 색을 사용 하 여 지정한 색상 (와 달리 균일 한 상태 표시줄의 색상 많은 iOS 7 + 애플 리 케이 션), `StatusBar.backgroundColorByHexString` 또는 `StatusBar.backgroundColorByName`를 통해 대신 런타임에 상태 표시줄 색을 설정 하고자 할 수 있습니다. 한 가지 방법은 일 것입니다.
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## 시작 시 숨기기
런타임 동안 아래의 StatusBar.hide 함수를 사용할 수 있습니다 하지만 당신이 원하는 응용 프로그램 시작 시 숨겨진 상태 표시줄, 응용 프로그램의 Info.plist 파일 수정 해야 합니다.
추가 편집이 두 특성이 없는 경우. **"상태 표시줄 처음 숨겨진"** **"YES"** 로 설정 하 고 **"뷰 컨트롤러 기반 상태 표시줄 모양"** **"NO"**로 설정 합니다. Xcode, 열쇠 없이 수동으로 편집 하는 경우 값은:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## 메서드
이 플러그인 글로벌 `StatusBar` 개체를 정의합니다.
전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## 속성
* StatusBar.isVisible
## 사용 권한
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
IOS 7, 오버레이 또는 하지 WebView 중첩 상태 표시줄을 확인 합니다.
StatusBar.overlaysWebView(true);
## 설명
7 iOS, iOS 6 처럼 나타나는 상태 표시줄을 false로 설정 합니다. 다른 함수를 사용 하 여에 맞게 스타일과 배경 색상을 설정 합니다.
## 지원 되는 플랫폼
* iOS
## 빠른 예제
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
기본 상태 표시줄 (어두운 텍스트, 밝은 배경에 대 한)를 사용 합니다.
StatusBar.styleDefault();
## 지원 되는 플랫폼
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
LightContent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
StatusBar.styleLightContent();
## 지원 되는 플랫폼
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
BlackTranslucent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
StatusBar.styleBlackTranslucent();
## 지원 되는 플랫폼
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
BlackOpaque 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
StatusBar.styleBlackOpaque();
## 지원 되는 플랫폼
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 색상 이름으로.
StatusBar.backgroundColorByName("red");
지원 되는 색 이름입니다.
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## 지원 되는 플랫폼
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
16 진수 문자열 상태 표시줄의 배경색을 설정합니다.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS 대표 속성 지원 됩니다.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 16 진수 문자열 (#RRGGBB)에 의해.
WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정할 수 있습니다.
## 지원 되는 플랫폼
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
숨기기 상태 표시줄.
StatusBar.hide();
## 지원 되는 플랫폼
* iOS
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
상태 표시줄을 표시합니다.
StatusBar.show();
## 지원 되는 플랫폼
* iOS
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
이 속성을 상태 표시줄 표시 되는 경우 읽기.
if (StatusBar.isVisible) {
// do something
}
## 지원 되는 플랫폼
* iOS
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`개체 iOS와 안 드 로이드 상태 표시줄을 사용자 지정 하려면 몇 가지 기능을 제공 합니다.
## 설치
cordova plugin add cordova-plugin-statusbar
## 환경 설정
#### config.xml
@@ -56,6 +61,16 @@
## 메서드
이 플러그인 글로벌 `StatusBar` 개체를 정의합니다.
전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ IOS 7, 오버레이 또는 하지 WebView 중첩 상태 표시줄을 확인 합
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ LightContent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ BlackTranslucent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ BlackOpaque 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* iOS
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

276
doc/pl/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar.
## Instalacja
cordova plugin add cordova-plugin-statusbar
## Preferencje
#### config.xml
* **StatusBarOverlaysWebView** (boolean, domyślnie na wartość true). Na iOS 7 zrobić nakładki stanu lub nie nakładki widoku sieci Web podczas uruchamiania.
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor** (kolor ciąg szesnastkowy, domyślnie #000000). Na iOS 7 i Android 5 kolor tła stanu przez ciąg szesnastkowy (#RRGGBB) przy starcie systemu.
<preference name="StatusBarBackgroundColor" value="#000000" />
* **StatusBarStyle** (stan styl paska, domyślnie lightcontent.) Na iOS 7 ustawić styl paska stanu. Dostępne opcje domyślne, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Dziwactwa Androida
Android 5 + wytyczne określają przy użyciu różnych kolorów statusbar niż główne aplikacji kolor (w przeciwieństwie do stanu jednolitych kolorów wiele aplikacje iOS 7 +), więc może chcesz ustawić kolor pasek stanu w czasie wykonywania zamiast za pośrednictwem `StatusBar.backgroundColorByHexString` lub `StatusBar.backgroundColorByName`. Jednym sposobem na to byłoby:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## Przy starcie
Podczas uruchamiania można użyć funkcji StatusBar.hide poniżej, ale jeśli chcesz StatusBar ukryty w uruchamiania aplikacji, należy zmodyfikować plik Info.plist Twojej aplikacji.
Dodawanie/edycja tych dwóch atrybutów jeśli nie obecny. Ustawianie **"pasek stanu jest początkowo ukryte"** na **"Tak"** i **"Oparte na kontroler stanu paska wygląd"** na **"Nie"**. Jeśli możesz go edytować ręcznie bez Xcode, kluczy i wartości są:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## Metody
Ten plugin definiuje obiekt globalny `StatusBar`.
Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## Właściwości
* StatusBar.isVisible
## Uprawnienia
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
Na iOS 7 zrobić statusbar nakładki lub nie nakładka widoku sieci Web.
StatusBar.overlaysWebView(true);
## Opis
Na iOS 7 zestaw do false, aby na pasku stanu pojawia się jak iOS 6. Ustaw kolor tła i styl do korzystania z innych funkcji.
## Obsługiwane platformy
* iOS
## Szybki przykład
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
Użyj domyślnego stanu (ciemny tekst, teł światła).
StatusBar.styleDefault();
## Obsługiwane platformy
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
Użyj lightContent stanu (światło tekst, ciemne tło).
StatusBar.styleLightContent();
## Obsługiwane platformy
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
Użyj blackTranslucent stanu (światło tekst, ciemne tło).
StatusBar.styleBlackTranslucent();
## Obsługiwane platformy
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
Użyj blackOpaque stanu (światło tekst, ciemne tło).
StatusBar.styleBlackOpaque();
## Obsługiwane platformy
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez nazwę koloru.
StatusBar.backgroundColorByName("red");
Nazwy kolorów obsługiwane są:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## Obsługiwane platformy
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
Ustawia kolor tła stanu przez ciąg szesnastkowy.
StatusBar.backgroundColorByHexString("#C0C0C0");
Obsługiwane są również właściwości CSS.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez ciąg szesnastkowy (#RRGGBB).
Na WP7 i WP8 można również określić wartości jako #AARRGGBB, gdzie AA jest wartością alfa
## Obsługiwane platformy
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
Ukryj pasek stanu.
StatusBar.hide();
## Obsługiwane platformy
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
Pokazuje pasek stanu.
StatusBar.show();
## Obsługiwane platformy
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Czytać tej właściwość, aby sprawdzić, czy stanu jest widoczne lub nie.
if (StatusBar.isVisible) {
// do something
}
## Obsługiwane platformy
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar.
## Instalacja
cordova plugin add cordova-plugin-statusbar
## Preferencje
#### config.xml
@@ -56,6 +61,16 @@ Dodawanie/edycja tych dwóch atrybutów jeśli nie obecny. Ustawianie **"pasek s
## Metody
Ten plugin definiuje obiekt globalny `StatusBar`.
Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Użyj domyślnego stanu (ciemny tekst, teł światła).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Użyj lightContent stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Użyj blackTranslucent stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Użyj blackOpaque stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Nazwy kolorów obsługiwane są:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Na WP7 i WP8 można również określić wartości jako #AARRGGBB, gdzie AA jest
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Ukryj pasek stanu.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Pokazuje pasek stanu.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Czytać tej właściwość, aby sprawdzić, czy stanu jest widoczne lub nie.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,7 +17,7 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
@@ -235,4 +235,4 @@
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8

276
doc/zh/README.md Normal file
View File

@@ -0,0 +1,276 @@
<!---
# 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-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
# StatusBar
> `StatusBar`物件提供了一些功能,自訂的 iOS 和 Android 狀態列。
## 安裝
cordova plugin add cordova-plugin-statusbar
## 首選項
#### config.xml
* **StatusBarOverlaysWebView**(布林值,預設值為 true。在 iOS 7使狀態列覆蓋或不覆蓋 web 視圖在啟動時。
<preference name="StatusBarOverlaysWebView" value="true" />
* **StatusBarBackgroundColor**(顏色十六進位字串,預設值為 #000000)。IOS 7 和 Android 5由十六進位字串 (#RRGGBB) 在啟動時設置狀態列的背景色。
<preference name="StatusBarBackgroundColor" value="#000000" />
* **狀態列**(狀態列樣式,預設值為 lightcontent。在 iOS 7設置的狀態橫條圖樣式。可用的選項預設lightcontentblacktranslucentblackopaque。
<preference name="StatusBarStyle" value="lightcontent" />
### Android 的怪癖
Android 的 5 + 準則指定使用不同的顏色比您主要的應用程式狀態欄顏色 (不像很多 iOS 7 + 應用程式的統一狀態列顏色),所以你可能想要設置在運行時顯示狀態列顏色而不是通過`StatusBar.backgroundColorByHexString``StatusBar.backgroundColorByName`。 一個的方式做到這一點將是:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
## 在啟動時隱藏
在運行時期間,你可以使用 StatusBar.hide 函數下面,但如果你想要顯示狀態列隱藏在應用程式啟動時,你必須修改你的應用程式的 Info.plist 檔。
添加編輯這兩個屬性,如果不存在。 將**"狀態列最初隱藏"**設置為**"YES"**和**"視圖基於控制器的狀態列外觀"**設置為**"否"**。 如果您手動編輯它沒有 Xcode鍵和值是
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
## 方法
這個外掛程式定義全域 `StatusBar` 物件。
雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
* StatusBar.styleBlackTranslucent
* StatusBar.styleBlackOpaque
* StatusBar.backgroundColorByName
* StatusBar.backgroundColorByHexString
* StatusBar.hide
* StatusBar.show
## 屬性
* StatusBar.isVisible
## 許可權
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
# StatusBar.overlaysWebView
在 iOS 7使狀態列覆蓋或不覆蓋 web 視圖。
StatusBar.overlaysWebView(true);
## 說明
在 iOS 7設置為 false使狀態列出現像 iOS 6。設置樣式和背景顏色適合使用其他函數。
## 支援的平臺
* iOS
## 快速的示例
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
# StatusBar.styleDefault
使用預設狀態列 (淺色背景深色文本)。
StatusBar.styleDefault();
## 支援的平臺
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
使用 lightContent 狀態列 (深色背景光文本)。
StatusBar.styleLightContent();
## 支援的平臺
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
使用 blackTranslucent 狀態列 (深色背景光文本)。
StatusBar.styleBlackTranslucent();
## 支援的平臺
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
使用 blackOpaque 狀態列 (深色背景光文本)。
StatusBar.styleBlackOpaque();
## 支援的平臺
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
在 iOS 7當您將 StatusBar.statusBarOverlaysWebView 設置為 false你可以設置狀態列的背景色的顏色名稱。
StatusBar.backgroundColorByName("red");
支援的顏色名稱是:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
## 支援的平臺
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
由十六進位字串設置狀態列的背景色。
StatusBar.backgroundColorByHexString("#C0C0C0");
此外支援 CSS 速記屬性。
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
在 iOS 7當將 StatusBar.statusBarOverlaysWebView 設置為 false您可以設置狀態列的背景色由十六進位字串 #RRGGBB)。
WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
## 支援的平臺
* iOS
* Android 5+
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
隱藏狀態列。
StatusBar.hide();
## 支援的平臺
* iOS
* Android 系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
顯示狀態列。
StatusBar.show();
## 支援的平臺
* iOS
* Android 系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
讀取此屬性,以查看狀態列是否可見。
if (StatusBar.isVisible) {
// do something
}
## 支援的平臺
* iOS
* Android 系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`物件提供了一些功能,自訂的 iOS 和 Android 狀態列。
## 安裝
cordova plugin add cordova-plugin-statusbar
## 首選項
#### config.xml
@@ -56,6 +61,16 @@
## 方法
這個外掛程式定義全域 `StatusBar` 物件。
雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -86,9 +101,9 @@
StatusBar.overlaysWebView(true);
## 描述
## 說明
在 iOS 7設置為 false使狀態列出現像 iOS 6。設置樣式和背景顏色,以適應使用其他函數。
在 iOS 7設置為 false使狀態列出現像 iOS 6。設置樣式和背景顏色適合使用其他函數。
## 支援的平臺
@@ -104,7 +119,7 @@
使用預設狀態列 (淺色背景深色文本)。
StatusBar.styleDefault()
StatusBar.styleDefault();
## 支援的平臺
@@ -112,10 +127,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
使用 lightContent 狀態列 光文本,為深色背景)。
使用 lightContent 狀態列 (深色背景光文本)。
StatusBar.styleLightContent();
@@ -125,10 +141,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
使用 blackTranslucent 狀態列 光文本,為深色背景)。
使用 blackTranslucent 狀態列 (深色背景光文本)。
StatusBar.styleBlackTranslucent();
@@ -138,10 +155,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
使用 blackOpaque 狀態列 光文本,為深色背景)。
使用 blackOpaque 狀態列 (深色背景光文本)。
StatusBar.styleBlackOpaque();
@@ -151,10 +169,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
在 iOS 7將 StatusBar.statusBarOverlaysWebView 設置為 false你可以設置狀態列的背景顏色由顏色名稱。
在 iOS 7將 StatusBar.statusBarOverlaysWebView 設置為 false你可以設置狀態列的背景色的顏色名稱。
StatusBar.backgroundColorByName("red");
@@ -169,6 +188,7 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -183,7 +203,7 @@
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
在 iOS 7將 StatusBar.statusBarOverlaysWebView 設置為 false可以設置狀態列的背景色由十六進位字串 #RRGGBB)。
在 iOS 7當將 StatusBar.statusBarOverlaysWebView 設置為 false可以設置狀態列的背景色由十六進位字串 #RRGGBB)。
WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
@@ -192,6 +212,7 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB其中 AA 是 Alpha 值
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB其中 AA 是 Alpha 值
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,10 +242,11 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB其中 AA 是 Alpha 值
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
讀取此屬性,以看看是否狀態列是可見的或不
讀取此屬性,以看狀態列是可見。
if (StatusBar.isVisible) {
// do something
@@ -235,4 +258,5 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB其中 AA 是 Alpha 值
* iOS
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1

View File

@@ -1,9 +1,9 @@
{
"name": "cordova-plugin-statusbar",
"version": "0.1.11-dev",
"version": "2.2.1",
"description": "Cordova StatusBar Plugin",
"cordova": {
"id": "org.apache.cordova.statusbar",
"id": "cordova-plugin-statusbar",
"platforms": [
"android",
"ios",
@@ -14,7 +14,7 @@
},
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar.git"
"url": "https://github.com/apache/cordova-plugin-statusbar"
},
"keywords": [
"cordova",
@@ -26,12 +26,23 @@
"cordova-wp8",
"cordova-windows"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
"scripts": {
"test": "npm run jshint",
"jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
},
"engines": {
"cordovaDependencies": {
"0.1.0": {
"cordova": ">=3.0.0"
},
"3.0.0": {
"cordova": ">100"
}
}
],
},
"author": "Apache Software Foundation",
"license": "Apache 2.0"
"license": "Apache-2.0",
"devDependencies": {
"jshint": "^2.6.0"
}
}

View File

@@ -21,8 +21,8 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.statusbar"
version="0.1.11-dev">
id="cordova-plugin-statusbar"
version="2.2.1">
<name>StatusBar</name>
<description>Cordova StatusBar Plugin</description>
<license>Apache 2.0</license>
@@ -47,6 +47,12 @@
</config-file>
</platform>
<platform name="browser">
<js-module src="src/browser/StatusBarProxy.js" name="StatusBarProxy">
<runs />
</js-module>
</platform>
<!-- ios -->
<platform name="ios">

View File

@@ -20,7 +20,9 @@
package org.apache.cordova.statusbar;
import android.app.Activity;
import android.util.Log;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -29,6 +31,7 @@ import org.apache.cordova.CordovaArgs;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.LOG;
import org.apache.cordova.PluginResult;
import org.json.JSONException;
@@ -44,7 +47,7 @@ public class StatusBar extends CordovaPlugin {
*/
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
Log.v(TAG, "StatusBar: initialization");
LOG.v(TAG, "StatusBar: initialization");
super.initialize(cordova, webView);
this.cordova.getActivity().runOnUiThread(new Runnable() {
@@ -54,6 +57,9 @@ public class StatusBar extends CordovaPlugin {
// by the Cordova.
Window window = cordova.getActivity().getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
// Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
}
});
}
@@ -67,19 +73,33 @@ public class StatusBar extends CordovaPlugin {
* @return True if the action was valid, false otherwise.
*/
@Override
public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
Log.v(TAG, "Executing action: " + action);
public boolean execute(final String action, final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
LOG.v(TAG, "Executing action: " + action);
final Activity activity = this.cordova.getActivity();
final Window window = activity.getWindow();
if ("_ready".equals(action)) {
boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0;
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible));
return true;
}
if ("show".equals(action)) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
// use KitKat here to be aligned with "Fullscreen" preference
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int uiOptions = window.getDecorView().getSystemUiVisibility();
uiOptions &= ~View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
uiOptions &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
window.getDecorView().setSystemUiVisibility(uiOptions);
}
// CB-11197 We still need to update LayoutParams to force status bar
// to be hidden when entering e.g. text fields
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
});
@@ -90,12 +110,58 @@ public class StatusBar extends CordovaPlugin {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
// use KitKat here to be aligned with "Fullscreen" preference
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int uiOptions = window.getDecorView().getSystemUiVisibility()
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN;
window.getDecorView().setSystemUiVisibility(uiOptions);
}
// CB-11197 We still need to update LayoutParams to force status bar
// to be hidden when entering e.g. text fields
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
});
return true;
}
if ("backgroundColorByHexString".equals(action)) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
try {
setStatusBarBackgroundColor(args.getString(0));
} catch (JSONException ignore) {
LOG.e(TAG, "Invalid hexString argument, use f.i. '#777777'");
}
}
});
return true;
}
return false;
}
private void setStatusBarBackgroundColor(final String colorPref) {
if (Build.VERSION.SDK_INT >= 21) {
if (colorPref != null && !colorPref.isEmpty()) {
final Window window = cordova.getActivity().getWindow();
// Method and constants not available on all SDKs but we want to be able to compile this code with any SDK
window.clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
try {
// Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21
window.getClass().getDeclaredMethod("setStatusBarColor", int.class).invoke(window, Color.parseColor(colorPref));
} catch (IllegalArgumentException ignore) {
LOG.e(TAG, "Invalid hexString argument, use f.i. '#999999'");
} catch (Exception ignore) {
// this should not happen, only in case Android removes this method in a version > 21
LOG.w(TAG, "Method window.setStatusBarColor not found for SDK level " + Build.VERSION.SDK_INT);
}
}
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* 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.
*
*/
function notSupported(win,fail) {
//
console.log('StatusBar is not supported');
setTimeout(function(){
win();
// note that while it is not explicitly supported, it does not fail
// this is really just here to allow developers to test their code in the browser
// and if we fail, then their app might as well. -jm
},0);
}
module.exports = {
isVisible: false,
styleBlackTranslucent:notSupported,
styleDefault:notSupported,
styleLightContent:notSupported,
styleBlackOpaque:notSupported,
overlaysWebView:notSupported,
styleLightContect: notSupported,
backgroundColorByName: notSupported,
backgroundColorByHexString: notSupported,
hide: notSupported,
show: notSupported,
_ready:notSupported
};
require("cordova/exec/proxy").add("StatusBar", module.exports);

View File

@@ -90,6 +90,20 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
}
}
-(void)cordovaViewWillAppear:(NSNotification*)notification
{
[self resizeWebView];
}
-(void)statusBarDidChangeFrame:(NSNotification*)notification
{
//add a small delay for iOS 7 ( 0.1 seconds )
__weak CDVStatusBar* weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[weakSelf resizeWebView];
});
}
- (void)pluginInitialize
{
BOOL isiOS7 = (IsAtLeastiOSVersion(@"7.0"));
@@ -101,6 +115,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
// observe the statusBarHidden property
[[UIApplication sharedApplication] addObserver:self forKeyPath:@"statusBarHidden" options:NSKeyValueObservingOptionNew context:NULL];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarDidChangeFrame:) name: UIApplicationDidChangeStatusBarFrameNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cordovaViewWillAppear:) name: @"CDVViewWillAppearNotification" object:nil];
_statusBarOverlaysWebView = YES; // default
[self initializeStatusBarBackgroundView];
@@ -109,11 +127,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
NSString* setting;
setting = @"StatusBarOverlaysWebView";
if ([self settingForKey:setting]) {
self.statusBarOverlaysWebView = [(NSNumber*)[self settingForKey:setting] boolValue];
}
setting = @"StatusBarBackgroundColor";
if ([self settingForKey:setting]) {
[self _backgroundColorByHexString:[self settingForKey:setting]];
@@ -158,17 +171,33 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
[self.commandDelegate sendPluginResult:result callbackId:_eventsCallbackId];
}
- (void) _ready:(CDVInvokedUrlCommand*)command
{
_eventsCallbackId = command.callbackId;
[self updateIsVisible:![UIApplication sharedApplication].statusBarHidden];
NSString* setting = @"StatusBarOverlaysWebView";
if ([self settingForKey:setting]) {
self.statusBarOverlaysWebView = [(NSNumber*)[self settingForKey:setting] boolValue];
if (self.statusBarOverlaysWebView) {
[self resizeWebView];
}
}
}
- (void) initializeStatusBarBackgroundView
{
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown &&
statusBarFrame.size.height + statusBarFrame.origin.y == [self.viewController.view.window bounds].size.height) {
// When started in upside-down orientation on iOS 7, status bar will be bound to lower edge of the
// screen (statusBarFrame.origin.y will be somewhere around screen height). In this case we need to
// correct frame's coordinates
statusBarFrame.origin.y = 0;
}
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
_statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
_statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
@@ -176,10 +205,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
_statusBarBackgroundView.autoresizesSubviews = YES;
}
- (CGRect) invertFrameIfNeeded:(CGRect)rect orientation:(UIInterfaceOrientation)orientation {
- (CGRect) invertFrameIfNeeded:(CGRect)rect {
// landscape is where (width > height). On iOS < 8, we need to invert since frames are
// always in Portrait context
if (UIDeviceOrientationIsLandscape(orientation) && (rect.size.width < rect.size.height) ) {
// always in Portrait context. Do not run this on ios 8 or above to avoid breaking ipad pro multitask layout
if (!IsAtLeastiOSVersion(@"8.0") && UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
CGFloat temp = rect.size.width;
rect.size.width = rect.size.height;
rect.size.height = temp;
@@ -195,34 +224,22 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (!IsAtLeastiOSVersion(@"7.0") || statusBarOverlaysWebView == _statusBarOverlaysWebView) {
return;
}
_statusBarOverlaysWebView = statusBarOverlaysWebView;
CGRect bounds = [[UIScreen mainScreen] bounds];
[self resizeWebView];
if (statusBarOverlaysWebView) {
[_statusBarBackgroundView removeFromSuperview];
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
self.webView.frame = CGRectMake(0, 0, bounds.size.height, bounds.size.width);
} else {
self.webView.frame = bounds;
}
} else {
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
[self initializeStatusBarBackgroundView];
CGRect frame = self.webView.frame;
frame.origin.y = statusBarFrame.size.height;
frame.size.height -= statusBarFrame.size.height;
self.webView.frame = frame;
[self.webView.superview addSubview:_statusBarBackgroundView];
}
_statusBarOverlaysWebView = statusBarOverlaysWebView;
}
- (BOOL) statusBarOverlaysWebView
@@ -291,12 +308,22 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command
{
[self setStyleForStatusBar:UIStatusBarStyleBlackTranslucent];
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000
# define TRANSLUCENT_STYLE UIStatusBarStyleBlackTranslucent
#else
# define TRANSLUCENT_STYLE UIStatusBarStyleLightContent
#endif
[self setStyleForStatusBar:TRANSLUCENT_STYLE];
}
- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command
{
[self setStyleForStatusBar:UIStatusBarStyleBlackOpaque];
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000
# define OPAQUE_STYLE UIStatusBarStyleBlackOpaque
#else
# define OPAQUE_STYLE UIStatusBarStyleLightContent
#endif
[self setStyleForStatusBar:OPAQUE_STYLE];
}
- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
@@ -356,29 +383,14 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (!app.isStatusBarHidden)
{
self.viewController.wantsFullScreenLayout = YES;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
[self hideStatusBar];
if (IsAtLeastiOSVersion(@"7.0")) {
[_statusBarBackgroundView removeFromSuperview];
}
if (!_statusBarOverlaysWebView) {
CGRect frame = self.webView.frame;
frame.origin.y = 0;
if (!self.statusBarOverlaysWebView) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
frame.size.height += statusBarFrame.size.width;
} else {
frame.size.height += statusBarFrame.size.height;
}
}
self.webView.frame = frame;
}
[self resizeWebView];
_statusBarBackgroundView.hidden = YES;
}
@@ -404,46 +416,84 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (app.isStatusBarHidden)
{
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
self.viewController.wantsFullScreenLayout = isIOS7;
[self showStatusBar];
[self resizeWebView];
if (isIOS7) {
CGRect frame = self.webView.frame;
self.viewController.view.frame = [[UIScreen mainScreen] bounds];
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
if (!self.statusBarOverlaysWebView) {
// there is a possibility that when the statusbar was hidden, it was in a different orientation
// from the current one. Therefore we need to expand the statusBarBackgroundView as well to the
// statusBar's current size
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect sbBgFrame = _statusBarBackgroundView.frame;
frame.origin.y = statusBarFrame.size.height;
frame.size.height -= statusBarFrame.size.height;
sbBgFrame.size = statusBarFrame.size;
_statusBarBackgroundView.frame = sbBgFrame;
[self.webView.superview addSubview:_statusBarBackgroundView];
}
self.webView.frame = frame;
} else {
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
self.viewController.view.frame = bounds;
}
_statusBarBackgroundView.hidden = NO;
}
}
-(void)resizeWebView
{
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
if (isIOS7) {
CGRect bounds = [self.viewController.view.window bounds];
bounds = [self invertFrameIfNeeded:bounds];
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
self.viewController.view.frame = bounds;
} else if (self.viewController.presentedViewController != nil) {
// https://issues.apache.org/jira/browse/CB-11018
BOOL isIOS8 = (IsAtLeastiOSVersion(@"8.0"));
BOOL isIOS9 = (IsAtLeastiOSVersion(@"9.0"));
if (isIOS8 && !isIOS9) {
// iOS 8
bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
} else {
// iOS7, iOS9+
if ([self.viewController.presentedViewController.presentationController isKindOfClass:[UIPopoverPresentationController class]] || UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
} else {
bounds = CGRectMake(0, 0, bounds.size.height, bounds.size.width);
}
}
}
self.webView.frame = bounds;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect frame = self.webView.frame;
CGFloat height = statusBarFrame.size.height;
if (!self.statusBarOverlaysWebView) {
// CB-10158 If a full screen video is playing the status bar height will be 0, set it to 20
frame.origin.y = height > 0 ? height: 20;
} else {
// Even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
frame.origin.y = height >= 20 ? height - 20 : 0;
}
frame.size.height -= frame.origin.y;
self.webView.frame = frame;
} else {
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
self.viewController.view.frame = bounds;
}
}
- (void) dealloc
{
[[UIApplication sharedApplication] removeObserver:self forKeyPath:@"statusBarHidden"];
[[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}

View File

@@ -1,5 +1,4 @@
/*
*
* 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
@@ -19,20 +18,24 @@
*
*/
var isSupported = true; // we assume
/* global Windows */
var _supported = null; // set to null so we can check first time
function isSupported() {
// if not checked before, run check
if (_supported === null) {
var viewMan = Windows.UI.ViewManagement;
_supported = (viewMan.StatusBar && viewMan.StatusBar.getForCurrentView);
}
return _supported;
}
function getViewStatusBar() {
if(isSupported) {
var ViewMan = Windows.UI.ViewManagement; // quick alias to save char
if( ViewMan.StatusBar &&
ViewMan.StatusBar.getForCurrentView ) {
return ViewMan.StatusBar.getForCurrentView();
}
else {
isSupported = false; // so we won't check again
}
if (!isSupported()) {
throw new Error("Status bar is not supported");
}
return null;
return Windows.UI.ViewManagement.StatusBar.getForCurrentView();
}
function hexToRgb(hex) {
@@ -52,49 +55,60 @@ function hexToRgb(hex) {
module.exports = {
_ready: function(win, fail) {
win(statusBar.occludedRect.height !== 0);
if(isSupported()) {
var statusBar = getViewStatusBar();
win(statusBar.occludedRect.height !== 0);
}
},
overlaysWebView: function () {
// not supported
},
styleDefault: function () {
// dark text ( to be used on a light background )
getViewStatusBar().foregroundColor = { a: 0, r: 0, g: 0, b: 0 };
if (isSupported()) {
getViewStatusBar().foregroundColor = { a: 0, r: 0, g: 0, b: 0 };
}
},
styleLightContent: function () {
// light text ( to be used on a dark background )
getViewStatusBar().foregroundColor = { a: 0, r: 255, g: 255, b: 255 };
if (isSupported()) {
getViewStatusBar().foregroundColor = { a: 0, r: 255, g: 255, b: 255 };
}
},
styleBlackTranslucent: function () {
// #88000000 ? Apple says to use lightContent instead
return this.styleLightContent();
return module.exports.styleLightContent();
},
styleBlackOpaque: function () {
// #FF000000 ? Apple says to use lightContent instead
return this.styleLightContent();
return module.exports.styleLightContent();
},
backgroundColorByHexString: function (win, fail, args) {
var rgb = hexToRgb(args[0]);
var statusBar = getViewStatusBar();
if(statusBar) {
if(isSupported()) {
var statusBar = getViewStatusBar();
statusBar.backgroundColor = { a: 0, r: rgb.r, g: rgb.g, b: rgb.b };
statusBar.backgroundOpacity = 1;
}
},
show: function (win, fail) {
getViewStatusBar().showAsync().done(win, fail);
// added support check so no error thrown, when calling this method
if (isSupported()) {
getViewStatusBar().showAsync().done(win, fail);
}
},
hide: function (win, fail) {
getViewStatusBar().hideAsync().done(win, fail);
// added support check so no error thrown, when calling this method
if (isSupported()) {
getViewStatusBar().hideAsync().done(win, fail);
}
}
};
require("cordova/exec/proxy").add("StatusBar", module.exports);
require("cordova/exec/proxy").add("StatusBar", module.exports);

View File

@@ -21,8 +21,8 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.statusbar.tests"
version="0.1.11-dev">
id="cordova-plugin-statusbar-tests"
version="2.2.1">
<name>Cordova StatusBar Plugin Tests</name>
<license>Apache 2.0</license>

View File

@@ -19,6 +19,50 @@
*
*/
/* jshint jasmine: true */
/* global StatusBar */
exports.defineAutoTests = function () {
describe("StatusBar", function () {
it("statusbar.spec.1 should exist", function() {
expect(window.StatusBar).toBeDefined();
});
it("statusbar.spec.2 should have show|hide methods", function() {
expect(window.StatusBar.show).toBeDefined();
expect(typeof window.StatusBar.show).toBe("function");
expect(window.StatusBar.hide).toBeDefined();
expect(typeof window.StatusBar.hide).toBe("function");
});
it("statusbar.spec.3 should have set backgroundColor methods", function() {
expect(window.StatusBar.backgroundColorByName).toBeDefined();
expect(typeof window.StatusBar.backgroundColorByName).toBe("function");
expect(window.StatusBar.backgroundColorByHexString).toBeDefined();
expect(typeof window.StatusBar.backgroundColorByHexString).toBe("function");
});
it("statusbar.spec.4 should have set style methods", function() {
expect(window.StatusBar.styleBlackTranslucent).toBeDefined();
expect(typeof window.StatusBar.styleBlackTranslucent).toBe("function");
expect(window.StatusBar.styleDefault).toBeDefined();
expect(typeof window.StatusBar.styleDefault).toBe("function");
expect(window.StatusBar.styleLightContent).toBeDefined();
expect(typeof window.StatusBar.styleLightContent).toBe("function");
expect(window.StatusBar.styleBlackOpaque).toBeDefined();
expect(typeof window.StatusBar.styleBlackOpaque).toBe("function");
expect(window.StatusBar.overlaysWebView).toBeDefined();
expect(typeof window.StatusBar.overlaysWebView).toBe("function");
});
});
};
exports.defineManualTests = function (contentEl, createActionButton) {
function log(msg) {
var el = document.getElementById("info");

View File

@@ -19,6 +19,8 @@
*
*/
/* global cordova */
var exec = require('cordova/exec');
var namedColors = {
@@ -95,15 +97,17 @@ var StatusBar = {
};
// prime it
exec(function (res) {
if (typeof res == 'object') {
if (res.type == 'tap') {
cordova.fireWindowEvent('statusTap');
// prime it. setTimeout so that proxy gets time to init
window.setTimeout(function () {
exec(function (res) {
if (typeof res == 'object') {
if (res.type == 'tap') {
cordova.fireWindowEvent('statusTap');
}
} else {
StatusBar.isVisible = res;
}
} else {
StatusBar.isVisible = res;
}
}, null, "StatusBar", "_ready", []);
}, null, "StatusBar", "_ready", []);
}, 0);
module.exports = StatusBar;