Skip to content

Commit

Permalink
[Tizen] Remove TVNavigationDrawer TVNavigationView (dotnet#223)
Browse files Browse the repository at this point in the history
* [Tizen] Remove TVNavigationDrawer TVNavigationView

* [Elmsharp] Update Tizen.UIExtensions version
  • Loading branch information
shyunMin authored and rookiejava committed Dec 6, 2021
1 parent 7f23d41 commit 49cfea6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 308 deletions.
2 changes: 1 addition & 1 deletion .nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
Expand Up @@ -124,6 +124,6 @@
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('tizen')) == true OR '$(TargetFramework)' == 'net6.0-tizen'">
<PackageReference Include="Tizen.UIExtensions.ElmSharp" Version="0.5.0-pre1" />
<PackageReference Include="Tizen.UIExtensions.ElmSharp" Version="0.6.0-pre1" />
</ItemGroup>
</Project>
17 changes: 17 additions & 0 deletions src/Controls/src/Core/Platform/Tizen/Extensions/ShellExtensions.cs
@@ -0,0 +1,17 @@
using Tizen.UIExtensions.Common;

namespace Microsoft.Maui.Controls.Platform
{
public static class ShellExtensions
{
public static DrawerBehavior ToNative(this FlyoutBehavior behavior)
{
if (behavior == FlyoutBehavior.Disabled)
return DrawerBehavior.Disabled;
else if (behavior == FlyoutBehavior.Locked)
return DrawerBehavior.Locked;
else
return DrawerBehavior.Drawer;
}
}
}
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Platform/Tizen/Shell/ShellView.cs
Expand Up @@ -192,7 +192,7 @@ protected virtual void UpdateFlyoutBehavior()
{
_ = Element ?? throw new InvalidOperationException($"{nameof(Element)} should have been set by base class.");

_navigationDrawer.IsSplit = (Element.FlyoutBehavior == FlyoutBehavior.Locked) ? true : false;
_navigationDrawer.DrawerBehavior = Element.FlyoutBehavior.ToNative();
}

protected virtual void BuildMenu()
Expand Down
256 changes: 0 additions & 256 deletions src/Controls/src/Core/Platform/Tizen/Shell/TVNavigationDrawer.cs

This file was deleted.

27 changes: 0 additions & 27 deletions src/Controls/src/Core/Platform/Tizen/Shell/TVNavigationView.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/Controls/src/Core/Platform/Tizen/Shell/ThemeConstants.cs
Expand Up @@ -16,17 +16,13 @@ public class Resources
public const int DefaultIconSize = 30;
public const int DefaultIconPadding = 15;

public const double DefaultFlyoutRatio = 0.83;
public const int DefaultFlyoutItemHeight = 60;
public const int DefaultFlyoutItemWidth = 250;

public class TV
{
public const int DefaultMenuSize = 70;

public const double DefaultFlyoutRatio = 0.3;
public const double DefaultFlyoutRatioMin = 0.05;

public const int DefaultFlyoutIconColumnSize = 40;
public const int DefaultFlyoutIconSize = 25;

Expand All @@ -38,7 +34,6 @@ public class ColorClass
{
public class TV
{
public static readonly Graphics.Color DefaultBackgroundColor = Graphics.Colors.Black;
public static readonly Graphics.Color DefaultFlyoutItemColor = Graphics.Colors.Transparent;
public static readonly Graphics.Color DefaultFlyoutItemFocusedColor = new Graphics.Color(0.95f);
}
Expand Down
18 changes: 0 additions & 18 deletions src/Controls/src/Core/Platform/Tizen/Shell/ThemeManager.cs
Expand Up @@ -116,16 +116,6 @@ public static double GetTvFlyoutItemFontSize(this ITNavigtaionView nav)
return s_navigationViewFlyoutItemFontSize = DeviceInfo.CalculateDoubleScaledSizeInLargeScreen(ThemeConstants.Shell.Resources.TV.DefaultFlyoutItemfontSize);
}

public static double GetTvFlyoutRatioMin(this INavigationDrawer drawer)
{
return ThemeConstants.Shell.Resources.TV.DefaultFlyoutRatioMin;
}

public static Graphics.Color GetTvDefaultBackgroundColor(this ITNavigtaionView nav)
{
return ThemeConstants.Shell.ColorClass.TV.DefaultBackgroundColor;
}

public static Graphics.Color GetTvFlyoutItemColor(this ITNavigtaionView nav)
{
return ThemeConstants.Shell.ColorClass.TV.DefaultFlyoutItemColor;
Expand All @@ -136,13 +126,5 @@ public static Graphics.Color GetTvFlyoutItemFocusedColor(this ITNavigtaionView n
return ThemeConstants.Shell.ColorClass.TV.DefaultFlyoutItemFocusedColor;
}
#endregion

#region TVNavigationDrawer
static double s_navigationDrawerRatio = -1;
public static double GetTvFlyoutRatio(this INavigationDrawer drawer, int width, int height)
{
return s_navigationDrawerRatio = (width > height) ? ThemeConstants.Shell.Resources.TV.DefaultFlyoutRatio : ThemeConstants.Shell.Resources.DefaultFlyoutRatio;
}
#endregion
}
}

0 comments on commit 49cfea6

Please sign in to comment.