summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-08-30 10:46:14 -0700
committerJason Smith <jason.smith@xamarin.com>2016-08-30 10:46:14 -0700
commit5e553f6195e66e48688b8ab324f1bab1e9251f0a (patch)
treef8843e5e9e8afe89a05a1cc91c3b7fa05588bac7 /Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific
parentf551654b1cfe654c579ca50978445e7cb93f287d (diff)
downloadxamarin-forms-5e553f6195e66e48688b8ab324f1bab1e9251f0a.tar.gz
xamarin-forms-5e553f6195e66e48688b8ab324f1bab1e9251f0a.tar.bz2
xamarin-forms-5e553f6195e66e48688b8ab324f1bab1e9251f0a.zip
Platform Specifics (#301)
* Playing around with how the platform specifics interfaces etc. might work * Sample implementation of iOS navigation translucency * Very slightly reduced code * Better vendor stuff * Drop single-implemenation interfaces * Generics on NavigationPage * On-demand vendor stuff * Remove functionally duplicate classes and make ControlGallery work again * Namespace all the things. XAML test. * Can use Effect to attach platform specific * Attach Effect on PropertyChanging for XAML support! * Rename IConfigPlatform interfaces for readability * Some renaming to match the documents * Split class files * Clear out test-only code * Re-namespace * Added On method to rendered Elements * Allow for removal of platform suffix, convenience methods on specific platforms * Creating a gallery page for specifics * Add rudimentary Platform Specifics gallery; make CollapseStyle work on UWP; Add CollapsedPaneWidth specific property * Toolbar now working with both collapse styles * MDP now displaying Content title; toolbar routing around title * Add a gallery for the iOS NavigationPage stuff * Add Navigation Page as detail page to verify it works with new Toolbar options * Make titlebar/toolbar background colors consistent * ToolbarPlacement now working on NavigationPage * Toolbar Placement working for tabbed and nav pages * Fix bug where phone doesn't get default toolbar placement on start * [Core] Add PS WindowSoftInputModeAdjust [Core] Make Application extendable * Toolbar placement now working on Nav, Tabbed, and Master pages on desktop/phone Remove unnecessary style indirection Fix build errors * [A] Add PlatformConfigurationExtensions * SetSoftInputMode test page * [A] SetSoftInputMode Known issue: Status bar color does not work in AdjustResize mode * [Core] Add PS Blur * [iOS] Configure renderer for blur * Add test page * Move to blur VisualElement for broader support * Move test pages to gallery * Update docs * Use lazy initializer for PlatformConfigurationRegistry
Diffstat (limited to 'Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/BlurEffectStyle.cs20
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs45
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/VisualElement.cs33
3 files changed, 98 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/BlurEffectStyle.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/BlurEffectStyle.cs
new file mode 100644
index 00000000..d6c46e26
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/BlurEffectStyle.cs
@@ -0,0 +1,20 @@
+namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+
+ public enum BlurEffectStyle
+ {
+ None,
+ /// <summary>
+ /// Available in iOS 8.0 and later.
+ /// </summary>
+ ExtraLight,
+ /// <summary>
+ /// Available in iOS 8.0 and later.
+ /// </summary>
+ Light,
+ /// <summary>
+ /// Available in iOS 8.0 and later.
+ /// </summary>
+ Dark
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
new file mode 100644
index 00000000..4ca5976a
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/NavigationPage.cs
@@ -0,0 +1,45 @@
+
+namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ using FormsElement = Forms.NavigationPage;
+
+ public static class NavigationPage
+ {
+ public static readonly BindableProperty IsNavigationBarTranslucentProperty =
+ BindableProperty.Create("IsNavigationBarTranslucent", typeof(bool),
+ typeof(NavigationPage), false);
+
+ public static bool GetIsNavigationBarTranslucent(BindableObject element)
+ {
+ return (bool)element.GetValue(IsNavigationBarTranslucentProperty);
+ }
+
+ public static void SetIsNavigationBarTranslucent(BindableObject element, bool value)
+ {
+ element.SetValue(IsNavigationBarTranslucentProperty, value);
+ }
+
+ public static bool IsNavigationBarTranslucent(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetIsNavigationBarTranslucent(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetIsNavigationBarTranslucent(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
+ {
+ SetIsNavigationBarTranslucent(config.Element, value);
+ return config;
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> EnableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ SetIsNavigationBarTranslucent(config.Element, true);
+ return config;
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement>DisableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ SetIsNavigationBarTranslucent(config.Element, false);
+ return config;
+ }
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/VisualElement.cs b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/VisualElement.cs
new file mode 100644
index 00000000..1b3760e9
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/iOSSpecific/VisualElement.cs
@@ -0,0 +1,33 @@
+
+namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ using FormsElement = Forms.VisualElement;
+
+ public static class VisualElement
+ {
+ public static readonly BindableProperty BlurEffectProperty =
+ BindableProperty.Create("BlurEffect", typeof(BlurEffectStyle),
+ typeof(VisualElement), BlurEffectStyle.None);
+
+ public static BlurEffectStyle GetBlurEffect(BindableObject element)
+ {
+ return (BlurEffectStyle)element.GetValue(BlurEffectProperty);
+ }
+
+ public static void SetBlurEffect(BindableObject element, BlurEffectStyle value)
+ {
+ element.SetValue(BlurEffectProperty, value);
+ }
+
+ public static BlurEffectStyle GetBlurEffect(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetBlurEffect(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> UseBlurEffect(this IPlatformElementConfiguration<iOS, FormsElement> config, BlurEffectStyle value)
+ {
+ SetBlurEffect(config.Element, value);
+ return config;
+ }
+ }
+}