mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-01-19 01:12:49 +08:00
fix: remove deprecated platforms (#126)
* fix: remove deprecated platforms * docs: use simply Windows * fix: remove wp mentions from package.json * fix: remove BlackBerry namespace
This commit is contained in:
parent
13645b9f53
commit
217f792101
38
README.md
38
README.md
@ -168,9 +168,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 6+
|
- Android 6+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.styleLightContent
|
StatusBar.styleLightContent
|
||||||
=================
|
=================
|
||||||
@ -185,9 +183,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 6+
|
- Android 6+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.styleBlackTranslucent
|
StatusBar.styleBlackTranslucent
|
||||||
=================
|
=================
|
||||||
@ -202,9 +198,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 6+
|
- Android 6+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.styleBlackOpaque
|
StatusBar.styleBlackOpaque
|
||||||
=================
|
=================
|
||||||
@ -219,9 +213,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 6+
|
- Android 6+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
|
|
||||||
StatusBar.backgroundColorByName
|
StatusBar.backgroundColorByName
|
||||||
@ -241,9 +233,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 5+
|
- Android 5+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.backgroundColorByHexString
|
StatusBar.backgroundColorByHexString
|
||||||
=================
|
=================
|
||||||
@ -266,9 +256,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android 5+
|
- Android 5+
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.hide
|
StatusBar.hide
|
||||||
=================
|
=================
|
||||||
@ -283,9 +271,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android
|
- Android
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
StatusBar.show
|
StatusBar.show
|
||||||
=================
|
=================
|
||||||
@ -300,10 +286,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android
|
- Android
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
|
|
||||||
StatusBar.isVisible
|
StatusBar.isVisible
|
||||||
=================
|
=================
|
||||||
@ -320,10 +303,7 @@ Supported Platforms
|
|||||||
|
|
||||||
- iOS
|
- iOS
|
||||||
- Android
|
- Android
|
||||||
- Windows Phone 7
|
- Windows
|
||||||
- Windows Phone 8
|
|
||||||
- Windows Phone 8.1
|
|
||||||
|
|
||||||
|
|
||||||
statusTap
|
statusTap
|
||||||
=========
|
=========
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
"platforms": [
|
"platforms": [
|
||||||
"android",
|
"android",
|
||||||
"ios",
|
"ios",
|
||||||
"wp7",
|
|
||||||
"wp8",
|
|
||||||
"windows"
|
"windows"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -26,8 +24,6 @@
|
|||||||
"ecosystem:cordova",
|
"ecosystem:cordova",
|
||||||
"cordova-android",
|
"cordova-android",
|
||||||
"cordova-ios",
|
"cordova-ios",
|
||||||
"cordova-wp7",
|
|
||||||
"cordova-wp8",
|
|
||||||
"cordova-windows"
|
"cordova-windows"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
25
plugin.xml
25
plugin.xml
@ -19,7 +19,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<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"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="cordova-plugin-statusbar"
|
id="cordova-plugin-statusbar"
|
||||||
version="2.4.4-dev">
|
version="2.4.4-dev">
|
||||||
@ -53,9 +52,7 @@
|
|||||||
</js-module>
|
</js-module>
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
<!-- ios -->
|
|
||||||
<platform name="ios">
|
<platform name="ios">
|
||||||
|
|
||||||
<config-file target="config.xml" parent="/*">
|
<config-file target="config.xml" parent="/*">
|
||||||
<feature name="StatusBar">
|
<feature name="StatusBar">
|
||||||
<param name="ios-package" value="CDVStatusBar" />
|
<param name="ios-package" value="CDVStatusBar" />
|
||||||
@ -67,30 +64,8 @@
|
|||||||
|
|
||||||
<header-file src="src/ios/CDVStatusBar.h" />
|
<header-file src="src/ios/CDVStatusBar.h" />
|
||||||
<source-file src="src/ios/CDVStatusBar.m" />
|
<source-file src="src/ios/CDVStatusBar.m" />
|
||||||
|
|
||||||
</platform>
|
</platform>
|
||||||
|
|
||||||
<!-- wp7 -->
|
|
||||||
<platform name="wp7">
|
|
||||||
<config-file target="config.xml" parent="/*">
|
|
||||||
<feature name="StatusBar">
|
|
||||||
<param name="wp-package" value="StatusBar"/>
|
|
||||||
</feature>
|
|
||||||
</config-file>
|
|
||||||
<source-file src="src/wp/StatusBar.cs" />
|
|
||||||
</platform>
|
|
||||||
|
|
||||||
<!-- wp8 -->
|
|
||||||
<platform name="wp8">
|
|
||||||
<config-file target="config.xml" parent="/*">
|
|
||||||
<feature name="StatusBar">
|
|
||||||
<param name="wp-package" value="StatusBar"/>
|
|
||||||
</feature>
|
|
||||||
</config-file>
|
|
||||||
<source-file src="src/wp/StatusBar.cs" />
|
|
||||||
</platform>
|
|
||||||
|
|
||||||
<!-- windows -->
|
|
||||||
<platform name="windows">
|
<platform name="windows">
|
||||||
<js-module src="src/windows/StatusBarProxy.js" name="StatusBarProxy">
|
<js-module src="src/windows/StatusBarProxy.js" name="StatusBarProxy">
|
||||||
<runs />
|
<runs />
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
/*
|
|
||||||
Licensed 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* http://www.idev101.com/code/User_Interface/StatusBar.html
|
|
||||||
* https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html
|
|
||||||
* https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/c/econst/UIStatusBarStyleDefault
|
|
||||||
* */
|
|
||||||
|
|
||||||
|
|
||||||
namespace WPCordovaClassLib.Cordova.Commands
|
|
||||||
{
|
|
||||||
public class StatusBar : BaseCommand
|
|
||||||
{
|
|
||||||
|
|
||||||
// returns an argb value, if the hex is only rgb, it will be full opacity
|
|
||||||
protected Color ColorFromHex(string hexString)
|
|
||||||
{
|
|
||||||
string cleanHex = hexString.Replace("#", "").Replace("0x", "");
|
|
||||||
// turn #FFF into #FFFFFF
|
|
||||||
if (cleanHex.Length == 3)
|
|
||||||
{
|
|
||||||
cleanHex = "" + cleanHex[0] + cleanHex[0] + cleanHex[1] + cleanHex[1] + cleanHex[2] + cleanHex[2];
|
|
||||||
}
|
|
||||||
// add an alpha 100% if it is missing
|
|
||||||
if (cleanHex.Length == 6)
|
|
||||||
{
|
|
||||||
cleanHex = "FF" + cleanHex;
|
|
||||||
}
|
|
||||||
int argb = Int32.Parse(cleanHex, NumberStyles.HexNumber);
|
|
||||||
Color clr = Color.FromArgb((byte)((argb & 0xff000000) >> 0x18),
|
|
||||||
(byte)((argb & 0xff0000) >> 0x10),
|
|
||||||
(byte)((argb & 0xff00) >> 8),
|
|
||||||
(byte)(argb & 0xff));
|
|
||||||
return clr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void _ready(string options)
|
|
||||||
{
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
bool isVis = SystemTray.IsVisible;
|
|
||||||
// TODO: pass this to JS
|
|
||||||
//Debug.WriteLine("Result::" + res);
|
|
||||||
DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isVis));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void overlaysWebView(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
|
|
||||||
// string arg = JSON.JsonHelper.Deserialize<string[]>(options)[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void styleDefault(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "styleDefault", []);
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
SystemTray.ForegroundColor = Colors.Black;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void styleLightContent(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "styleLightContent", []);
|
|
||||||
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
SystemTray.ForegroundColor = Colors.White;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void styleBlackTranslucent(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "styleBlackTranslucent", []);
|
|
||||||
styleLightContent(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void styleBlackOpaque(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "styleBlackOpaque", []);
|
|
||||||
styleLightContent(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void backgroundColorByName(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "backgroundColorByName", [colorname]);
|
|
||||||
// this should NOT be called, js should now be using/converting color names to hex
|
|
||||||
}
|
|
||||||
|
|
||||||
public void backgroundColorByHexString(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
|
|
||||||
string argb = JSON.JsonHelper.Deserialize<string[]>(options)[0];
|
|
||||||
|
|
||||||
Color clr = ColorFromHex(argb);
|
|
||||||
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
SystemTray.Opacity = clr.A / 255.0d;
|
|
||||||
SystemTray.BackgroundColor = clr;
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hide(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "hide", []);
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
SystemTray.IsVisible = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void show(string options)
|
|
||||||
{ //exec(null, null, "StatusBar", "show", []);
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
SystemTray.IsVisible = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user