Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tizen] Add Shell FlyoutBackDrop #11647

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -34,6 +33,8 @@ public class ShellView : ViewGroup, IAppearanceObserver, IFlyoutBehaviorObserver

ShellItemHandler? _currentItemHandler;

WrapperView? _backdropView;

bool _isOpen;

protected Shell? Element { get; set; }
Expand All @@ -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;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3235,6 +3234,8 @@ override sealed Microsoft.Maui.Controls.PlatformBehavior<TView, TPlatformView>.O
override sealed Microsoft.Maui.Controls.PlatformBehavior<TView, TPlatformView>.OnAttachedTo(TView! bindable) -> void
override sealed Microsoft.Maui.Controls.PlatformBehavior<TView, TPlatformView>.OnDetachingFrom(Microsoft.Maui.Controls.BindableObject! bindable) -> void
override sealed Microsoft.Maui.Controls.PlatformBehavior<TView, TPlatformView>.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
Expand Down