From fa8aa9869db0a283d8121fda3a82a24a70c4a723 Mon Sep 17 00:00:00 2001 From: Jesse MacFadyen Date: Tue, 11 Mar 2014 15:24:18 -0700 Subject: [PATCH] lightContent always sets BG to black, default always sets BG to white --- src/wp/StatusBar.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/wp/StatusBar.cs b/src/wp/StatusBar.cs index c6e6fe7..c20f680 100644 --- a/src/wp/StatusBar.cs +++ b/src/wp/StatusBar.cs @@ -65,6 +65,8 @@ namespace WPCordovaClassLib.Cordova.Commands { bool isVis = SystemTray.IsVisible; // TODO: pass this to JS + //Debug.WriteLine("Result::" + res); + DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isVis)); }); } @@ -77,19 +79,21 @@ namespace WPCordovaClassLib.Cordova.Commands { //exec(null, null, "StatusBar", "styleDefault", []); Deployment.Current.Dispatcher.BeginInvoke(() => { + SystemTray.BackgroundColor = Colors.White; + SystemTray.ForegroundColor = Colors.Black; SystemTray.Opacity = 1.0d; - SystemTray.ForegroundColor = (Color)Application.Current.Resources["PhoneForegroundColor"]; - SystemTray.BackgroundColor = (Color)Application.Current.Resources["PhoneChromeColor"]; + }); } public void styleLightContent(string options) { //exec(null, null, "StatusBar", "styleLightContent", []); + Deployment.Current.Dispatcher.BeginInvoke(() => { + SystemTray.BackgroundColor = Colors.Black; + SystemTray.ForegroundColor = Colors.White; SystemTray.Opacity = 1.0d; - SystemTray.ForegroundColor = SystemColors.ControlLightColor; - SystemTray.BackgroundColor = SystemColors.ControlDarkColor; }); } @@ -105,7 +109,7 @@ namespace WPCordovaClassLib.Cordova.Commands 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)