Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Remove experimental flag for shell and change a few apis (#6086) fixes
Browse files Browse the repository at this point in the history
…#2415

* api changes for shell official

* Update Xamarin.Forms.Core/Shell/Shell.cs

Co-Authored-By: PureWeen <shane94@hotmail.com>

* Update Xamarin.Forms.Core/Shell/ShellItemCollection.cs

Co-Authored-By: PureWeen <shane94@hotmail.com>

* Update Xamarin.Forms.Core/Shell/ShellSection.cs

Co-Authored-By: PureWeen <shane94@hotmail.com>

* Update Xamarin.Forms.Core/Shell/ShellItem.cs

Co-Authored-By: PureWeen <shane94@hotmail.com>

* fix compile errors

* fix ui test

* fix ui test

* removed some more properties

* remove a couple more
  • Loading branch information
PureWeen authored and rmarinho committed May 9, 2019
1 parent 5210d5c commit 03e9a9f
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public abstract class TestShell : Shell
protected virtual bool Isolate => true;
#endif

protected TestShell() : base(false)
protected TestShell() : base()
{
#if APP
Init();
Expand Down
20 changes: 10 additions & 10 deletions Xamarin.Forms.Controls/XamStore/StoreShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
x:Class="Xamarin.Forms.Controls.XamStore.StoreShell">
<Shell.Resources>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.ShellBackgroundColor" Value="#455A64" />
<Setter Property="Shell.ShellForegroundColor" Value="White" />
<Setter Property="Shell.ShellTitleColor" Value="White" />
<Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.BackgroundColor" Value="#455A64" />
<Setter Property="Shell.ForegroundColor" Value="White" />
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
</Style>
<Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
<Style x:Key="GreenShell" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Shell.ShellBackgroundColor" Value="#689F39" />
<Setter Property="Shell.BackgroundColor" Value="#689F39" />
</Style>
<Style x:Key="MusicShell" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Shell.ShellBackgroundColor" Value="#EF6C00" />
<Setter Property="Shell.BackgroundColor" Value="#EF6C00" />
</Style>
<Style x:Key="MoviesShell" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Shell.ShellBackgroundColor" Value="#ED3B3B" />
<Setter Property="Shell.BackgroundColor" Value="#ED3B3B" />
</Style>
<Style x:Key="BooksShell" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Shell.ShellBackgroundColor" Value="#039BE6" />
<Setter Property="Shell.BackgroundColor" Value="#039BE6" />
</Style>
<Style x:Key="NewsShell" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Shell.ShellBackgroundColor" Value="#546DFE" />
<Setter Property="Shell.BackgroundColor" Value="#546DFE" />
</Style>
</Shell.Resources>

Expand Down
12 changes: 6 additions & 6 deletions Xamarin.Forms.Controls/XamStore/Styles/Global.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:converters="clr-namespace:ConferenceVision.Converters"
Expand Down Expand Up @@ -60,11 +60,11 @@

<!-- Shell Styles -->
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.ShellBackgroundColor" Value="#11313F" />
<Setter Property="Shell.BackgroundColor" Value="#11313F" />
<Setter Property="Shell.FlyoutBackgroundColor" Value="#11313F" />
<Setter Property="Shell.ShellForegroundColor" Value="White" />
<Setter Property="Shell.ShellTitleColor" Value="White" />
<Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.ForegroundColor" Value="White" />
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
</Style>
</ResourceDictionary>
4 changes: 2 additions & 2 deletions Xamarin.Forms.Controls/XamStore/Views/StorePages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private Button MakeButton (string title, Action callback)
public BasePage(string title, Color tint)
{
Title = title;
Shell.SetShellForegroundColor(this, tint);
Shell.SetForegroundColor(this, tint);
var grid = new Grid()
{
Padding = 20,
Expand Down Expand Up @@ -223,7 +223,7 @@ public BasePage(string title, Color tint)
grid.Children.Add(MakeButton("Go Back with Text",
async () => {
var page = (Page)Activator.CreateInstance(GetType());
Shell.SetShellForegroundColor(page, Color.Pink);
Shell.SetForegroundColor(page, Color.Pink);
Shell.SetBackButtonBehavior(page, new BackButtonBehavior()
{
//IconOverride = "calculator.png",
Expand Down
2 changes: 0 additions & 2 deletions Xamarin.Forms.Core.UnitTests/FlowDirectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,6 @@ public void ShellPropagatesRightToLeftChangetoNewElements()
[SetUp]
public override void Setup()
{
Device.SetFlags(new List<string> { ExperimentalFlags.ShellExperimental });

base.Setup();
Device.PlatformServices = new MockPlatformServices();
}
Expand Down
1 change: 0 additions & 1 deletion Xamarin.Forms.Core.UnitTests/ShellTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class ShellTestBase : BaseTestFixture
[SetUp]
public override void Setup()
{
Device.SetFlags(new[] { Shell.ShellExperimental });
base.Setup();

}
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.Core.UnitTests/ShellTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void NavigationProxyWireUpTest()
NavigationProxy proxy = page.NavigationProxy.Inner as NavigationProxy;
Assert.IsNotNull(proxy);

NavigationProxy shellProxy = proxy.Inner as ShellSection.NavigationImpl;
var shellProxy = proxy.Inner;
Assert.IsNotNull(shellProxy);
}

Expand Down
1 change: 0 additions & 1 deletion Xamarin.Forms.Core.UnitTests/VisualTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class VisualTests : BaseTestFixture
[SetUp]
public override void Setup()
{
Device.SetFlags(new List<string> { ExperimentalFlags.ShellExperimental });
base.Setup();
var mockDeviceInfo = new TestDeviceInfo();
Device.Info = mockDeviceInfo;
Expand Down
1 change: 0 additions & 1 deletion Xamarin.Forms.Core/ExperimentalFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Xamarin.Forms
internal static class ExperimentalFlags
{
internal const string CollectionViewExperimental = "CollectionView_Experimental";
internal const string ShellExperimental = "Shell_Experimental";

[EditorBrowsable(EditorBrowsableState.Never)]
public static void VerifyFlagEnabled(
Expand Down
20 changes: 10 additions & 10 deletions Xamarin.Forms.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@

//shell
[assembly: StyleProperty("-xf-flyout-background", typeof(Shell), nameof(Shell.FlyoutBackgroundColorProperty))]
[assembly: StyleProperty("-xf-shell-background", typeof(Element), nameof(Shell.ShellBackgroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-disabled", typeof(Element), nameof(Shell.ShellDisabledColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-foreground", typeof(Element), nameof(Shell.ShellForegroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-background", typeof(Element), nameof(Shell.ShellTabBarBackgroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-disabled", typeof(Element), nameof(Shell.ShellTabBarDisabledColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-foreground", typeof(Element), nameof(Shell.ShellTabBarForegroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-title", typeof(Element), nameof(Shell.ShellTabBarTitleColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-unselected", typeof(Element), nameof(Shell.ShellTabBarUnselectedColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-title", typeof(Element), nameof(Shell.ShellTitleColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-unselected", typeof(Element), nameof(Shell.ShellUnselectedColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-background", typeof(Element), nameof(Shell.BackgroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-disabled", typeof(Element), nameof(Shell.DisabledColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-foreground", typeof(Element), nameof(Shell.ForegroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-background", typeof(Element), nameof(Shell.TabBarBackgroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-disabled", typeof(Element), nameof(Shell.TabBarDisabledColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-foreground", typeof(Element), nameof(Shell.TabBarForegroundColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-title", typeof(Element), nameof(Shell.TabBarTitleColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-tabbar-unselected", typeof(Element), nameof(Shell.TabBarUnselectedColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-title", typeof(Element), nameof(Shell.TitleColorProperty), PropertyOwnerType = typeof(Shell))]
[assembly: StyleProperty("-xf-shell-unselected", typeof(Element), nameof(Shell.UnselectedColorProperty), PropertyOwnerType = typeof(Shell))]

0 comments on commit 03e9a9f

Please sign in to comment.