// See the note at the top of MainActivity for why the platform namespaces are reached through `global::`.
using Avalonia;
using Avalonia.Android;
using DodoSSH.Client.Android.Platform;
using global::Android.App;
using global::Android.Runtime;
namespace DodoSSH.Client.Android;
///
/// The Android Application object, and where Avalonia is configured.
///
///
///
/// Avalonia 12 moved the hooks here from the activity, which is a better fit than
/// it first looks: an activity is destroyed and recreated, and the application object is not. The desktop
/// head's equivalent is Program.BuildAvaloniaApp.
///
///
/// Any Avalonia 11 sample will show this on AvaloniaMainActivity<App> instead. That type is
/// still here and is still what the launcher activity derives from — it simply no longer takes the
/// application as a type argument.
///
///
[Application(Label = "DodoSSH")]
public sealed class DodoSshAndroidApplication : AvaloniaAndroidApplication
{
///
/// The JNI constructor, and the only one Android calls. It exists to hand the managed object its Java
/// peer; there is nothing to do in it and nothing may be done in it, because the application context is
/// not usable until .
///
public DodoSshAndroidApplication(nint javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
}
///
public override void OnCreate()
{
// Before Avalonia, and from the application rather than the activity: this is the context whose
// lifetime matches the composition root's, and reading filesDir is the first thing startup does.
PhoneEnvironment.Attach(this);
base.OnCreate();
}
///
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) =>
base.CustomizeAppBuilder(builder).WithInterFont();
}