Notes/Notes.Android/MainActivity.cs

29 lines
800 B
C#

using Android.App;
using Android.Content.PM;
using Avalonia;
using Avalonia.Android;
using Avalonia.ReactiveUI;
using Notes.ViewModels;
namespace Notes.Android;
[Activity(
Label = "Notes.Android",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
var services = new Services();
services.Register<IFileService>(new FileService());
App.services = services;
return base.CustomizeAppBuilder(builder)
.WithInterFont()
.UseReactiveUI();
}
}