Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.9.9 #145

Merged
merged 8 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
Rendering engine to draw your UI on a Skia canvas, with gestures and animations, designed to draw pixel-perfect custom controls instead of using native ones, powered by [SkiaSharp](https://github.com/mono/SkiaSharp)😍.
Create and render your custom controls on a hardware-accelerated Skia canvas with an improved common MAUI layout system.

**IMPORTANT UPDATE**
Reverted SkiaSharp from 2.88.9 to 2.88.9-preview.2.2
until [scaling issue](https://github.com/taublast/DrawnUi.Maui/issues/130) is solved for Windows

Supports **iOS**, **MacCatalyst**, **Android**, **Windows**.

* To use inside a usual MAUI app, consume drawn controls here and there inside `Canvas` views.
Expand All @@ -20,9 +16,23 @@ Supports **iOS**, **MacCatalyst**, **Android**, **Windows**.

_The current development state is __ALPHA__, features remain to be implemented, documentation incoming._

## What's New

### Nuget 1.2.9.9
_for SkiaSharp 2.88.9-preview.2.2_

* ImageDoubleBuffered rendering gets faster
* TextTransform property for SkiaLabel: Lowercase, Uppercase, Titlecase, Phrasecase
* SkiaButton TinColor removed, applying Background and BackgroundColor to button frame
* Nuget iOS 17 compatibility restored
* Some more fixes
* Still using SkiaSharp 2.88.9-preview.2.2
until [scaling issue](https://github.com/taublast/DrawnUi.Maui/issues/130) is solved for Windows


https://github.com/taublast/DrawnUi.Maui/assets/25801194/3b360229-ce3b-4d33-a85b-554d1cca8408

___Please star ⭐ if you like it, helps very much!___
___Please star ⭐ if you like it!___

## Features

Expand Down Expand Up @@ -92,17 +102,6 @@ ___Please star ⭐ if you like it, helps very much!___
* Not just accelerators, but full keyboard support, usage example inside __SpaceShooter__ game below. :)


## What's New

### Nuget 1.2.9.8
for SkiaSharp 2.88.9-preview.2.2

* DisposeObject optimized for background.
* Templated layout measurement optimized.
* HotFix for gestures crash on iOS when targeting ios lower than 18.
* Nuget targets ios 17.


## About

[A small article](https://taublast.github.io/posts/MauiJuly/) about the library and why it was created
Expand Down
4 changes: 2 additions & 2 deletions dev/github_uploadnugets.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ REM Define the source directory for the packages
set "source_dir=E:\Nugets"

REM Define the list of file masks for the packages
set "mask[1]=DrawnUi.Maui*.1.2.9.8*.nupkg"
set "mask[2]=AppoMobi.Maui.DrawnUi.1.2.9.8*.*nupkg"
set "mask[1]=DrawnUi.Maui*.1.2.9.9*.nupkg"
set "mask[2]=AppoMobi.Maui.DrawnUi.1.2.9.9*.*nupkg"
set "mask_count=2"

REM Loop through each file mask
Expand Down
4 changes: 2 additions & 2 deletions dev/nuget_uploadnugets.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ REM Define the source directory for the packages
set "source_dir=E:\Nugets"

REM Define the list of file masks for the packages
set "mask[1]=DrawnUi.Maui*.1.2.9.8*.nupkg"
set "mask[2]=AppoMobi.Maui.DrawnUi.1.2.9.8*.*nupkg"
set "mask[1]=DrawnUi.Maui*.1.2.9.9*.nupkg"
set "mask[2]=AppoMobi.Maui.DrawnUi.1.2.9.9*.*nupkg"
set "mask_count=2"

REM Loop through each file mask
Expand Down
6 changes: 3 additions & 3 deletions src/Addons/DrawnUi.Maui.Camera/DrawnUi.Maui.Camera.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios17.0;net8.0-maccatalyst17.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net8.0-maccatalyst17.0;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -44,7 +44,7 @@

<!--production-->
<ItemGroup Condition="'$(UseNuget)' == 'true'">
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.8" />
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.9" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/Addons/DrawnUi.Maui.Game/DrawnUi.Maui.Game.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios17.0;net8.0-maccatalyst17.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net8.0-maccatalyst17.0;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -42,7 +42,7 @@

<!--production-->
<ItemGroup Condition="'$(UseNuget)' == 'true'">
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.8" />
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.9" />
</ItemGroup>


Expand Down
6 changes: 3 additions & 3 deletions src/Addons/DrawnUi.Maui.MapsUi/src/DrawnUi.Maui.MapsUi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios17.0;net8.0-maccatalyst17.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net8.0-maccatalyst17.0;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -54,7 +54,7 @@

<!--production-->
<ItemGroup Condition="'$(UseNuget)' == 'true'">
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.8" />
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.9" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/Addons/DrawnUi.Maui.Rive/DrawnUi.Maui.Rive.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios17.0;net8.0-maccatalyst17.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net8.0-maccatalyst17.0;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -47,7 +47,7 @@

<!--production-->
<ItemGroup Condition="'$(UseNuget)' == 'true'">
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.8" />
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.9" />
</ItemGroup>


Expand Down
6 changes: 3 additions & 3 deletions src/Addons/DrawnUi.MauiGraphics/DrawnUi.MauiGraphics.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios17.0;net8.0-maccatalyst17.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android34.0;net8.0-ios17.0;net8.0-maccatalyst17.0;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -41,7 +41,7 @@

<!--production-->
<ItemGroup Condition="'$(UseNuget)' == 'true'">
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.8" />
<PackageReference Include="AppoMobi.Maui.DrawnUi" Version="1.2.9.9" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<PropertyGroup Condition="'$(UseSkiaSharp3)' != 'true'">
<PackageReleaseNotes>Using SkiaSharp 2.xx. Checkout the DrawnUi Sandbox project for usage example.</PackageReleaseNotes>
<Version>1.2.9.8</Version>
<Version>1.2.9.9</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(UseSkiaSharp3)' == 'true'">
Expand Down
38 changes: 22 additions & 16 deletions src/Engine/Controls/Button/SkiaButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public virtual void ApplyProperties()

if (MainFrame != null)
{
MainFrame.BackgroundColor = this.TintColor;
MainFrame.BackgroundColor = this.BackgroundColor;
MainFrame.Background = this.Background;
MainFrame.CornerRadius = this.CornerRadius;
}
}
Expand Down Expand Up @@ -526,23 +527,8 @@ public object CommandLongPressingParameter
}



public static readonly BindableProperty TintColorProperty = BindableProperty.Create(
nameof(TintColor),
typeof(Color),
typeof(SkiaButton),
RedColor,
propertyChanged: NeedApplyProperties);


protected SKPoint _lastDownPts;

public Color TintColor
{
get { return (Color)GetValue(TintColorProperty); }
set { SetValue(TintColorProperty, value); }
}

public static readonly BindableProperty TextColorProperty = BindableProperty.Create(
nameof(TextColor),
typeof(Color),
Expand Down Expand Up @@ -577,7 +563,27 @@ private static void NeedApplyProperties(BindableObject bindable, object oldvalue
}
}

protected override void OnPropertyChanged(string propertyName = null)
{
base.OnPropertyChanged(propertyName);

if (propertyName.IsEither(nameof(Background), nameof(BackgroundColor)))
{
ApplyProperties();
}
}

#endregion

protected override bool SetupBackgroundPaint(SKPaint paint, SKRect destination)
{
if (MainFrame != null)
{
//will paint its background instead
return false;
}

return base.SetupBackgroundPaint(paint, destination);
}

}
6 changes: 3 additions & 3 deletions src/Engine/Controls/Labels/SkiaLabelFps.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DrawnUi.Maui.Draw;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;

namespace DrawnUi.Maui.Draw;

Expand All @@ -8,6 +7,7 @@ public class SkiaLabelFps : SkiaLabel, ISkiaAnimator
public SkiaLabelFps()
{
IsParentIndependent = true;
WillNotUpdateParent = true;

Tag = "FPS";
MaxLines = 1;
Expand Down Expand Up @@ -130,4 +130,4 @@ public void Start(double delayMs = 0)
IsRunning = RegisterAnimator(this);
}
}
}
}
Loading
Loading