Skip to content

Commit

Permalink
[Tizen] Adds BoxView Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Apr 7, 2022
1 parent 65c959c commit 6211102
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Core/src/Handlers/BoxView/BoxViewHandler.Tizen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.Maui.Graphics;

namespace Microsoft.Maui.Handlers
{
public partial class BoxViewHandler : ViewHandler<IBoxView, MauiBoxView>
{
protected override MauiBoxView CreateNativeView()
{
return new MauiBoxView(NativeParent!)
{
Drawable = new BoxViewDrawable(VirtualView)
};
}

public static void MapColor(BoxViewHandler handler, IBoxView boxView)
{
handler.NativeView?.InvalidateBoxView(boxView);
}

public static void MapCornerRadius(BoxViewHandler handler, IBoxView boxView)
{
handler.NativeView?.InvalidateBoxView(boxView);
}
}
}
5 changes: 5 additions & 0 deletions src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public static void MapPlaceholder(EntryHandler handler, IEntry entry)
handler.NativeView?.UpdatePlaceholder(entry);
}

public static void MapPlaceholderColor(EntryHandler handler, IEntry entry)
{
handler.NativeView?.UpdatePlaceholderColor(entry);
}

public static void MapIsPassword(EntryHandler handler, IEntry entry)
{
handler.NativeView?.UpdateIsPassword(entry);
Expand Down
12 changes: 12 additions & 0 deletions src/Core/src/Platform/Tizen/BoxViewExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.Maui.Graphics;

namespace Microsoft.Maui
{
public static class BoxViewExtensions
{
public static void InvalidateBoxView(this MauiBoxView nativeView, IBoxView boxView)
{
nativeView.Invalidate();
}
}
}
13 changes: 13 additions & 0 deletions src/Core/src/Platform/Tizen/MauiBoxView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using ElmSharp;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;

namespace Microsoft.Maui
{
public class MauiBoxView : SkiaGraphicsView
{
public MauiBoxView(EvasObject parent) : base(parent)
{
DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor;
}
}
}

0 comments on commit 6211102

Please sign in to comment.