refactor(arch): split App into shared library + Desktop + Android heads

The Avalonia UI code (App, Views, ViewModels, Localization, Assets) now
lives in src/App as a plain library (no OutputType). Two thin heads
reference it:

- src/App.Desktop/ — WinExe, Avalonia.Desktop, hosts MainView in a
  MainWindow; carries Program.cs and app.manifest (moved from src/App)
- src/App.Android/ — net10.0-android, Avalonia.Android, MainActivity/
  MainApplication; targets API 23+, EmbedAssembliesIntoApk=true so the
  apk is self-contained for sideloading

All event handlers and TopLevel-dependent calls (file picker, clipboard,
folder picker) moved from MainWindow.axaml.cs into the new shared
MainView.axaml.cs (UserControl), using TopLevel.GetTopLevel(this) so
they work on both platforms. Esc/Back key handling is also in MainView.
MainWindow becomes a thin shell that hosts MainView.

Framework bump: all projects move to net10.0; Cli and Tests follow.
This commit is contained in:
2026-06-12 16:06:37 +02:00
parent a9ded6497a
commit e94eaf7700
19 changed files with 1110 additions and 939 deletions
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Head Android: entry-point e pacchetti specifici. La UI vera vive nella
libreria condivisa PalladiumWallet.App (stessa di desktop). -->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0-android</TargetFramework>
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ApplicationId>io.github.davide3011.palladiumwallet</ApplicationId>
<!-- ApplicationVersion = versionCode (intero), ApplicationDisplayVersion = versionName -->
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>0.9.0</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<!-- Includi le assembly .NET DENTRO l'apk: senza, in Debug si usa il Fast
Deployment (assembly spinte via adb da `dotnet run`) e un apk installato
a mano — sideload sul telefono o `adb install` — crasha all'avvio con
"monodroid: No assemblies found ... Exiting". Così l'apk è autosufficiente. -->
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<!-- Default: ABI multiple (l'apk gira sia su emulatore x86_64 sia su telefoni arm64).
Per un apk più piccolo solo-telefono: aggiungi -p:AbiArm64Only=true alla build. -->
<RuntimeIdentifiers Condition="'$(AbiArm64Only)' == 'true'">android-arm64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="12.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\App\PalladiumWallet.App.csproj" />
</ItemGroup>
</Project>