From 4c120603ed8d3d001d420a65972dcf110f4a639a Mon Sep 17 00:00:00 2001 From: Kangho Hur Date: Fri, 20 Aug 2021 09:02:33 +0900 Subject: [PATCH] Bump to latest --- ...rosoft.Maui.Controls.SingleProject.targets | 13 ++- .../src/Core/HandlerImpl/Label/Label.Tizen.cs | 88 +++++++++++++++++++ .../RefreshView/RefreshViewHandler.Tizen.cs | 31 +++++++ 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs create mode 100644 src/Core/src/Handlers/RefreshView/RefreshViewHandler.Tizen.cs diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets index 049c8a998528..667ebfe0fb3c 100644 --- a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets +++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets @@ -17,6 +17,9 @@ false $(PlatformsProjectFolder)\Windows\ + + false + $(PlatformsProjectFolder)Tizen\ @@ -47,6 +50,11 @@ MSIX + + $(TizenProjectFolder)tizen-manifest.xml + $(TizenProjectFolder)res + + @@ -62,6 +70,9 @@ <_MauiCompileToAdd Condition=" '$(TargetPlatformIdentifier)' == 'windows' and '$(WindowsProjectFolder)' != '' " Include="$(WindowsProjectFolder)**/*$(DefaultLanguageSourceExtension)" /> + <_MauiCompileToAdd + Condition=" '$(TargetPlatformIdentifier)' == 'tizen' and '$(TizenProjectFolder)' != '' " + Include="$(TizenProjectFolder)**/*$(DefaultLanguageSourceExtension)" /> @@ -88,4 +99,4 @@ - \ No newline at end of file + diff --git a/src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs b/src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs new file mode 100644 index 000000000000..4cb4c199856c --- /dev/null +++ b/src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs @@ -0,0 +1,88 @@ +using Microsoft.Maui; +using Microsoft.Maui.Handlers; + +namespace Microsoft.Maui.Controls +{ + public partial class Label + { + public static void RemapForControls() + { + // Adjust the mappings to preserve Controls.Label legacy behaviors + // ILabel does not include the TextType property, so we map it here to handle HTML text + // And we map some of the other property handlers to Controls-specific versions that avoid steppingon HTML text settings + + IPropertyMapper ControlsLabelMapper = new PropertyMapper(LabelHandler.LabelMapper) + { + [nameof(TextType)] = MapTextType, + [nameof(Text)] = MapText, + [nameof(TextDecorations)] = MapTextDecorations, + [nameof(CharacterSpacing)] = MapCharacterSpacing, + [nameof(LineHeight)] = MapLineHeight, + [nameof(ILabel.Font)] = MapFont, + [nameof(TextColor)] = MapTextColor + }; + + LabelHandler.LabelMapper = ControlsLabelMapper; + } + + public static void MapTextType(LabelHandler handler, Label label) + { + handler.NativeView?.UpdateText(label); + } + + public static void MapText(LabelHandler handler, Label label) + { + handler.NativeView?.UpdateText(label); + } + + public static void MapTextDecorations(LabelHandler handler, Label label) + { + if (label?.TextType == TextType.Html) + { + return; + } + + LabelHandler.MapTextDecorations(handler, label); + } + + public static void MapCharacterSpacing(LabelHandler handler, Label label) + { + if (label?.TextType == TextType.Html) + { + return; + } + + LabelHandler.MapCharacterSpacing(handler, label); + } + + public static void MapLineHeight(LabelHandler handler, Label label) + { + if (label?.TextType == TextType.Html) + { + return; + } + + LabelHandler.MapLineHeight(handler, label); + } + + public static void MapFont(LabelHandler handler, Label label) + { + if (label?.TextType == TextType.Html) + { + return; + } + + LabelHandler.MapFont(handler, label); + } + + public static void MapTextColor(LabelHandler handler, Label label) + { + if (label?.TextType == TextType.Html) + { + return; + } + + LabelHandler.MapTextColor(handler, label); + } + } +} diff --git a/src/Core/src/Handlers/RefreshView/RefreshViewHandler.Tizen.cs b/src/Core/src/Handlers/RefreshView/RefreshViewHandler.Tizen.cs new file mode 100644 index 000000000000..c94763d6c920 --- /dev/null +++ b/src/Core/src/Handlers/RefreshView/RefreshViewHandler.Tizen.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Maui.Graphics; +using ElmSharp; + +namespace Microsoft.Maui.Handlers +{ + // TODO : Need to implement + public partial class RefreshViewHandler : ViewHandler + { + protected override EvasObject CreateNativeView() => throw new NotImplementedException(); + + public static void MapIsRefreshing(RefreshViewHandler handler, IRefreshView refreshView) + { + } + + public static void MapContent(RefreshViewHandler handler, IRefreshView refreshView) + { + } + + public static void MapRefreshColor(RefreshViewHandler handler, IRefreshView refreshView) + { + } + + public static void MapRefreshViewBackground(RefreshViewHandler handler, IView view) + { + } + + } +}