Skip to content

Commit

Permalink
[Tizen] Apply graphics related code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Sep 24, 2021
1 parent 0050f5d commit f7b6200
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 86 deletions.
9 changes: 0 additions & 9 deletions src/Core/src/Graphics/PaintExtensions.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ class BackgroundDrawable : IDrawable
Paint _paint;
public BackgroundDrawable(Paint paint)
{
// Workaround.
// I think, SolidPaint violate LSP
// When Paint was used on Canvas.SetFillPaint, BackgroundColor was referred
// But SolidPaint do not update BackgroundColor when Color was updated even though it has same meaning.
if (paint is SolidPaint solidPaint)
{
solidPaint.BackgroundColor = solidPaint.Color;
}

_paint = paint;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Core/src/Handlers/Border/BorderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using NativeView = Microsoft.Maui.Handlers.ContentViewGroup;
#elif WINDOWS
using NativeView = Microsoft.Maui.Handlers.ContentPanel;
#elif TIZEN
using NativeView = Microsoft.Maui.ContentCanvas;
#elif NETSTANDARD
using NativeView = System.Object;
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using Microsoft.Maui.Graphics.Skia.Views;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;

namespace Microsoft.Maui.Handlers
{
public partial class GraphicsViewHandler : ViewHandler<IGraphicsView, SkiaGraphicsView>
{
protected override SkiaGraphicsView CreateNativeView()
{
return new SkiaGraphicsView(NativeParent)
{
DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor
};
return new SkiaGraphicsView(NativeParent);
}

public static void MapDrawable(GraphicsViewHandler handler, IGraphicsView graphicsView)
Expand Down
1 change: 0 additions & 1 deletion src/Core/src/Platform/Tizen/GraphicsViewExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.Maui.Graphics.Skia.Views;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;

namespace Microsoft.Maui
{
Expand Down
3 changes: 1 addition & 2 deletions src/Core/src/Platform/Tizen/MauiBoxView.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using ElmSharp;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;
using Microsoft.Maui.Graphics.Skia.Views;

namespace Microsoft.Maui
{
public class MauiBoxView : SkiaGraphicsView
{
public MauiBoxView(EvasObject parent) : base(parent)
{
DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor;
}
}
}
2 changes: 0 additions & 2 deletions src/Core/src/Platform/Tizen/MauiShapeView.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using ElmSharp;
using Microsoft.Maui.Graphics.Skia.Views;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;

namespace Microsoft.Maui
{
public class MauiShapeView : SkiaGraphicsView
{
public MauiShapeView(EvasObject parent) : base(parent)
{
DeviceScalingFactor = (float)Tizen.UIExtensions.Common.DeviceInfo.ScalingFactor;
}
}
}
62 changes: 0 additions & 62 deletions src/Core/src/Platform/Tizen/SkiaGraphicsView.Tizen.cs

This file was deleted.

6 changes: 1 addition & 5 deletions src/Core/src/Platform/Tizen/WrapperView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using SkiaSharp.Views.Tizen;
using Tizen.UIExtensions.Common;
using Tizen.UIExtensions.ElmSharp;
using SkiaGraphicsView = Microsoft.Maui.Platform.Tizen.SkiaGraphicsView;

namespace Microsoft.Maui
{
Expand All @@ -26,10 +25,7 @@ public WrapperView(EvasObject parent) : base(parent)
{
_backgroundCanvas = new Lazy<SkiaGraphicsView>(() =>
{
var view = new SkiaGraphicsView(parent)
{
DeviceScalingFactor = (float)DeviceInfo.ScalingFactor
};
var view = new SkiaGraphicsView(parent);
view.Show();
Children.Add(view);
view.Lower();
Expand Down

0 comments on commit f7b6200

Please sign in to comment.