From cfc48ff86f19e1f7a30e5e44d7a82d2250068b42 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Sun, 14 Jun 2026 19:54:07 +0200 Subject: [PATCH] feat(ui): responsive layout for portrait mobile (Android) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add IsMobile property and BoolToTabPlacementConverter; wire TabStripPlacement to move tabs to the bottom on mobile (standard Android pattern). Hide the desktop menu bar on mobile and expose Settings/Help via a compact header row instead. Replace fixed-width multi-column grids with dual desktop/mobile templates in History, Addresses and Contacts lists; adapt Send, Receive and the add-contact form for narrow screens. Remove hard-coded Width from all five overlays (560–640 px) in favour of MaxWidth + Margin="16" so they never overflow a 360 px screen; add ScrollViewer to Address info, Server settings and Settings overlays. Desktop layout is unchanged: all differences are gated on the IsMobile/IsDesktop bool, which is a platform constant (false on desktop). --- .../ViewModels/BoolToTabPlacementConverter.cs | 21 ++ src/App/ViewModels/MainWindowViewModel.cs | 2 + src/App/Views/MainView.axaml | 184 ++++++++++++++---- 3 files changed, 167 insertions(+), 40 deletions(-) create mode 100644 src/App/ViewModels/BoolToTabPlacementConverter.cs diff --git a/src/App/ViewModels/BoolToTabPlacementConverter.cs b/src/App/ViewModels/BoolToTabPlacementConverter.cs new file mode 100644 index 0000000..2d1daa4 --- /dev/null +++ b/src/App/ViewModels/BoolToTabPlacementConverter.cs @@ -0,0 +1,21 @@ +using System; +using System.Globalization; +using Avalonia.Controls; +using Avalonia.Data.Converters; + +namespace PalladiumWallet.App.ViewModels; + +/// +/// true (mobile) → Dock.Bottom — tab strip in basso, standard Android. +/// false (desktop) → Dock.Top — comportamento predefinito Avalonia. +/// +public sealed class BoolToTabPlacementConverter : IValueConverter +{ + public static readonly BoolToTabPlacementConverter Instance = new(); + + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) => + value is true ? Dock.Bottom : Dock.Top; + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => + throw new NotSupportedException(); +} diff --git a/src/App/ViewModels/MainWindowViewModel.cs b/src/App/ViewModels/MainWindowViewModel.cs index 17916fb..16cbc00 100644 --- a/src/App/ViewModels/MainWindowViewModel.cs +++ b/src/App/ViewModels/MainWindowViewModel.cs @@ -94,6 +94,8 @@ public partial class MainWindowViewModel : ViewModelBase /// true su desktop; false su Android/iOS — nasconde le funzioni legate al filesystem libero. public bool IsDesktop => !OperatingSystem.IsAndroid() && !OperatingSystem.IsIOS(); + public bool IsMobile => !IsDesktop; + public string UnitLabel => _config.Unit; public AppConfig CurrentConfig => _config; diff --git a/src/App/Views/MainView.axaml b/src/App/Views/MainView.axaml index e49e543..01daacf 100644 --- a/src/App/Views/MainView.axaml +++ b/src/App/Views/MainView.axaml @@ -15,7 +15,7 @@ - + + + +