Skip to content

Commit

Permalink
feat: Add .vscode/settings.json and update project files
Browse files Browse the repository at this point in the history
- Added .vscode/settings.json file with dotnet.defaultSolution set to "AuroraControlsMaui.sln"
- Updated AuroraControls.TestApp.csproj to conditionally set MtouchExtraArgs for iOS target platform
- Updated AuroraControls.csproj to add package references for SkiaSharp.Views.Maui.Controls, Svg.Skia, Topten.RichTextKit, and SkiaSharp.HarfBuzz
- Updated VisualElementExtensions.cs to improve code readability and remove unnecessary null checks
  • Loading branch information
michaelstonis committed Oct 18, 2023
1 parent dcf79b4 commit 44d728e
Show file tree
Hide file tree
Showing 64 changed files with 247 additions and 227 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "AuroraControlsMaui.sln"
}
4 changes: 1 addition & 3 deletions AuroraControls.TestApp/AuroraControls.TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
<MtouchExtraArgs>--weak-framework=NewsstandKit.framework/NewsstandKit</MtouchExtraArgs>
<MtouchExtraArgs Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">--weak-framework=NewsstandKit.framework/NewsstandKit</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
Expand Down
2 changes: 1 addition & 1 deletion AuroraControlsMaui/AuroraControlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public static MauiAppBuilder UseAuroraControls(this MauiAppBuilder mauiAppBuilde

return mauiAppBuilder;
}
}
}
48 changes: 24 additions & 24 deletions AuroraControlsMaui/AuroraControls.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<AssemblyName>AuroraControls</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.6" />
<PackageReference Include="Svg.Skia" Version="1.0.0.2" />
<PackageReference Include="Topten.RichTextKit" Version="0.4.166" />
<PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.6" />
</ItemGroup>
</Project>
<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<AssemblyName>AuroraControls</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp.Views.Maui.Controls"
Version="2.88.6" />
<PackageReference Include="Svg.Skia"
Version="1.0.0.2" />
<PackageReference Include="Topten.RichTextKit"
Version="0.4.166" />
<PackageReference Include="SkiaSharp.HarfBuzz"
Version="2.88.6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion AuroraControlsMaui/AuroraViewBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ private void PaintSurfaceInternal(SKSurface surface, SKImageInfo info)
}
}
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/AuroraViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public AuroraViewHandler()
: base(SKCanvasViewHandler.SKCanvasViewMapper, SKCanvasViewHandler.SKCanvasViewCommandMapper)
{
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/CupertinoToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,4 @@ private void AnimateToggle(bool toggled)
easing: Easing.CubicInOut,
length: ToggleAnimationDuration);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Easings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,4 @@ public static double BounceEaseInOut(double p)

return (0.5d * BounceEaseOut((p * 2) - 1)) + 0.5d;
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/EmbeddedResourceLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ public static Stream Load(string name)

return stream ?? Stream.Null;
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/EndCapType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ public enum EndCapType
{
Square = 1,
Rounded = 2,
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/ColorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public static SKColor WithAlpha(this SKColor color, float alpha)

return color.WithAlpha((byte)alphaByte);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/DrawingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public static System.Drawing.PointF Center(this RectangleF rectangle)
rectangle.Left + (rectangle.Width / 2f),
rectangle.Top + (rectangle.Height / 2f));
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/ImageSourceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,4 @@ public static UriImageSource AsAsyncUriImageSource(this Task<UriImageSource> ima
.FileImageSourceFromSvg(svgName, squareSize, colorOverride: colorOverride)
.AsAsyncSourceFor(image);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/MathExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public static byte Lerp(this byte start, byte end, double amount)

return (byte)(start + adjusted);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public static T Clamp<T>(this T val, T min, T max)

return val;
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/SKCanvasExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,4 @@ public static Size IconifiedTextSize(this SKCanvas canvas, string text, SKPaint

return new Size(width, height);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/SKTextRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ public static IEnumerable<SKTextRun> Create(string text, SKTextRunLookup lookup,

return runs;
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/SKTextRunLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ public void Dispose()
{
Dispose(true);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/SKTextRunLookupEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ public void Dispose()
{
Dispose(true);
}
}
}
2 changes: 1 addition & 1 deletion AuroraControlsMaui/Extensions/SkiaShapeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public static SKRectI Subtract(this SKRectI rect, Thickness thickness)

return rect;
}
}
}
7 changes: 2 additions & 5 deletions AuroraControlsMaui/Extensions/SkiaSharpTextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ public static void DrawTextAtBaseline(

public static void EnsureHasValidFont(this SKPaint fontPaint, string text)
{
if (fontPaint.Typeface is null)
{
fontPaint.Typeface = PlatformInfo.DefaultTypeface;
}
fontPaint.Typeface ??= PlatformInfo.DefaultTypeface;

// TODO: There is likely a better/faster way to do all of this
if (!string.IsNullOrEmpty(text) && !fontPaint.Typeface.ContainsGlyphs(text))
Expand All @@ -136,4 +133,4 @@ public static void EnsureHasValidFont(this SKPaint fontPaint, string text)
}
}
}
}
}
Loading

0 comments on commit 44d728e

Please sign in to comment.