From 5e553f6195e66e48688b8ab324f1bab1e9251f0a Mon Sep 17 00:00:00 2001 From: Samantha Houts Date: Tue, 30 Aug 2016 10:46:14 -0700 Subject: 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 --- .../PlatformSpecifics.xaml | 20 ++++++++++++ .../PlatformSpecifics.xaml.cs | 36 ++++++++++++++++++++++ .../Xamarin.Forms.Xaml.UnitTests.csproj | 8 +++++ 3 files changed, 64 insertions(+) create mode 100644 Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml create mode 100644 Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml.cs (limited to 'Xamarin.Forms.Xaml.UnitTests') diff --git a/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml b/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml new file mode 100644 index 00000000..b6bd7e01 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml.cs new file mode 100644 index 00000000..bcd98942 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/PlatformSpecifics.xaml.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; + +using Xamarin.Forms; +using NUnit.Framework; +using Xamarin.Forms.PlatformConfiguration; +using Xamarin.Forms.PlatformConfiguration.WindowsSpecific; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class PlatformSpecific : MasterDetailPage + { + public PlatformSpecific() + { + InitializeComponent(); + } + + public PlatformSpecific(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Tests + { + [TestCase(true)] + [TestCase(false)] + public void PlatformSpecificPropertyIsSet(bool useCompiledXaml) + { + var layout = new PlatformSpecific(useCompiledXaml); + Assert.AreEqual(layout.On().GetCollapseStyle(), CollapseStyle.Partial); + Assert.AreEqual(layout.On().CollapsedPaneWidth(), 96d); + } + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj index 4f67feb1..86e2eeb0 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj +++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj @@ -85,6 +85,9 @@ Bz41296.xaml + + PlatformSpecifics.xaml + @@ -655,4 +658,9 @@ MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + + \ No newline at end of file -- cgit v1.2.3