Skip to content

Commit

Permalink
Bump to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Sep 23, 2021
1 parent 3f49642 commit 4c12060
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .nuspec/Microsoft.Maui.Controls.SingleProject.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<!-- Windows -->
<EnableDefaultWindowsItems>false</EnableDefaultWindowsItems>
<WindowsProjectFolder Condition=" '$(WindowsProjectFolder)' == '' ">$(PlatformsProjectFolder)\Windows\</WindowsProjectFolder>
<!-- Tizen -->
<EnableDefaultTizenItems>false</EnableDefaultTizenItems>
<TizenProjectFolder Condition=" '$(TizenProjectFolder)' == '' ">$(PlatformsProjectFolder)Tizen\</TizenProjectFolder>
</PropertyGroup>

<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'android' ">
Expand Down Expand Up @@ -47,6 +50,11 @@
<WindowsPackageType Condition="'$(EnablePreviewMsixTooling)' == 'true'">MSIX</WindowsPackageType>
</PropertyGroup>

<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'tizen' ">
<TizenManifestFile Condition=" Exists('$(TizenProjectFolder)tizen-manifest.xml') ">$(TizenProjectFolder)tizen-manifest.xml</TizenManifestFile>
<TizenResourcePrefix>$(TizenProjectFolder)res</TizenResourcePrefix>
</PropertyGroup>

<!-- Removals -->
<ItemGroup Condition=" '$(EnableDefaultItems)' == 'true' and '$(SingleProject)' == 'true' ">
<!-- Explicitly include the platform code -->
Expand All @@ -62,6 +70,9 @@
<_MauiCompileToAdd
Condition=" '$(TargetPlatformIdentifier)' == 'windows' and '$(WindowsProjectFolder)' != '' "
Include="$(WindowsProjectFolder)**/*$(DefaultLanguageSourceExtension)" />
<_MauiCompileToAdd
Condition=" '$(TargetPlatformIdentifier)' == 'tizen' and '$(TizenProjectFolder)' != '' "
Include="$(TizenProjectFolder)**/*$(DefaultLanguageSourceExtension)" />
<None Include="$(PlatformsProjectFolder)**/*$(DefaultLanguageSourceExtension)" Exclude="@(_MauiCompileToAdd)" />
<Compile Remove="$(PlatformsProjectFolder)**/*$(DefaultLanguageSourceExtension)" />
<Compile Include="@(_MauiCompileToAdd)" />
Expand All @@ -88,4 +99,4 @@
<ProjectCapability Include="LaunchProfilesGroupByPlatformFilters" Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &gt;= '17.0' " />
</ItemGroup>

</Project>
</Project>
88 changes: 88 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs
Original file line number Diff line number Diff line change
@@ -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<ILabel, LabelHandler> ControlsLabelMapper = new PropertyMapper<Label, LabelHandler>(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);
}
}
}
31 changes: 31 additions & 0 deletions src/Core/src/Handlers/RefreshView/RefreshViewHandler.Tizen.cs
Original file line number Diff line number Diff line change
@@ -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<IRefreshView, EvasObject>
{
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)
{
}

}
}

0 comments on commit 4c12060

Please sign in to comment.