Skip to content

[Android] Keyboard: Fix inset handling for Window SoftInput modes#33902

Open
NirmalKumarYuvaraj wants to merge 6 commits intodotnet:mainfrom
NirmalKumarYuvaraj:Keyboard_SafeArea_Temp
Open

[Android] Keyboard: Fix inset handling for Window SoftInput modes#33902
NirmalKumarYuvaraj wants to merge 6 commits intodotnet:mainfrom
NirmalKumarYuvaraj:Keyboard_SafeArea_Temp

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Feb 5, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

This pull request addresses issues with keyboard overlap and safe area handling on Android when using different SoftInput modes (AdjustResize and AdjustPan). It introduces new test cases, improves platform-specific logic for keyboard and safe area insets, and enhances the UI test infrastructure for more accurate validation of layout changes when the keyboard appears or disappears.

The most important changes are:

Android Keyboard and Safe Area Handling Improvements:

  • Refactored and enhanced the MauiWindowInsetListener to properly handle keyboard insets for AdjustResize and AdjustPan modes. This includes applying or resetting bottom padding on the CoordinatorLayout and its descendants based on the keyboard state and soft input mode, ensuring no double padding and correct layout restoration when the keyboard is shown or hidden. [1] [2] [3]
  • Removed redundant keyboard inset handling from SafeAreaExtensions.cs to centralize logic in MauiWindowInsetListener, preventing conflicts and ensuring consistent behavior.

Test Cases and Validation:

  • Added a new test page (Issue32041.xaml and code-behind) to verify that the keyboard does not overlap input fields when SoftInput.AdjustResize is set, and that the layout resizes appropriately. [1] [2]
  • Added a comprehensive UI test (Issue32041.cs) that measures and asserts the movement of UI elements when the keyboard appears/disappears, ensuring the fix works as intended.
  • Enhanced the existing AdjustPan test page and test (Issue32041AdjustPan.xaml, Issue32041AdjustPan.cs) with more precise automation IDs and improved assertions for layout and element visibility during keyboard transitions. [1] [2] [3] [4]

Test Infrastructure Enhancements:

  • Added a new helper method GetAndroidSystemBarInsets to UITest.Appium.HelperExtensions for accurate retrieval of status and navigation bar heights in Android UI tests, allowing for precise layout assertions.
  • Minor change to the visibility of GetSystemBars for internal use.

Dependency Updates:

  • Added missing using directive for AndroidX.CoordinatorLayout.Widget to support new logic.

These changes collectively ensure that the app's content is correctly resized or panned in response to the keyboard on Android, and that UI tests can reliably validate this behavior.

Issues Fixed

Fixes #32041

SoftInputMode API 30 API 36
AdjustNothing
AdjustNothing.mov
AdjustNothing.mov
AdjustResize
AdjustResize.mov
AdjustResize.mov
AdjustPan
AdjustPan.mov
AdjustPan.mov
TabbedPage + AdjustResize
API.30.mov
API.36.mov

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 5, 2026
@NirmalKumarYuvaraj NirmalKumarYuvaraj added platform/android area-safearea Issues/PRs that have to do with the SafeArea functionality community ✨ Community Contribution labels Feb 5, 2026
@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review February 6, 2026 04:18
Copilot AI review requested due to automatic review settings February 6, 2026 04:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses keyboard overlap and safe area handling issues on Android by refactoring how keyboard insets are managed for different WindowSoftInputModeAdjust modes (AdjustResize, AdjustPan, AdjustNothing). The fix centralizes keyboard inset handling in MauiWindowInsetListener by detecting the active SoftInputMode and applying appropriate padding to the CoordinatorLayout while managing child view padding to prevent double-padding issues.

Changes:

  • Refactored MauiWindowInsetListener to handle keyboard insets based on SoftInputMode, applying bottom padding for AdjustResize and consuming insets for AdjustPan to prevent layout conflicts
  • Removed redundant keyboard handling logic from SafeAreaExtensions.cs to centralize behavior in MauiWindowInsetListener
  • Added new helper method GetAndroidSystemBarInsets() to test infrastructure for accurate system bar measurement in UI tests
  • Created comprehensive UI test pages and tests for both AdjustResize and AdjustPan modes to validate keyboard behavior

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Core/src/Platform/Android/MauiWindowInsetListener.cs Added keyboard inset handling logic based on SoftInputMode; handles CoordinatorLayout padding and child view padding reset/restoration for AdjustResize and AdjustPan modes
src/Core/src/Platform/Android/SafeAreaExtensions.cs Removed redundant AdjustPan keyboard handling logic to consolidate in MauiWindowInsetListener
src/TestUtils/src/UITest.Appium/HelperExtensions.cs Added GetAndroidSystemBarInsets() helper method and changed GetSystemBars() to internal visibility
src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml Created test page for AdjustResize mode with visual markers to verify keyboard behavior
src/Controls/tests/TestCases.HostApp/Issues/Issue32041.xaml.cs Code-behind that sets SoftInput.AdjustResize mode for the test page
src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml Enhanced existing AdjustPan test page with additional AutomationIds for precise testing
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041.cs UI test validating AdjustResize behavior measures element movement when keyboard shows/hides
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041AdjustPan.cs Enhanced UI test for AdjustPan mode with improved assertions for layout and visibility

@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@rmarinho
Copy link
Member

rmarinho commented Feb 7, 2026

🤖 AI Summary

📊 Expand Full Review
🔍 Pre-Flight — Context & Validation
📝 Review Sessioncommitted the suggestion · 7cc6729

Issue: #32041 - net 10 rc2 keyboard overlap android
PR: #33902 - [Android] Keyboard: Fix inset handling for Window SoftInput modes
Author: NirmalKumarYuvaraj (community ✨, partner/syncfusion)
Platforms Affected: Android only
Labels: platform/android, area-safearea, community ✨, partner/syncfusion
Milestone: .NET 10 SR5

Issue Summary

On Android in .NET 10 RC2, when SoftInput.AdjustResize is set, the keyboard overlaps entries at the bottom of the screen. This is a regression from .NET 9 where it worked correctly. Root cause: PR #31798 called WindowCompat.SetDecorFitsSystemWindows(Window, false) in MauiAppCompatActivity.OnCreate(), which disabled the default SoftInput.AdjustResize behavior, requiring manual handling of all window insets.

Files Changed (11 files, +683/-125)

Fix files:

  • src/Core/src/Platform/Android/MauiWindowInsetListener.cs (+171/-18) - Core fix: centralized keyboard inset handling for AdjustResize/AdjustPan/AdjustNothing modes
  • src/Core/src/Platform/Android/SafeAreaExtensions.cs (+0/-16) - Removed redundant keyboard handling (centralized to above)
  • src/TestUtils/src/UITest.Appium/HelperExtensions.cs (+39/-1) - Added GetAndroidSystemBarInsets() helper

Test files:

  • src/Controls/tests/TestCases.HostApp/Issues/Issue32041.cs - New: AdjustResize test page (C# only)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.cs - New: AdjustPan test page (C# only, replaces .xaml)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml - DELETED (replaced with .cs)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue32041AdjustPan.xaml.cs - DELETED
  • src/Controls/tests/TestCases.HostApp/Issues/Issue32041TabbedPage.cs - New: TabbedPage test page
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041.cs - New: AdjustResize UI test
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041AdjustPan.cs - Modified: AdjustPan UI test
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041TabbedPage.cs - New: TabbedPage UI test

Test Type: UI Tests (Appium/Android)

Key Architectural Change

Before: Keyboard insets handled in both SafeAreaExtensions.cs (per-view) and MauiWindowInsetListener.cs (window-level), causing conflicts.
After: All keyboard inset handling centralized in MauiWindowInsetListener with mode-specific logic:

  • AdjustResize: Applies bottom padding to CoordinatorLayout or contentView, resets child bottom padding to avoid double-padding
  • AdjustPan: Consumes IME insets (lets Android system pan the window)
  • AdjustNothing: Returns insets unconsumed

Prior Review Notes

A prior agent review session ran Gate on commit 7cc6729 (current HEAD) and found Gate FAILED:

  • VerifyContainerDoesNotResizeWithAdjustPan - PASS
  • VerifyTabbedPageWithKeyboard - PASS
  • VerifyContainerResizesWithAdjustResize - FAIL (TimeoutException/NullReferenceException)

PureWeen's CI feedback also confirmed the same failure. The suggested fix (add WaitForElement before GetRect()) appears to have been applied (line 40 of current Issue32041.cs in SharedTests).

Reviewer Discussion Summary

  • Copilot PR reviewer comments (all marked resolved/outdated):
    • #if ANDROID directives were commented out (since fixed - now active in current file)
    • Misleading comment on keyboard handling logic
    • SoftInput.MaskAdjust suggestion (applied)
    • Missing space in comment //Keyboard Handling
    • Early return suggestion for AdjustResize dismiss path

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33902 Centralize keyboard inset handling in MauiWindowInsetListener; mode-specific logic for AdjustResize/AdjustPan/AdjustNothing; remove redundant SafeAreaExtensions code ⏳ PENDING (Gate) MauiWindowInsetListener.cs, SafeAreaExtensions.cs, + test files Original PR; prior Gate FAILED on same commit

🚦 Gate — Test Verification
📝 Review Sessioncommitted the suggestion · 7cc6729

Result: ❌ FAILED
Platform: android
Mode: Full Verification

Test Results

WITHOUT fix (base branch):

  • Tests compilation FAILED (expected) ✅
  • GetAndroidSystemBarInsets extension method not found (defined in HelperExtensions.cs which is part of the fix)
  • Conclusion: Tests correctly detect the bug ✅

WITH fix (PR branch):

  • Tests compiled successfully
  • 2/3 tests PASSED ✅
  • 1/3 tests FAILED ❌
Test Result Duration
VerifyContainerResizesWithAdjustResize ❌ FAIL 17s (timeout)
VerifyContainerDoesNotResizeWithAdjustPan ✅ PASS 3s
VerifyTabbedPageWithKeyboard ✅ PASS 3s

Failing Error:

System.TimeoutException: Timed out waiting for element 'BottomMarker'
at VerifyContainerResizesWithAdjustResize

The BottomMarker element becomes inaccessible after the keyboard appears, suggesting the container is NOT resizing properly with AdjustResize mode - the core fix may not be working.

Gate Status: ❌ FAILED - PR fix doesn't fully resolve the issue


📋 Report — Final Recommendation
📝 Review Sessioncommitted the suggestion · 7cc6729

⚠️ Final Recommendation: REQUEST CHANGES

Summary

PR #33902 adds Android keyboard/safe area handling for SoftInput.AdjustResize and AdjustPan modes. The PR includes new UI tests that correctly detect the bug. However, Gate verification failed: VerifyContainerResizesWithAdjustResize consistently times out after the keyboard appears, confirming that the core AdjustResize fix is incomplete.

The PR was previously reviewed by another agent (commit 7cc6729) with the same Gate failure result. The fix was confirmed broken by PureWeen's CI feedback as well.


Root Cause of Issue #32041

PR #31798 called WindowCompat.SetDecorFitsSystemWindows(Window, false), which disabled Android's built-in AdjustResize window resizing behavior. The framework now must manually apply insets to keep content above the keyboard. This PR attempts to centralize that logic in MauiWindowInsetListener.


What Works

  • VerifyContainerDoesNotResizeWithAdjustPan — PASS (AdjustPan handling is correct)
  • VerifyTabbedPageWithKeyboard — PASS (TabbedPage with bottom navigation PASS because it uses contentView.SetPadding())
  • ✅ Test architecture is correct — tests detect the bug when fix is reverted
  • ✅ SafeAreaExtensions keyboard handling removed (deduplication is correct)
  • GetAndroidSystemBarInsets() helper is a useful addition

What Doesn't Work

  • VerifyContainerResizesWithAdjustResize — FAIL (17s timeout waiting for BottomMarker after keyboard shows)

Root cause of test failure:
When there's no bottom navigation (!hasBottomNav), the fix applies coordinatorLayout.SetPadding(0, 0, 0, bottomInset). However, CoordinatorLayout's children (specifically navigationlayout_content) may not resize in response to CoordinatorLayout's own padding, because CoordinatorLayout's child behaviors can override normal padding layout semantics. By contrast, the TabbedPage case sets contentView.SetPadding() directly, which DOES work.

Suggested fix:
Apply the keyboard inset padding to contentView in BOTH the TabbedPage and non-TabbedPage cases, rather than to coordinatorLayout:

// Current (failing for non-TabbedPage):
if (hasBottomNav)
{
    contentView.SetPadding(contentView.PaddingLeft, contentView.PaddingTop, contentView.PaddingRight, bottomInset);
}
else
{
    coordinatorLayout.SetPadding(0, 0, 0, bottomInset);  // ← may not work
}

// Suggested:
contentView.SetPadding(contentView.PaddingLeft, contentView.PaddingTop, contentView.PaddingRight, bottomInset);

Code Quality Issues

🔴 Critical

  1. Debug statement left in production code (MauiWindowInsetListener.cs:389):

    System.Diagnostics.Debug.WriteLine("[SafeAreaKeyboard] No bottom navigation, resetting bottomTabContainer padding");

    This must be removed before merge.

  2. AdjustPan test has incorrect assertion (Issue32041AdjustPan.cs:37):

    Assert.That(App.FindElement("TopLabelPan"), Is.Null, "Top label should move up...So it will not be accessible");

    FindElement returns the element or throws — it will never return null. This assertion will always fail or throw.

🟡 Medium

  1. Commented-out code blocks left in (MauiWindowInsetListener.cs:342-344, 356-361):

    //RequestInsetsForDescendants(contentView);  // commented-out
    // coordinatorLayout.Post(() => ...);        // commented-out debug block
    //System.Diagnostics.Debug.WriteLine(...)   // commented-out log

    Clean up before merge.

  2. ResetBottomPaddingForDescendants is public but should be internalResetBottomPaddingForDescendants and RequestInsetsForDescendants are public methods but should be internal (or private) since they're implementation details of the listener.

  3. No early return after AdjustResize dismiss path (line 363 comment: "Don't return early"):
    When keyboard dismisses (!isKeyboardShowing && _wasKeyboardShowing), execution falls through to the bottom navigation handling section. This is noted in a comment but should have explicit documentation for why this is intentional.


Phase 3 (try-fix)

Skipped — Gate is a prerequisite for Phase 3. The fix is known to be broken (validated by both this agent session and prior CI results), so exploring alternative fixes is appropriate but requires Gate to first pass.


Title & Description Assessment

Title: ✅ Good — [Android] Keyboard: Fix inset handling for Window SoftInput modes is accurate and searchable.

Description: ⚠️ Needs update — The NOTE block (required for community testing) is missing from the top of the description. The body content is otherwise detailed and accurate. Add at the top:

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you!

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33902 Centralize keyboard insets in MauiWindowInsetListener; apply bottom padding to coordinatorLayout (no-nav case) or contentView (tabbed case) ❌ FAIL (Gate) MauiWindowInsetListener.cs, SafeAreaExtensions.cs + tests VerifyContainerResizesWithAdjustResize times out

📋 Expand PR Finalization Review
Title: ✅ Good

Current: [Android] Keyboard: Fix inset handling for Window SoftInput modes

Description: ✅ Good

Description needs updates. See details below.

✨ Suggested PR Description

[!NOTE]
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

On Android, MauiWindowInsetListener.ApplyDefaultWindowInsets had no awareness of the current SoftInput mode when handling keyboard insets. As a result:

  • AdjustResize: The keyboard appeared but no bottom padding was applied to push content above it — content was covered by the keyboard.
  • AdjustPan: The AdjustPan special-case existed in SafeAreaExtensions.cs rather than the inset listener, creating split logic and edge cases.
  • AdjustNothing: Insets were still processed when they should be ignored.

Description of Change

MauiWindowInsetListener.cs — centralized keyboard inset handling:

  • Changed ApplyDefaultWindowInsets from static to instance method to allow per-listener state tracking.
  • Added _wasKeyboardShowing field to detect keyboard open→close transitions and avoid re-entrant layout loops.
  • Added a CoordinatorLayout-specific branch that reads Window.Attributes.SoftInputMode and dispatches to mode-specific logic:
    • AdjustResize: On keyboard show, applies imeInsets.Bottom as padding to either contentView (bottom tab layout) or the CoordinatorLayout itself; resets stale bottom padding on tracked child views to prevent double-padding. On keyboard dismiss, resets padding and requests insets re-application for descendants so safe area is restored.
    • AdjustPan: Consumes insets on keyboard show — no padding applied; the system handles panning.
    • AdjustNothing: Returns insets unchanged.
  • Added ResetBottomPaddingForDescendants(AView) — resets bottom padding of all tracked child views when keyboard appears (AdjustResize).
  • Added RequestInsetsForDescendants(AView) — requests inset re-application for all tracked child views when keyboard dismisses.

SafeAreaExtensions.cs — removed split logic:

  • Removed the AdjustPan special-case that was previously in SafeAreaExtensions. This logic is now handled centrally in MauiWindowInsetListener.

HelperExtensions.cs — test infrastructure:

  • Changed GetSystemBars from public to internal (raw Appium dictionary output is not a stable public API).
  • Added new GetAndroidSystemBarInsets(this IApp app) public extension returning (int StatusBarHeight, int NavigationBarHeight) — a typed wrapper used in UI tests for layout assertions.

New & Updated Tests

  • Issue32041.cs (HostApp + test): New C# test page for AdjustResize. Measures BottomMarker Y-position before and after keyboard show/hide to assert content resizes (not overlaps).
  • Issue32041AdjustPan.cs (HostApp): Rewrote from XAML/code-behind to a single C# file. Test assertions updated to check bottom marker position changes on keyboard show/hide.
  • Issue32041TabbedPage.cs (HostApp + test): New test page for TabbedPage with bottom tabs + AdjustResize. Verifies content resizes correctly without covering bottom tabs.

Issues Fixed

Fixes #32041

SoftInputMode API 30 API 36
AdjustNothing
AdjustResize
AdjustPan
TabbedPage + AdjustResize
Code Review: ⚠️ Issues Found

Code Review — PR #33902

[Android] Keyboard: Fix inset handling for Window SoftInput modes


🔴 Critical Issues

1. Debug WriteLine Left in Production Code Path

File: src/Core/src/Platform/Android/MauiWindowInsetListener.cs

else
{
    System.Diagnostics.Debug.WriteLine("[SafeAreaKeyboard] No bottom navigation, resetting bottomTabContainer padding");
    // No bottom navigation - reset bottomTabContainer padding (original behavior)
    bottomTabContainer?.SetPadding(0, 0, 0, 0);
}

Problem: System.Diagnostics.Debug.WriteLine is called in the main inset dispatch path (ApplyDefaultWindowInsets) which fires on every window inset change — including every scroll, orientation change, and keyboard show/hide. This will spam the debug output in every app using MAUI on Android.

Recommendation: Remove the Debug.WriteLine line entirely. Comments are sufficient.


🟡 Suggestions

2. Substantial Commented-Out Code Should Be Removed

File: src/Core/src/Platform/Android/MauiWindowInsetListener.cs

There are multiple blocks of commented-out code that should not be merged:

// Keyboard dismissed - reset padding
_wasKeyboardShowing = false;
if (hasBottomNav)
{
    //RequestInsetsForDescendants(contentView);  // ← dead, commented out
}
else
{
    ...
}

// coordinatorLayout.Post(() =>               // ← large commented-out block
// {
//     Debug.WriteLine("[SafeAreaKeyboard] Executing posted RequestInsetsForDescendants");
//     RequestInsetsForDescendants(coordinatorLayout);
// });
//System.Diagnostics.Debug.WriteLine("[SafeAreaKeyboard] Requesting insets for coordinatorLayout descendants");

Problem: The hasBottomNav branch of the keyboard-dismiss handler is a no-op (empty comment). This means when the keyboard dismisses on a TabbedPage layout, insets are not re-requested for the content area. This may leave the layout with stale padding. Either implement it or document that it's intentionally left for a follow-up.

Recommendation:

  • Remove all commented-out code
  • Either implement RequestInsetsForDescendants(contentView) for the hasBottomNav dismiss case, or add a // TODO: comment with an issue number

3. Fragile AdjustPan Test Assertion

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041AdjustPan.cs

Assert.That(App.FindElement("TopLabelPan"), Is.Null,
    "Top label should move up when keyboard appears with AdjustPan, So it will not be accessible");

Problem: This asserts that TopLabelPan is completely inaccessible (null) after the keyboard appears with AdjustPan. This is highly device/resolution-dependent — the top label may or may not be panned off-screen depending on:

  • Device screen size
  • Keyboard height
  • Content layout

On large devices or when the keyboard is small, TopLabelPan may still be accessible, causing a false failure.

Recommendation: Instead of asserting the element is null (off-screen), assert that the bottom marker's Y position changed relative to the screen (which is what AdjustPan does — it shifts the window). Something like:

var topMarkerAfter = App.FindElement("TopLabelPan")?.GetRect();
// AdjustPan pans the view - positions shift
Assert.That(topMarkerAfter?.Top, Is.LessThan(initialTop),
    "Top label should shift upward when keyboard appears with AdjustPan");

4. Missing Newline at End of File

Files:

  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041.cs
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32041TabbedPage.cs
  • src/TestUtils/src/UITest.Appium/HelperExtensions.cs

All three files are missing a trailing newline (\ No newline at end of file in the diff).

Recommendation: Add a newline at the end of each file. This is a POSIX convention and avoids noisy diffs in future edits.


✅ Looks Good

Core Architecture Decision

Centralizing SoftInput mode detection in MauiWindowInsetListener.ApplyDefaultWindowInsets (rather than in SafeAreaExtensions) is the right approach. The inset listener has access to the CoordinatorLayout and its child views, making it the correct place to orchestrate keyboard-driven padding changes.

Removal from SafeAreaExtensions

Removing the AdjustPan special-case from SafeAreaExtensions.cs is correct — having keyboard mode logic in two places was the root of the inconsistency.

State Tracking with _wasKeyboardShowing

Using _wasKeyboardShowing to gate the keyboard-show and keyboard-hide transitions (rather than responding to every inset dispatch) is correct and prevents layout thrashing.

ResetBottomPaddingForDescendants / RequestInsetsForDescendants

The two new helper methods are well-scoped: they operate on tracked views (from the registry), not on the full view tree. This is consistent with the existing tracking pattern and avoids traversing unmapped views.

GetSystemBarsinternal

Making GetSystemBars internal is appropriate since it returns raw Appium driver dictionary output that isn't suitable as a stable public API. The new GetAndroidSystemBarInsets with a typed (int, int) tuple return is a cleaner public surface.

Test Infrastructure

GetAndroidSystemBarInsets correctly wraps GetSystemBars and provides a typed, convenient API for UI tests that need to account for system bar heights in layout assertions.


@PureWeen
Copy link
Member

PureWeen commented Feb 9, 2026

/rebase

@github-actions github-actions bot force-pushed the Keyboard_SafeArea_Temp branch from 3b29a8a to 697d237 Compare February 9, 2026 22:45
@PureWeen
Copy link
Member

🤖 CI Test Feedback

We ran the Issue32041 tests on an Android API 30 emulator (matching the standard maui-pr UI test pipeline) and got the following results:

Test Result Details
VerifyContainerDoesNotResizeWithAdjustPan ✅ Pass
VerifyTabbedPageWithKeyboard ✅ Pass
VerifyContainerResizesWithAdjustResize ❌ Fail NullReferenceException in HelperExtensions.GetRect()

The failing test hits a NullReferenceException at Issue32041.cs:line 40 — the element cannot be found after the keyboard appears, likely because the layout has not settled yet.

Suggestion: Add App.WaitForElement() before calling GetRect() on elements accessed after keyboard show/hide transitions. For example:

// Before
var rect = App.FindElement("BottomMarker").GetRect();

// After  
App.WaitForElement("BottomMarker");
var rect = App.FindElement("BottomMarker").GetRect();

This is a common Appium timing issue on emulators where layout changes from keyboard transitions may not be immediately reflected.

@NirmalKumarYuvaraj NirmalKumarYuvaraj changed the title [Android] Fixed WindowSoftInputMode + Keyboard related issues [Android] Keyboard: Fix inset handling for Window SoftInput modes Feb 10, 2026
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@rmarinho rmarinho added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed Tests didn't prove the fix: either no tests exist, tests pass both ways, or tests fail both ways. s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Feb 18, 2026
@PureWeen PureWeen modified the milestone: .NET 10 SR5 Feb 23, 2026
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Feb 23, 2026
@PureWeen
Copy link
Member

/rebase

@github-actions github-actions bot force-pushed the Keyboard_SafeArea_Temp branch from 7cc6729 to 1541141 Compare February 23, 2026 14:42
@kubaflo kubaflo removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed Tests didn't prove the fix: either no tests exist, tests pass both ways, or tests fail both ways. labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-safearea Issues/PRs that have to do with the SafeArea functionality community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

Status: Ready To Review

Development

Successfully merging this pull request may close these issues.

net 10 rc2 keyboard overlap android

6 participants