Skip to content

Commit

Permalink
Merge pull request #20 from AathifMahir/dotnet8
Browse files Browse the repository at this point in the history
Dotnet 8 Support and Removal of Dotnet 6 Support
  • Loading branch information
AathifMahir committed Nov 19, 2023
2 parents 9fe5a11 + a8b1dad commit 0f86717
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ using MauiShakeDetector;

Maui Shake Detector is Licensed Under [MIT License](https://github.com/AathifMahir/MauiShakeDetector/blob/master/LICENSE.txt).

# Wanna Help
# Contribute

Want to Contribute this project, Feel free to Create an Issue or Else Want to Contribute to the Project on Resources, Feel Free to Donate Me Via Below Url or You just want use Package, Feel Free to Do So, No Worries!!!

<a href="https://www.buymeacoffee.com/aathifmahir"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=aathifmahir&button_colour=6b4fdc&font_colour=ffffff&font_family=Lato&outline_colour=ffffff&coffee_colour=FFDD00" /></a>
If you wish to contribute to this project, please don't hesitate to create an issue or request. Your input and feedback are highly appreciated. Additionally, if you're interested in supporting the project by providing resources or [**becoming a sponsor**](https://github.com/sponsors/AathifMahir), your contributions would be welcomed and instrumental in its continued development and success. Thank you for your interest in contributing to this endeavor.
9 changes: 7 additions & 2 deletions sample/MauiShakeDetectorSample/MauiShakeDetectorSample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
Expand Down Expand Up @@ -30,6 +30,11 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
<CodesignKey>Apple Development: Created via API (VZXRD9YS8B)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net8.0;net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 0 additions & 2 deletions src/MauiShakeDetector/IShakeDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ public interface IShakeDetector
/// </summary>
#nullable enable
event EventHandler<ShakeDetectedEventArgs>? ShakeDetected;
#nullable disable

/// <summary>
/// Shake stopped event for detecting whether shake detector is stopped when Auto Stop is more than 0
/// </summary>
#nullable enable
event EventHandler? ShakeStopped;
#nullable disable
/// <summary>
Expand Down
22 changes: 13 additions & 9 deletions src/MauiShakeDetector/MauiShakeDetector.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0;net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0;net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == 'net7.0'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' And $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == 'net7.0'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == 'net6.0'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst' And $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == 'net6.0'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net8'))">
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
</ItemGroup>

<PropertyGroup>
<GitInfoReportImportance>high</GitInfoReportImportance>
<PackageId>AathifMahir.Maui.MauiShakeDetector</PackageId>
Expand All @@ -37,9 +41,9 @@
<Description>Maui Shake Detector Shake Event Detector Library with Lots of Customization like GForce Tuning, Shake Intervals and Haptics for Shake Events</Description>
<PackageIcon>icon.png</PackageIcon>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0</Version>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyFileVersion>2.0.0.0</AssemblyFileVersion>
<Version>2.0.0</Version>
<PackageVersion>$(Version)$(VersionSuffix)</PackageVersion>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>Maui,Shake,ShakeDetector,MauiShake,Accelerometer,Vibration</PackageTags>
Expand Down
8 changes: 7 additions & 1 deletion src/MauiShakeDetector/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
v1.0.0
v2.0.0
• Dotnet 8 Support

Breaking Changes
- Removal of Dotnet 6 Support

v1.0.0
• Added Shake Stopped Event and Command for Auto Stop Enabled Scenerios

v0.4.0
Expand Down
10 changes: 5 additions & 5 deletions src/MauiShakeDetector/ShakeDetectorDefault.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ internal sealed class ShakeDetectorDefault : IShakeDetector

// Event & Commands

public event EventHandler<ShakeDetectedEventArgs> ShakeDetected;
public event EventHandler ShakeStopped;
public event EventHandler<ShakeDetectedEventArgs>? ShakeDetected;
public event EventHandler? ShakeStopped;

public ICommand ShakeDetectedCommand { get; set; }
public ICommand ShakeStoppedCommand { get; set; }
public ICommand ShakeDetectedCommand { get; set; } = default!;
public ICommand ShakeStoppedCommand { get; set; } = default!;

public void StartListening(SensorSpeed sensorSpeed = SensorSpeed.Default)
{
Expand All @@ -47,7 +47,7 @@ public void StartListening(SensorSpeed sensorSpeed = SensorSpeed.Default)
Accelerometer.Default.ReadingChanged += Accelerometer_ReadingChanged;
}

void Accelerometer_ReadingChanged(object sender, AccelerometerChangedEventArgs e)
void Accelerometer_ReadingChanged(object? sender, AccelerometerChangedEventArgs e)
{
float y = e.Reading.Acceleration.Y;
float x = e.Reading.Acceleration.X;
Expand Down

0 comments on commit 0f86717

Please sign in to comment.