summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-11-16 12:14:00 -0800
committerGitHub <noreply@github.com>2016-11-16 12:14:00 -0800
commit20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee (patch)
tree92efe42b8cbc1a99eea00e6bf968b75922e98b01 /Xamarin.Forms.Core
parente5af21fdc32972d4355af86349d446a2bb6a5b02 (diff)
downloadxamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.tar.gz
xamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.tar.bz2
xamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.zip
[iOS] Add Platform Specific option to not adjust the status bar text color based on the luminosity of the NavigationBar text color (#517)
* Add reproduction for 37431 * [Core] Add iOS PS StatusBarTextColorMode * [iOS] Implement StatusBarTextColorMode on NavPage * Add reproduction for 44777 * Add instructions to 44777 repro * Update docs
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs32
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarTextColorMode.cs8
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj1
3 files changed, 40 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
index 4ca5976a..1f4472db 100644
--- a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
@@ -5,6 +5,7 @@ namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
public static class NavigationPage
{
+ #region Translucent
public static readonly BindableProperty IsNavigationBarTranslucentProperty =
BindableProperty.Create("IsNavigationBarTranslucent", typeof(bool),
typeof(NavigationPage), false);
@@ -36,10 +37,39 @@ namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
return config;
}
- public static IPlatformElementConfiguration<iOS, FormsElement>DisableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ public static IPlatformElementConfiguration<iOS, FormsElement> DisableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
SetIsNavigationBarTranslucent(config.Element, false);
return config;
}
+ #endregion
+
+
+ #region StatusBarTextColorMode
+ public static readonly BindableProperty StatusBarTextColorModeProperty =
+ BindableProperty.Create("StatusBarColorTextMode", typeof(StatusBarTextColorMode),
+ typeof(NavigationPage), StatusBarTextColorMode.MatchNavigationBarTextLuminosity);
+
+ public static StatusBarTextColorMode GetStatusBarTextColorMode(BindableObject element)
+ {
+ return (StatusBarTextColorMode)element.GetValue(StatusBarTextColorModeProperty);
+ }
+
+ public static void SetStatusBarTextColorMode(BindableObject element, StatusBarTextColorMode value)
+ {
+ element.SetValue(StatusBarTextColorModeProperty, value);
+ }
+
+ public static StatusBarTextColorMode GetStatusBarTextColorMode(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetStatusBarTextColorMode(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetStatusBarTextColorMode(this IPlatformElementConfiguration<iOS, FormsElement> config, StatusBarTextColorMode value)
+ {
+ SetStatusBarTextColorMode(config.Element, value);
+ return config;
+ }
+ #endregion
}
}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarTextColorMode.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarTextColorMode.cs
new file mode 100644
index 00000000..55c8d444
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/StatusBarTextColorMode.cs
@@ -0,0 +1,8 @@
+namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ public enum StatusBarTextColorMode
+ {
+ MatchNavigationBarTextLuminosity,
+ DoNotAdjust
+ }
+}
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index eae36a41..c2833641 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -94,6 +94,7 @@
<Compile Include="PlatformConfiguration\iOSSpecific\BlurEffectStyle.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\Entry.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\NavigationPage.cs" />
+ <Compile Include="PlatformConfiguration\iOSSpecific\StatusBarTextColorMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\Page.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\StatusBarHiddenMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\UIStatusBarAnimation.cs" />