Skip to content

Commit 25cc7ab

Browse files
committed
set window to adjustnothing
1 parent 2e4ad41 commit 25cc7ab

9 files changed

+72
-0
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
79
{
810
InitializeComponent();
911
UpdateCurrentSettingsLabel();
12+
13+
#if ANDROID
14+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
15+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
16+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
17+
#endif
1018
}
1119

1220
private void OnGridSetNoneClicked(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Border.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
1315
BottomPicker.SelectedIndex = 3; // All
1416

1517
UpdateSafeAreaSettings();
18+
19+
#if ANDROID
20+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
21+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
22+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
23+
#endif
1624
}
1725

1826
private void OnEdgePickerChanged(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentPage.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
79
{
810
InitializeComponent();
911
UpdateCurrentSettingsLabel();
12+
13+
#if ANDROID
14+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
15+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
16+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
17+
#endif
1018
}
1119

1220
private void OnGridSetNoneClicked(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ContentView.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
1315
BottomPicker.SelectedIndex = 3; // All
1416

1517
UpdateSafeAreaSettings();
18+
19+
#if ANDROID
20+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
21+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
22+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
23+
#endif
1624
}
1725

1826
private void OnEdgePickerChanged(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_FlyoutPage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
2022
}
2123
}
2224
};
25+
26+
#if ANDROID
27+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
28+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
29+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
30+
#endif
2331
}
2432
}

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_NavigationPage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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
68
public Issue28986_NavigationPage() : base(new Issue28986_ContentPage())
79
{
810
BarBackground = Colors.Blue;
11+
12+
#if ANDROID
13+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
14+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
15+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
16+
#endif
917
}
1018
}

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_SafeAreaBorderOrientation.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[Issue(IssueTracker.Github, 28986, "Test SafeArea per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 5)]
@@ -18,6 +20,12 @@ public Issue28986_SafeAreaBorderOrientation()
1820

1921
// Update dimensions when the page appears
2022
this.Appearing += OnPageAppearing;
23+
24+
#if ANDROID
25+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
26+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
27+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
28+
#endif
2129
}
2230

2331
private void OnPageAppearing(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_ScrollView.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
79
{
810
InitializeComponent();
911
UpdateCurrentSettingsLabel();
12+
13+
#if ANDROID
14+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
15+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
16+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
17+
#endif
1018
}
1119

1220
private void OnScrollViewSetNoneClicked(object sender, EventArgs e)

src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Android.Views;
2+
13
namespace Maui.Controls.Sample.Issues;
24

35
[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()
3335
}
3436
}
3537
});
38+
39+
#if ANDROID
40+
// Set SoftInput.AdjustNothing - we have full control over insets (iOS-like behavior)
41+
var window = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity?.Window;
42+
window?.SetSoftInputMode(SoftInput.AdjustNothing | SoftInput.StateUnspecified);
43+
#endif
3644
}
3745
}

0 commit comments

Comments
 (0)