Skip to content

Commit

Permalink
Merge branch 'main' into net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Aug 31, 2022
2 parents 84592fc + 5912a10 commit 68c20e5
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.22422.1",
"version": "1.0.0-prerelease.22429.1",
"commands": [
"xharness"
]
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@
<Uri>https://github.com/dotnet/Microsoft.Maui.Graphics</Uri>
<Sha>691c654ff69df33f16f43b390ad6ef9b4ec03e6e</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22422.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22429.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>fbeb09787a4cdcf8a375382cf7a4f5edfaf1b9d7</Sha>
<Sha>a340408609224b6875881005ad1418416b54cf4e</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22422.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22429.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>fbeb09787a4cdcf8a375382cf7a4f5edfaf1b9d7</Sha>
<Sha>a340408609224b6875881005ad1418416b54cf4e</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22422.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22429.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>fbeb09787a4cdcf8a375382cf7a4f5edfaf1b9d7</Sha>
<Sha>a340408609224b6875881005ad1418416b54cf4e</Sha>
</Dependency>
</ProductDependencies>
</Dependencies>
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
<_HarfBuzzSharpVersion>2.8.2.1</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.a26ea4ca482ae8a2f0a530874264328885cce2c4.475</_SkiaSharpNativeAssetsVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-preview.5.22226.1</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22422.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22422.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22422.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22429.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22429.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22429.1</MicrosoftDotNetXHarnessCLIVersion>
<TizenUIExtensionsVersion>0.9.0</TizenUIExtensionsVersion>
<SvgSkiaPackageVersion>0.5.13</SvgSkiaPackageVersion>
<FizzlerPackageVersion>1.2.0</FizzlerPackageVersion>
Expand Down
14 changes: 6 additions & 8 deletions src/Controls/src/Core/Handlers/Shell/Tizen/ShellView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ protected virtual ItemTemplateAdaptor CreateItemAdaptor()
return new ShellItemTemplateAdaptor(Element!, Element!.Items);
}

void OnIconPressed(object? sender, EventArgs e)
{
if (!Element!.Toolbar.BackButtonVisible && ((Element!.Toolbar.IsVisible)))
IsOpened = true;
}

void UpdetDrawerToggleVisible()
{
Element!.Toolbar.DrawerToggleVisible = ((Element!.Toolbar.DrawerToggleVisible) && (Element.FlyoutBehavior == FlyoutBehavior.Flyout));
Expand Down Expand Up @@ -249,14 +255,6 @@ bool IsItemChanged(List<List<Element>> groups)
return false;
}

void OnIconPressed(object? sender, EventArgs e)
{
if (Element!.Toolbar.BackButtonVisible)
MauiContext?.GetPlatformWindow().GetWindow()?.BackButtonClicked();
else
IsOpened = true;
}

void OnTabItemSelected(object? sender, CollectionViewSelectionChangedEventArgs e)
{
if (e.SelectedItems == null || e.SelectedItems.Count == 0 || e.SelectedItems[0] is not ShellItem selectedItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="JetBrains.DotMemoryUnit" Version="3.1.20200127.214830" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
Expand Down
17 changes: 5 additions & 12 deletions src/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public partial class FlyoutViewHandler : ViewHandler<IFlyoutView, DrawerView>
{
protected override DrawerView CreatePlatformView()
{
return DeviceInfo.IsTV ? new TVNavigationDrawer() : new NavigationDrawer();
return DeviceInfo.IsTV ? new MauiTVFlyoutView() : new MauiFlyoutView();
}

protected override void ConnectHandler(DrawerView platformView)
Expand Down Expand Up @@ -61,25 +61,18 @@ public static void MapToolbar(IFlyoutViewHandler handler, IFlyoutView flyoutView
{
_ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

ViewHandler.MapToolbar(handler, flyoutView);

if (handler.VirtualView is not IToolbarElement toolbarElement)
return;

if (toolbarElement.Toolbar?.ToPlatform(handler.MauiContext) is MauiToolbar platformToolbar)
{
var toolbarContainer = handler.PlatformView.Content is IToolbarContainer container ?
container : handler.MauiContext.GetToolbarContainer();

platformToolbar.IconPressed += (s, e) =>
{
if (!toolbarElement.Toolbar.BackButtonVisible)
{
if (handler.PlatformView.IsOpened)
_ = handler.PlatformView.CloseAsync(true);
else
_ = handler.PlatformView.OpenAsync(true);
}
if (!toolbarElement.Toolbar.BackButtonVisible && (toolbarElement.Toolbar.IsVisible))
_ = handler.PlatformView.OpenAsync(true);
};
toolbarContainer?.SetToolbar(platformToolbar);
}
}

Expand Down
33 changes: 30 additions & 3 deletions src/Core/src/Handlers/Toolbar/ToolbarHandler.Tizen.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
namespace Microsoft.Maui.Handlers
using System;
using System.Threading.Tasks;

namespace Microsoft.Maui.Handlers
{
public partial class ToolbarHandler : ElementHandler<IToolbar, MauiToolbar>
{
protected override MauiToolbar CreatePlatformElement() => new();

public static void MapTitle(IToolbarHandler arg1, IToolbar arg2)
protected override void ConnectHandler(MauiToolbar platformView)
{
platformView.IconPressed += OnIconPressed;
base.ConnectHandler(platformView);
}

protected override void DisconnectHandler(MauiToolbar platformView)
{
arg1.PlatformView.UpdateTitle(arg2);
platformView.IconPressed -= OnIconPressed;
base.DisconnectHandler(platformView);
}

public static void MapTitle(IToolbarHandler handler, IToolbar toolbar)
{
handler.PlatformView.UpdateTitle(toolbar);
}

async void OnIconPressed(object? sender, EventArgs args)
{
if (VirtualView.BackButtonVisible && VirtualView.IsVisible)
{
// Delays invoking the BackButtonClicked
// so the other attached events can be invoked before the pop behavior is done on a FlyoutPage.
await Task.Delay(100);

MauiContext?.GetPlatformWindow().GetWindow()?.BackButtonClicked();
}
}
}
}
15 changes: 15 additions & 0 deletions src/Core/src/Platform/Tizen/MauiFlyoutView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Tizen.UIExtensions.NUI;

namespace Microsoft.Maui.Platform
{
public class MauiFlyoutView : NavigationDrawer, IToolbarContainer
{
void IToolbarContainer.SetToolbar(MauiToolbar toolbar)
{
if (Content is IToolbarContainer container)
{
container.SetToolbar(toolbar);
}
}
}
}
15 changes: 15 additions & 0 deletions src/Core/src/Platform/Tizen/MauiTVFlyoutView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Tizen.UIExtensions.NUI;

namespace Microsoft.Maui.Platform
{
public class MauiTVFlyoutView : TVNavigationDrawer, IToolbarContainer
{
void IToolbarContainer.SetToolbar(MauiToolbar toolbar)
{
if (Content is IToolbarContainer container)
{
container.SetToolbar(toolbar);
}
}
}
}
4 changes: 0 additions & 4 deletions src/Core/src/Platform/Tizen/StackNavigationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public void SetToolbar(MauiToolbar toolbar)
_toolbar = toolbar;
Add(toolbar);
(toolbar.Layout as NLayoutGroup)?.ChangeLayoutSiblingOrder(0);
_toolbar.IconPressed += (s, e) =>
{
MauiContext?.GetPlatformWindow().GetWindow()?.BackButtonClicked();
};
}

public virtual void Connect(IView navigationView)
Expand Down
8 changes: 7 additions & 1 deletion src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,8 @@ Microsoft.Maui.Platform.MauiClipperView.Clip.set -> void
Microsoft.Maui.Platform.MauiClipperView.MauiClipperView() -> void
Microsoft.Maui.Platform.MauiDateTimePicker
Microsoft.Maui.Platform.MauiDateTimePicker.MauiDateTimePicker(System.DateTime dateTime, bool isTimePicker) -> void
Microsoft.Maui.Platform.MauiFlyoutView
Microsoft.Maui.Platform.MauiFlyoutView.MauiFlyoutView() -> void
Microsoft.Maui.Platform.MauiImageButton
Microsoft.Maui.Platform.MauiImageButton.Clicked -> System.EventHandler?
Microsoft.Maui.Platform.MauiImageButton.MauiImageButton() -> void
Expand Down Expand Up @@ -1591,6 +1593,8 @@ Microsoft.Maui.Platform.MauiToolbar.Expand() -> void
Microsoft.Maui.Platform.MauiToolbar.IconPressed -> System.EventHandler?
Microsoft.Maui.Platform.MauiToolbar.MauiToolbar() -> void
Microsoft.Maui.Platform.MauiToolbar.SendIconPressed() -> void
Microsoft.Maui.Platform.MauiTVFlyoutView
Microsoft.Maui.Platform.MauiTVFlyoutView.MauiTVFlyoutView() -> void
Microsoft.Maui.Platform.MauiWebView
Microsoft.Maui.Platform.MauiWebView.MauiWebView() -> void
Microsoft.Maui.Platform.NavigationStackExtensions
Expand Down Expand Up @@ -2008,7 +2012,9 @@ override Microsoft.Maui.Handlers.TabbedViewHandler.CreatePlatformView() -> Tizen
override Microsoft.Maui.Handlers.TimePickerHandler.ConnectHandler(Tizen.UIExtensions.NUI.Entry! platformView) -> void
override Microsoft.Maui.Handlers.TimePickerHandler.CreatePlatformView() -> Tizen.UIExtensions.NUI.Entry!
override Microsoft.Maui.Handlers.TimePickerHandler.DisconnectHandler(Tizen.UIExtensions.NUI.Entry! platformView) -> void
override Microsoft.Maui.Handlers.ToolbarHandler.ConnectHandler(Microsoft.Maui.Platform.MauiToolbar! platformView) -> void
override Microsoft.Maui.Handlers.ToolbarHandler.CreatePlatformElement() -> Microsoft.Maui.Platform.MauiToolbar!
override Microsoft.Maui.Handlers.ToolbarHandler.DisconnectHandler(Microsoft.Maui.Platform.MauiToolbar! platformView) -> void
override Microsoft.Maui.Handlers.ViewHandler<TVirtualView, TPlatformView>.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
override Microsoft.Maui.Handlers.ViewHandler<TVirtualView, TPlatformView>.NeedsContainer.get -> bool
override Microsoft.Maui.Handlers.ViewHandler<TVirtualView, TPlatformView>.OnPlatformViewDeleted() -> void
Expand Down Expand Up @@ -2416,7 +2422,7 @@ static Microsoft.Maui.Handlers.TimePickerHandler.MapTextColor(Microsoft.Maui.Han
static Microsoft.Maui.Handlers.TimePickerHandler.MapTime(Microsoft.Maui.Handlers.ITimePickerHandler! handler, Microsoft.Maui.ITimePicker! timePicker) -> void
static Microsoft.Maui.Handlers.ToolbarHandler.CommandMapper -> Microsoft.Maui.CommandMapper<Microsoft.Maui.IToolbar!, Microsoft.Maui.Handlers.IToolbarHandler!>!
static Microsoft.Maui.Handlers.ToolbarHandler.Mapper -> Microsoft.Maui.IPropertyMapper<Microsoft.Maui.IToolbar!, Microsoft.Maui.Handlers.IToolbarHandler!>!
static Microsoft.Maui.Handlers.ToolbarHandler.MapTitle(Microsoft.Maui.Handlers.IToolbarHandler! arg1, Microsoft.Maui.IToolbar! arg2) -> void
static Microsoft.Maui.Handlers.ToolbarHandler.MapTitle(Microsoft.Maui.Handlers.IToolbarHandler! handler, Microsoft.Maui.IToolbar! toolbar) -> void
static Microsoft.Maui.Handlers.ViewHandler.MapAnchorX(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void
static Microsoft.Maui.Handlers.ViewHandler.MapAnchorY(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void
static Microsoft.Maui.Handlers.ViewHandler.MapAutomationId(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void
Expand Down
2 changes: 1 addition & 1 deletion src/Core/tests/UnitTests/Core.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/Essentials/test/UnitTests/Essentials.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/tests/Graphics.Tests/Graphics.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.7.0" PrivateAssets="all" />
<PackageReference Include="SkiaSharp" Version="2.88.1" />
Expand Down

0 comments on commit 68c20e5

Please sign in to comment.