From 75b9414f70e526fd4978871cace8393e286c782d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:43:00 +0000 Subject: [PATCH 01/10] Initial plan From 2db475427e76f39107b74f3c5c553d8a74394369 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Mon, 10 Nov 2025 14:26:13 -0600 Subject: [PATCH 02/10] - fix AdjustPan calculations # Conflicts: # src/Core/src/Platform/Android/SafeAreaExtensions.cs --- .../Issues/Issue28986.xaml.cs | 8 ++ .../Issues/Issue28986_Border.xaml.cs | 8 ++ .../Issues/Issue28986_ContentPage.xaml.cs | 8 ++ .../Issues/Issue28986_ContentView.xaml.cs | 8 ++ .../Issues/Issue28986_FlyoutPage.cs | 8 ++ .../Issues/Issue28986_NavigationPage.cs | 8 ++ ...sue28986_SafeAreaBorderOrientation.xaml.cs | 8 ++ .../Issues/Issue28986_ScrollView.xaml.cs | 8 ++ .../Issues/Issue28986_Shell.cs | 8 ++ .../TestCases.HostApp/Issues/Issue32041.xaml | 49 ++++++++++ .../Issues/Issue32041.xaml.cs | 19 ++++ .../Issues/Issue32041AdjustPan.xaml | 47 +++++++++ .../Issues/Issue32041AdjustPan.xaml.cs | 19 ++++ .../Issues/Issue32041FlyoutPage.xaml | 79 +++++++++++++++ .../Issues/Issue32041FlyoutPage.xaml.cs | 23 +++++ .../Issues/Issue32041Shell.xaml | 91 +++++++++++++++++ .../Issues/Issue32041Shell.xaml.cs | 18 ++++ .../Issues/Issue32041TabbedPage.xaml | 63 ++++++++++++ .../Issues/Issue32041TabbedPage.xaml.cs | 18 ++++ .../Tests/Issues/Issue32041.cs | 97 +++++++++++++++++++ .../Tests/Issues/Issue32041FlyoutPage.cs | 53 ++++++++++ .../Tests/Issues/Issue32041Shell.cs | 53 ++++++++++ .../Tests/Issues/Issue32041TabbedPage.cs | 53 ++++++++++ .../Platform/Android/SafeAreaExtensions.cs | 90 ++++++++++++----- 24 files changed, 818 insertions(+), 26 deletions(-) create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml.cs create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041FlyoutPage.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041FlyoutPage.xaml.cs create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041Shell.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041Shell.xaml.cs create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041TabbedPage.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue32041TabbedPage.xaml.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041FlyoutPage.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041Shell.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041TabbedPage.cs diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs index bf066c9cc951..0ddfa08edf82 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea attached property for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 0)] @@ -7,6 +9,12 @@ public Issue28986() { InitializeComponent(); UpdateCurrentSettingsLabel(); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnGridSetNoneClicked(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Border.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Border.xaml.cs index f3586378ccaf..780a77f62884 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Border.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Border.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea Border for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 1)] @@ -13,6 +15,12 @@ public Issue28986_Border() BottomPicker.SelectedIndex = 3; // All UpdateSafeAreaSettings(); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnEdgePickerChanged(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentPage.xaml.cs index f7c7ada8bdfd..b30b36dc99b5 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentPage.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentPage.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea ContentPage for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 2)] @@ -7,6 +9,12 @@ public Issue28986_ContentPage() { InitializeComponent(); UpdateCurrentSettingsLabel(); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnGridSetNoneClicked(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentView.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentView.xaml.cs index 6eeed5888845..691ab4da19a8 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentView.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentView.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea ContentView for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 3)] @@ -13,6 +15,12 @@ public Issue28986_ContentView() BottomPicker.SelectedIndex = 3; // All UpdateSafeAreaSettings(); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnEdgePickerChanged(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_FlyoutPage.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_FlyoutPage.cs index edc5f7e155f0..893766dc2ef0 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_FlyoutPage.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_FlyoutPage.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea Flyout Page for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 8)] @@ -20,5 +22,11 @@ public Issue28986_FlyoutPage() : base() } } }; + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_NavigationPage.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_NavigationPage.cs index 2098bacfe588..693e7505b982 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_NavigationPage.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_NavigationPage.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea Navigation Page for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 7)] @@ -6,5 +8,11 @@ public partial class Issue28986_NavigationPage : NavigationPage public Issue28986_NavigationPage() : base(new Issue28986_ContentPage()) { BarBackground = Colors.Blue; + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_SafeAreaBorderOrientation.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_SafeAreaBorderOrientation.xaml.cs index c594d656e000..a953bbbfede3 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_SafeAreaBorderOrientation.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_SafeAreaBorderOrientation.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 5)] @@ -18,6 +20,12 @@ public Issue28986_SafeAreaBorderOrientation() // Update dimensions when the page appears this.Appearing += OnPageAppearing; + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnPageAppearing(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ScrollView.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ScrollView.xaml.cs index 42efd57f46b6..4ed0a8d5afca 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ScrollView.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ScrollView.xaml.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea ScrollView for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 4)] @@ -7,6 +9,12 @@ public Issue28986_ScrollView() { InitializeComponent(); UpdateCurrentSettingsLabel(); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } private void OnScrollViewSetNoneClicked(object sender, EventArgs e) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs index 33500e051962..49466a61d829 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs @@ -1,3 +1,5 @@ +using Android.Views; + namespace Maui.Controls.Sample.Issues; [Issue(IssueTracker.Github, 28986, "Test SafeArea Shell Page for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 6)] @@ -33,5 +35,11 @@ public Issue28986_Shell() : base() } } }); + +#if ANDROID + // Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior) + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified); +#endif } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml new file mode 100644 index 000000000000..0744a2ef9099 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs new file mode 100644 index 000000000000..a3d4631daae3 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs @@ -0,0 +1,19 @@ +using Android.Views; + +namespace Maui.Controls.Sample.Issues; + +[Issue(IssueTracker.Github, 32041, "Keyboard overlaps Entry when SoftInput.AdjustResize is set", PlatformAffected.Android)] +public partial class Issue32041 : ContentPage +{ + public Issue32041() + { + InitializeComponent(); + +#if ANDROID + // Set SoftInput.AdjustResize to simulate the user's scenario + // This should cause the content to be resized (not overlapped) when the keyboard appears + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustResize | SoftInput.StateUnspecified); +#endif + } +} diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml new file mode 100644 index 000000000000..3af1bd213099 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml.cs new file mode 100644 index 000000000000..3f84c3dc897e --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml.cs @@ -0,0 +1,19 @@ +using Android.Views; + +namespace Maui.Controls.Sample.Issues; + +[Issue(IssueTracker.Github, 32041, "Verify AdjustPan mode does not apply keyboard insets", PlatformAffected.Android, issueTestNumber: 2)] +public partial class Issue32041AdjustPan : ContentPage +{ + public Issue32041AdjustPan() + { + InitializeComponent(); + +#if ANDROID + // Set SoftInput.AdjustPan - this should NOT apply insets + // The window should pan instead + var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window; + window?.SetSoftInputMode(SoftInput.AdjustPan | SoftInput.StateUnspecified); +#endif + } +} diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue32041FlyoutPage.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041FlyoutPage.xaml new file mode 100644 index 000000000000..a9cb78c76a4e --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue32041FlyoutPage.xaml @@ -0,0 +1,79 @@ + + + + + + + +