diff --git a/LCDonald.Android/LCDonald.Android.csproj b/LCDonald.Android/LCDonald.Android.csproj index bfc4189..ef1b00b 100644 --- a/LCDonald.Android/LCDonald.Android.csproj +++ b/LCDonald.Android/LCDonald.Android.csproj @@ -34,6 +34,7 @@ + diff --git a/LCDonald.Android/MainActivity.cs b/LCDonald.Android/MainActivity.cs index a818f49..503245f 100644 --- a/LCDonald.Android/MainActivity.cs +++ b/LCDonald.Android/MainActivity.cs @@ -1,10 +1,30 @@ using Android.App; using Android.Content.PM; +using Avalonia; using Avalonia.Android; +using CommunityToolkit.Mvvm.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; +using LCDonald.Core.Controller; namespace LCDonald.Android; -[Activity(Label = "LCDonald.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] -public class MainActivity : AvaloniaMainActivity +[Activity( + Label = "LCDonald.Android", + Theme = "@style/MyTheme.NoActionBar", + Icon = "@drawable/icon", + MainLauncher = true, + ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] +public class MainActivity : AvaloniaMainActivity { + + protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) + { + Ioc.Default.ConfigureServices( + new ServiceCollection() + .AddSingleton() + .BuildServiceProvider()); + + return base.CustomizeAppBuilder(builder); + } + } diff --git a/LCDonald.Android/SplashActivity.cs b/LCDonald.Android/SplashActivity.cs deleted file mode 100644 index 369dfb5..0000000 --- a/LCDonald.Android/SplashActivity.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Android.App; -using Android.Content; -using Android.OS; -using Application = Android.App.Application; -using Avalonia; -using Avalonia.Android; -using CommunityToolkit.Mvvm.DependencyInjection; -using Microsoft.Extensions.DependencyInjection; -using LCDonald.Core.Controller; - -namespace LCDonald.Android; - -[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -public class SplashActivity : AvaloniaSplashActivity -{ - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - Ioc.Default.ConfigureServices( - new ServiceCollection() - .AddSingleton() - .BuildServiceProvider()); - - return base.CustomizeAppBuilder(builder); - } - - protected override void OnCreate(Bundle? savedInstanceState) - { - base.OnCreate(savedInstanceState); - } - - protected override void OnResume() - { - base.OnResume(); - - StartActivity(new Intent(Application.Context, typeof(MainActivity))); - } -} diff --git a/README.md b/README.md index 07a32e4..4b07612 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ cd LCDonald.Desktop && dotnet restore && dotnet publish .\LCDonald.Desktop.cspro # macOS cd LCDonald.Desktop && dotnet restore && dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-x64 -property:Configuration=Release -# Android (Release is busted for now) -cd LCDonald.Android && dotnet build .\LCDonald.Android.csproj -c debug +# Android +cd LCDonald.Android && dotnet build .\LCDonald.Android.csproj -c release ```