-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from JoonghyunCho/add-tizen-support
Add Tizen support
- Loading branch information
Showing
19 changed files
with
478 additions
and
6 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
example/Thewissen.PancakeViewSample.Tizen/Thewissen.PancakeViewSample.Tizen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using Xamarin.Forms; | ||
|
||
namespace Thewissen.PancakeViewSample.Tizen | ||
{ | ||
class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication | ||
{ | ||
protected override void OnCreate() | ||
{ | ||
base.OnCreate(); | ||
ElmSharp.Utility.AppendGlobalFontPath(this.DirectoryInfo.Resource); | ||
MainWindow.IndicatorMode = ElmSharp.IndicatorMode.Hide; | ||
var app = new App(); | ||
app.MainPage.BackgroundColor = Color.White; | ||
LoadApplication(app); | ||
} | ||
|
||
static void Main(string[] args) | ||
{ | ||
var app = new Program(); | ||
Forms.Init(app, true); | ||
app.Run(args); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
example/Thewissen.PancakeViewSample.Tizen/Thewissen.PancakeViewSample.Tizen.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Project Sdk="Tizen.NET.Sdk/1.0.9"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>tizen40</TargetFramework> | ||
<CopyLocalRuntimeTargetAssets Condition="'$(CopyLocalRuntimeTargetAssets)' == ''">true</CopyLocalRuntimeTargetAssets> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugType>portable</DebugType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
|
||
<!-- PackageReference as a workaround for SkiaSharp to be run on Tizen 4.0 Emulator --> | ||
<ItemGroup> | ||
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.3" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Thewissen.PancakeViewSample\Thewissen.PancakeViewSample.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.86 KB
...wissen.PancakeViewSample.Tizen/shared/res/Thewissen.PancakeViewSample.Tizen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions
13
example/Thewissen.PancakeViewSample.Tizen/tizen-manifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="org.tizen.example.Thewissen.PancakeViewSample.Tizen" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages"> | ||
<profile name="common" /> | ||
<ui-application appid="org.tizen.example.Thewissen.PancakeViewSample.Tizen" exec="Thewissen.PancakeViewSample.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single"> | ||
<label>Thewissen.PancakeViewSample.Tizen</label> | ||
<icon>Thewissen.PancakeViewSample.Tizen.png</icon> | ||
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" /> | ||
<splash-screens /> | ||
</ui-application> | ||
<shortcut-list /> | ||
<dependencies /> | ||
<provides-appdefined-privileges /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/Xamarin.Forms.PancakeView.Multi/Platforms/Tizen/DrawingExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using SkiaSharp; | ||
|
||
namespace Xamarin.Forms.PancakeView.Tizen | ||
{ | ||
public static class DrawingExtensions | ||
{ | ||
static public SKPath CreateRoundedRectPath(int left, int top, int width, int height, CornerRadius cornerRadius) | ||
{ | ||
var path = new SKPath(); | ||
var skRoundRect = new SKRoundRect(new SKRect(left, top, width, height)); | ||
SKPoint[] radii = new SKPoint[4] | ||
{ | ||
new SKPoint((float)cornerRadius.TopLeft, (float)cornerRadius.TopLeft), | ||
new SKPoint((float)cornerRadius.TopRight, (float)cornerRadius.TopRight), | ||
new SKPoint((float)cornerRadius.BottomRight, (float)cornerRadius.BottomRight), | ||
new SKPoint((float)cornerRadius.BottomLeft, (float)cornerRadius.BottomLeft) | ||
}; | ||
skRoundRect.SetRectRadii(skRoundRect.Rect, radii); | ||
path.AddRoundRect(skRoundRect); | ||
path.Close(); | ||
return path; | ||
} | ||
|
||
public static SKPath CreatePolygonPath(float rectWidth, float rectHeight, int sides, double cornerRadius = 0.0, double rotationOffset = 0.0) | ||
{ | ||
var offsetRadians = rotationOffset * Math.PI / 180; | ||
var path = new SKPath(); | ||
var theta = 2 * Math.PI / sides; | ||
|
||
var width = (-cornerRadius + Math.Min(rectWidth, rectHeight)) / 2; | ||
var center = new Point(rectWidth / 2, rectHeight / 2); | ||
|
||
var radius = width + cornerRadius - (Math.Cos(theta) * cornerRadius) / 2; | ||
|
||
var angle = offsetRadians; | ||
var corner = new Point(center.X + (radius - cornerRadius) * Math.Cos(angle), center.Y + (radius - cornerRadius) * Math.Sin(angle)); | ||
path.MoveTo((float)(corner.X + cornerRadius * Math.Cos(angle + theta)), (float)(corner.Y + cornerRadius * Math.Sin(angle + theta))); | ||
|
||
for (var i = 0; i < sides; i++) | ||
{ | ||
angle += theta; | ||
corner = new Point(center.X + (radius - cornerRadius) * Math.Cos(angle), center.Y + (radius - cornerRadius) * Math.Sin(angle)); | ||
var tip = new Point(center.X + radius * Math.Cos(angle), center.Y + radius * Math.Sin(angle)); | ||
var start = new Point(corner.X + cornerRadius * Math.Cos(angle - theta), corner.Y + cornerRadius * Math.Sin(angle - theta)); | ||
var end = new Point(corner.X + cornerRadius * Math.Cos(angle + theta), corner.Y + cornerRadius * Math.Sin(angle + theta)); | ||
|
||
path.LineTo((float)start.X, (float)start.Y); | ||
path.QuadTo((float)tip.X, (float)tip.Y, (float)end.X, (float)end.Y); | ||
} | ||
|
||
path.Close(); | ||
return path; | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Xamarin.Forms.PancakeView.Multi/Platforms/Tizen/Interop.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Xamarin.Forms.PancakeView.Tizen | ||
{ | ||
internal static class Interop | ||
{ | ||
const string Evas = "libevas.so.1"; | ||
|
||
[DllImport(Evas)] | ||
internal static extern void evas_object_clip_unset(IntPtr obj); | ||
} | ||
} |
Oops, something went wrong.