Skip to content

Commit

Permalink
update to .net 9
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavAntonyuk committed Oct 22, 2024
1 parent c9fc1b5 commit c29a942
Show file tree
Hide file tree
Showing 173 changed files with 662 additions and 949 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-13]
os: [windows-latest, macos-14]

steps:
- name: Prepare variables on Windows
Expand All @@ -26,7 +26,7 @@ jobs:
echo "WORKING_DIRECTORY_PATH=C:/Projects/MauiSamples" >> $env:GITHUB_ENV
- name: Prepare variables on macOS
if: ${{ matrix.os == 'macos-13' }}
if: ${{ matrix.os == 'macos-14' }}
run: |
echo "WORKING_DIRECTORY_PATH=/Users/runner/Projects/MauiSamples" >> $GITHUB_ENV
Expand All @@ -37,15 +37,15 @@ jobs:
git checkout ${{ github.head_ref || github.ref_name }}
- name: Setup Xcode
if: ${{ matrix.os == 'macos-13' }}
if: ${{ matrix.os == 'macos-14' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1'
xcode-version: '16.0'

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x

- name: Install dependencies
run: dotnet workload install maui
Expand All @@ -60,4 +60,4 @@ jobs:
run: |
cd ${{ env.WORKING_DIRECTORY_PATH }}
dotnet restore --configfile NuGet.config
dotnet build --tl
dotnet build
14 changes: 7 additions & 7 deletions AndroidBindableLibraries/Balloon/Balloon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
<PackageId>VladislavAntonyuk.$(AssemblyName)</PackageId>
<Version>1.6.4</Version>
<Version>1.6.4.1</Version>
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
<PackageOutputPath>..\..\LocalPackages\</PackageOutputPath>
</PropertyGroup>
Expand All @@ -18,22 +18,22 @@
<Version>8.4.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime.Ktx">
<Version>2.7.0.2</Version>
<Version>2.8.5.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Annotation">
<Version>1.7.1.2</Version>
<Version>1.8.2.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Kotlin.StdLib">
<Version>1.9.23.1</Version>
<Version>2.0.10.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.6.1.8</Version>
<Version>1.7.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Core.Core.Ktx">
<Version>1.13.1</Version>
<Version>1.13.1.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Fragment.Ktx">
<Version>1.7.0</Version>
<Version>1.8.3.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion AndroidBindableLibraries/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<TargetFramework>net9.0-android</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
<PackageId>VladislavAntonyuk.$(AssemblyName)</PackageId>
<Version>1.9.0</Version>
<Version>1.9.0.1</Version>
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
<PackageOutputPath>..\..\LocalPackages\</PackageOutputPath>
</PropertyGroup>
Expand All @@ -17,28 +17,28 @@
<AndroidMavenLibrary Include="com.annimon:stream" Version="1.2.2" Bind="false" />
<AndroidMavenLibrary Include="com.applandeo:material-calendar-view" Version="1.9.0" />
<PackageReference Include="Xamarin.AndroidX.AppCompat">
<Version>1.6.1.7</Version>
<Version>1.7.0.3</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout">
<Version>2.1.4.10</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Core.Core.Ktx">
<Version>1.12.0.4</Version>
<Version>1.13.1.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Kotlin.StdLib">
<Version>1.9.23</Version>
<Version>2.0.10.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8">
<Version>1.9.23</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.3.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.3.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.3.1" />

<PackageReference Include="Xamarin.AndroidX.Fragment.Ktx">
<Version>1.6.2.2</Version>
<Version>1.8.3.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
18 changes: 10 additions & 8 deletions AndroidBindableLibraries/Sample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
namespace Sample
namespace Sample;

public partial class App : Application
{
public partial class App : Application
public App()
{
public App()
{
InitializeComponent();
InitializeComponent();
}

MainPage = new AppShell();
}
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
}
13 changes: 6 additions & 7 deletions AndroidBindableLibraries/Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace Sample
namespace Sample;

public partial class AppShell : Shell
{
public partial class AppShell : Shell
public AppShell()
{
public AppShell()
{
InitializeComponent();
}
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ protected override void ConnectHandler(Calendar platformView)
private void PlatformView_SelectedDatesChanged(object? sender, CalendarDayClickEventArgs e)
{
var calendar = e.CalendarDay.Calendar;
var time = TimeSpan.FromMilliseconds(calendar.TimeInMillis);
var result = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
VirtualView.SelectedDate = new DateTimeOffset(result.Add(time).Add(TimeSpan.FromMilliseconds(calendar.TimeZone.RawOffset)));
var result = new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0));
VirtualView.SelectedDate = result.AddMilliseconds(calendar.TimeInMillis).Add(result.Offset);
VirtualView.OnSelectedDateChanged(VirtualView.SelectedDate);
}

Expand Down
89 changes: 44 additions & 45 deletions AndroidBindableLibraries/Sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
namespace Sample
{
using Android.Views;
using Com.Skydoves.Balloon;
using Microsoft.Maui.Platform;
namespace Sample;

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
using Android.Views;
using Com.Skydoves.Balloon;
using Microsoft.Maui.Platform;

private void OnCounterClicked(object sender, EventArgs e)
{
var balloon = new Balloon.Builder(Platform.AppContext)
.SetText("Edit your profile here!")
.SetTextSize(15f)
.SetArrowPositionRules(ArrowPositionRules.AlignAnchor)
.SetArrowSize(10)
.SetArrowPosition(0.5f)
.SetPadding(12)
.SetCornerRadius(8f)
.SetBalloonAnimation(BalloonAnimation.Elastic)
.SetOnBalloonDismissListener(new BallonDismissListener(() =>
{
var balloon2 = new Balloon.Builder(Platform.AppContext)
.SetWidthRatio(1.0f)
.SetHeight(BalloonSizeSpec.Wrap)
.SetLayout(new BallonContent().ToPlatform(Handler.MauiContext))
.SetArrowPositionRules(ArrowPositionRules.AlignAnchor)
.SetArrowSize(10)
.SetArrowPosition(0.5f)
.SetPadding(12)
.SetCornerRadius(8f)
.SetBalloonAnimation(BalloonAnimation.Fade)
.Build();
balloon2.ShowAtCenter(MauiLabel.ToPlatform(MauiLabel.Handler.MauiContext));
}))
.Build();
balloon.ShowAtCenter(CounterBtn.ToPlatform(CounterBtn.Handler.MauiContext));
}
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}

internal class BallonDismissListener(Action action) : Java.Lang.Object, IOnBalloonDismissListener
private void OnCounterClicked(object sender, EventArgs e)
{
public void OnBalloonDismiss()
{
action();
}
var balloon = new Balloon.Builder(Platform.AppContext)
.SetText("Edit your profile here!")
.SetTextSize(15f)
.SetArrowPositionRules(ArrowPositionRules.AlignAnchor)
.SetArrowSize(10)
.SetArrowPosition(0.5f)
.SetPadding(12)
.SetCornerRadius(8f)
.SetBalloonAnimation(BalloonAnimation.Elastic)
.SetOnBalloonDismissListener(new BallonDismissListener(() =>
{
var balloon2 = new Balloon.Builder(Platform.AppContext)
.SetWidthRatio(1.0f)
.SetHeight(BalloonSizeSpec.Wrap)
.SetLayout(new BallonContent().ToPlatform(Handler.MauiContext))
.SetArrowPositionRules(ArrowPositionRules.AlignAnchor)
.SetArrowSize(10)
.SetArrowPosition(0.5f)
.SetPadding(12)
.SetCornerRadius(8f)
.SetBalloonAnimation(BalloonAnimation.Fade)
.Build();
balloon2.ShowAtCenter(MauiLabel.ToPlatform(MauiLabel.Handler.MauiContext));
}))
.Build();
balloon.ShowAtCenter(CounterBtn.ToPlatform(CounterBtn.Handler.MauiContext));
}
}

internal class BallonDismissListener(Action action) : Java.Lang.Object, IOnBalloonDismissListener
{
public void OnBalloonDismiss()
{
action();
}
}
43 changes: 21 additions & 22 deletions AndroidBindableLibraries/Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
namespace Sample
{
using Calendar;
using MauiBells.Calendar;
namespace Sample;

using Calendar;
using MauiBells.Calendar;

public static class MauiProgram
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureMauiHandlers(x =>
{
x.AddHandler<CalendarView, CalendarMaterialHandler>();
});
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureMauiHandlers(x =>
{
x.AddHandler<CalendarView, CalendarMaterialHandler>();
});

return builder.Build();
}
return builder.Build();
}
}
}
19 changes: 9 additions & 10 deletions AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
namespace Sample
{
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace Sample;

using Android.App;
using Android.Content.PM;
using Android.OS;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
}
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
namespace Sample
{
using Android.App;
using Android.Runtime;
namespace Sample;

[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
using Android.App;
using Android.Runtime;

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Loading

0 comments on commit c29a942

Please sign in to comment.