From f3244326cb1f265b9ea6648602ebca2e4c09c47e Mon Sep 17 00:00:00 2001 From: Jay Cho Date: Tue, 1 Nov 2022 15:14:04 +0900 Subject: [PATCH] [Tizen] Add Shell FlyoutBackDrop --- .../Core/Handlers/Shell/Tizen/ShellView.cs | 22 ++++++++++++++++--- .../net-tizen/PublicAPI.Unshipped.txt | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs b/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs index 5b8092385ab8..de36772d2e04 100644 --- a/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs +++ b/src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs @@ -1,7 +1,6 @@ #nullable enable using System; -using System.Collections.Generic; using Microsoft.Maui.Controls.Handlers; using Microsoft.Maui.Controls.Handlers.Items; using Microsoft.Maui.Graphics; @@ -34,6 +33,8 @@ public class ShellView : ViewGroup, IAppearanceObserver, IFlyoutBehaviorObserver ShellItemHandler? _currentItemHandler; + WrapperView? _backdropView; + bool _isOpen; protected Shell? Element { get; set; } @@ -44,7 +45,9 @@ public class ShellView : ViewGroup, IAppearanceObserver, IFlyoutBehaviorObserver protected bool HeaderOnMenu => _headerBehavior == FlyoutHeaderBehavior.Scroll || _headerBehavior == FlyoutHeaderBehavior.CollapseOnScroll; - protected NColor DefaultBackgroundCorlor = NColor.White; + public readonly NColor DefaultBackgroundColor = NColor.White; + + public readonly NColor DefaultBackdropColor = new NColor(0.1f, 0.1f, 0.1f, 0.5f); public event EventHandler? Toggled; @@ -123,7 +126,7 @@ public void UpdateFlyout(IView? flyout) public void UpdateBackgroundColor(GColor? color) { - _navigationView.BackgroundColor = color?.ToNUIColor() ?? DefaultBackgroundCorlor; + _navigationView.BackgroundColor = color?.ToNUIColor() ?? DefaultBackgroundColor; } public void UpdateCurrentItem(ShellItem newItem, bool animate = true) @@ -200,6 +203,19 @@ public void UpdateItems() public void UpdateFlyoutBackDrop(Brush backdrop) { + if (_backdropView == null) + { + _backdropView = new WrapperView() + { + WidthSpecification = LayoutParamPolicies.MatchParent, + HeightSpecification = LayoutParamPolicies.MatchParent, + BackgroundColor = DefaultBackdropColor + }; + _navigationDrawer.Backdrop = _backdropView; + } + + if (!backdrop.IsEmpty) + _backdropView.UpdateBackground(backdrop); } public void SetToolbar(MauiToolbar toolbar) diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 7d1f9df1f9b6..6af294c9c83c 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -1718,7 +1718,6 @@ Microsoft.Maui.Controls.Platform.ShellSectionView.MauiContext.set -> void Microsoft.Maui.Controls.Platform.ShellSectionView.ShellSection.get -> Microsoft.Maui.Controls.ShellSection! Microsoft.Maui.Controls.Platform.ShellSectionView.ShellSectionView(Microsoft.Maui.Controls.ShellSection! section, Microsoft.Maui.IMauiContext! context) -> void Microsoft.Maui.Controls.Platform.ShellView -Microsoft.Maui.Controls.Platform.ShellView.DefaultBackgroundCorlor -> Tizen.NUI.Color! Microsoft.Maui.Controls.Platform.ShellView.Element.get -> Microsoft.Maui.Controls.Shell? Microsoft.Maui.Controls.Platform.ShellView.Element.set -> void Microsoft.Maui.Controls.Platform.ShellView.HeaderOnMenu.get -> bool @@ -3235,6 +3234,8 @@ override sealed Microsoft.Maui.Controls.PlatformBehavior.O override sealed Microsoft.Maui.Controls.PlatformBehavior.OnAttachedTo(TView! bindable) -> void override sealed Microsoft.Maui.Controls.PlatformBehavior.OnDetachingFrom(Microsoft.Maui.Controls.BindableObject! bindable) -> void override sealed Microsoft.Maui.Controls.PlatformBehavior.OnDetachingFrom(TView! bindable) -> void +readonly Microsoft.Maui.Controls.Platform.ShellView.DefaultBackdropColor -> Tizen.NUI.Color! +readonly Microsoft.Maui.Controls.Platform.ShellView.DefaultBackgroundColor -> Tizen.NUI.Color! static Microsoft.Maui.Controls.AbsoluteLayout.AutoSize -> double static Microsoft.Maui.Controls.Application.AccentColor.get -> Microsoft.Maui.Graphics.Color? static Microsoft.Maui.Controls.Application.AccentColor.set -> void