summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-11-16 20:14:00 (GMT)
committerGitHub <noreply@github.com>2016-11-16 20:14:00 (GMT)
commit20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee (patch)
tree92efe42b8cbc1a99eea00e6bf968b75922e98b01 /Xamarin.Forms.Core
parente5af21fdc32972d4355af86349d446a2bb6a5b02 (diff)
downloadxamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.zip
xamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.tar.gz
xamarin-forms-20adf7ec74c02f8522b12c14dbb1b5eec3a0dfee.tar.bz2
[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 4ca5976..1f4472d 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 0000000..55c8d44
--- /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 eae36a4..c283364 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" />