Skip to content
Closed
10 changes: 10 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue28986.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

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)]
Expand All @@ -7,6 +11,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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28986, "Test SafeArea Border for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 1)]
Expand All @@ -13,6 +17,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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28986, "Test SafeArea ContentPage for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 2)]
Expand All @@ -7,6 +11,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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28986, "Test SafeArea ContentView for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 3)]
Expand All @@ -13,6 +17,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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

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)]
Expand All @@ -20,5 +24,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
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

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)]
Expand All @@ -6,5 +10,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
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28986, "Test SafeArea per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 5)]
Expand All @@ -18,6 +22,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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 28986, "Test SafeArea ScrollView for per-edge safe area control", PlatformAffected.Android | PlatformAffected.iOS, issueTestNumber: 4)]
Expand All @@ -7,6 +11,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)
Expand Down
10 changes: 10 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue28986_Shell.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if ANDROID
using Android.Views;
#endif

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)]
Expand Down Expand Up @@ -33,5 +37,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
}
}
49 changes: 49 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue32041"
Title="Issue 32041">

<!-- Full-height container with distinct visual marker at bottom -->
<!-- We'll measure the bottom marker's position to verify content moves up when keyboard appears -->
<Grid x:Name="MainContainer"
AutomationId="MainContainer"
BackgroundColor="LightBlue"
RowDefinitions="*,Auto">

<!-- Filler content to ensure container fills screen -->
<VerticalStackLayout Grid.Row="0" Padding="20" Spacing="10">
<Label
Text="Test keyboard overlap with SoftInput.AdjustResize"
FontSize="18"
FontAttributes="Bold"/>

<Label
Text="With AdjustResize, bottom padding is applied when keyboard appears. The bottom marker should move up to stay visible above the keyboard."
FontSize="14"
TextColor="DarkSlateGray"/>
</VerticalStackLayout>

<!-- Bottom marker - this should move up to stay visible above keyboard -->
<!-- We test by measuring the marker's Y position before and after keyboard appears -->
<Border Grid.Row="1"
AutomationId="BottomMarker"
BackgroundColor="Red"
HeightRequest="60"
Margin="0">
<VerticalStackLayout Spacing="5" HorizontalOptions="Center" VerticalOptions="Center">
<Label
Text="BOTTOM MARKER"
FontSize="12"
FontAttributes="Bold"
TextColor="White"
HorizontalOptions="Center"/>
<Entry
Placeholder="Tap here to show keyboard"
AutomationId="TestEntry"
BackgroundColor="White"
WidthRequest="250"/>
</VerticalStackLayout>
</Border>
</Grid>
</ContentPage>
21 changes: 21 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#if ANDROID
using Android.Views;
#endif

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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue32041AdjustPan"
Title="Issue 32041 AdjustPan">

<!-- Full-height container to test AdjustPan behavior -->
<!-- With AdjustPan, container height should NOT change (window pans instead) -->
<Grid x:Name="MainContainerPan"
AutomationId="MainContainerPan"
BackgroundColor="LightYellow"
RowDefinitions="*,Auto">

<VerticalStackLayout Grid.Row="0" Padding="20" Spacing="10">
<Label
Text="Test keyboard with SoftInput.AdjustPan"
FontSize="18"
FontAttributes="Bold"/>

<Label
Text="With AdjustPan, the container height should NOT change when keyboard appears. The window pans (moves) instead of resizing."
FontSize="14"
TextColor="DarkGreen"/>
</VerticalStackLayout>

<!-- Bottom marker -->
<Border Grid.Row="1"
AutomationId="BottomMarkerPan"
BackgroundColor="Green"
HeightRequest="60"
Margin="0">
<VerticalStackLayout Spacing="5" HorizontalOptions="Center" VerticalOptions="Center">
<Label
Text="BOTTOM MARKER (PAN)"
FontSize="12"
FontAttributes="Bold"
TextColor="White"
HorizontalOptions="Center"/>
<Entry
Placeholder="Tap here to show keyboard"
AutomationId="TestEntryPan"
BackgroundColor="White"
WidthRequest="250"/>
</VerticalStackLayout>
</Border>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#if ANDROID
using Android.Views;
#endif

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
}
}
Loading