Skip to content

[Android] Fix Material 3 status bar icon contrast - #37710

Merged
kubaflo merged 14 commits into
inflight/currentfrom
jfversluis-fix-material3-status-bar
Aug 21, 2026
Merged

kubaflo merged 14 commits into
inflight/currentfrom
jfversluis-fix-material3-status-bar

Conversation

@jfversluis

Copy link
Copy Markdown
Member

Description

Fixes #37705.

ConfigureTranslucentSystemBars started deriving Android status bar icon appearance from colorPrimary in 10.0.100. That remains correct for the Material 2 app bar and preserves the fix for #32987, but Material 3 draws colorSurface behind its transparent edge-to-edge status bar. Material 3's primary and surface colors intentionally have opposite luminance in both day and night themes, which inverted the status bar icons.

This change uses:

  • colorSurface for Material 3
  • colorPrimary for Material 2
  • the existing day/night fallback when the theme color cannot be resolved

It also adds Android device coverage using the real MAUI Material 3 light/dark resources and the Material 2 primary-color path.

Runtime verification

Reproduced with the default .NET 10 MAUI template, Microsoft.Maui.Controls 10.0.100, and <UseMaterial3>true</UseMaterial3> on an Android API 36 emulator. The same app was then rebuilt against this branch's local Microsoft.Maui project.

Theme 10.0.100 This PR
Light 10.0.100 light mode with unreadable white status bar icons Fixed light mode with readable dark status bar icons
Dark 10.0.100 dark mode with unreadable black status bar icons Fixed dark mode with readable white status bar icons

Validation

  • Android Core device-test project builds with 0 warnings and 0 errors.
  • All three new regression cases pass on an API 36 emulator:
    • Material 3 light surface uses dark icons.
    • Material 3 dark surface uses light icons.
    • Material 2 continues deriving icon contrast from colorPrimary.
  • Full device run: 3,031 tests executed; the new tests passed. One unrelated existing Switch pixel-color test failed consistently in both light and dark emulator modes.
  • The implementation and test strategy were challenged by three independent models and received a final independent code review with no findings.

@kamano1, when the PR artifacts become available, please try them with your app and let us know whether they resolve the issue on your Android 15/17 devices.

Ahamed-Ali and others added 13 commits August 13, 2026 23:08
### Description of Change
This pull request makes a minor update to the UI test pipeline
configuration

- Pipeline configuration simplification:
* Removed the **duplicate** code that set the `$deviceType` variable and
appended the `--skin` argument to the test command in
`eng/pipelines/common/ui-tests-steps.yml`.


The same code was already added at [line
133](https://github.com/dotnet/maui/blob/main/eng/pipelines/common/ui-tests-steps.yml#L133)
as part of [PR #33409](#33409).

The duplicate code was also added at [line
156](https://github.com/dotnet/maui/blob/main/eng/pipelines/common/ui-tests-steps.yml#L156)
as part of [PR #31631](#31631).
<!-- 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!

### Description of Change

This follow-up repairs the skill-evaluation failures exposed by #36799
and hardens the credentialed Vally evaluator so skill regressions,
infrastructure failures, incomplete trials, parser differences, and
reporting-side failures are classified accurately.

### Root Causes

- `try-fix-capabilities` could exceed its numeric threshold while
remaining red because Vally independently hard-fails execution errors
and incomplete trials. Aggregate score never overrides those vetoes.
- `pr-review-gh-auth` routed correctly, but its isolated fixture omitted
the phase-specific unauthenticated public-GitHub fallback required by
the grader.
- Later failures exposed evaluator defects rather than skill
regressions: PAT authentication did not prove model entitlement, model
discovery did not initially match Vally 0.12's effective execution plan,
matrix-only token offsets removed run-level rotation entropy, and
parallel legs amplified shared PAT contention.
- Run `31518503277` restored the synthetic target correctly, but one
agent deleted Vally's pre-existing untracked `try-fix/` input to force
an empty `git status`; Vally correctly treated that deletion as
workspace drift.
- Run `31524806025` completed every evaluation successfully, but a
transient GitHub API fetch failure occurred before the comment step
exported its already-computed verdict, making reporting red despite
green suites.
- Review found parser-semantic splits between Psych and Vally's pinned
`yaml@2.9.0`: duplicate keys could be first-wins in AST policy checks
but last-wins at runtime, while YAML merge keys/tags were interpreted
differently and could hide executable evaluator fields from trusted
validation.

### Changes

- Replaced unreliable operational probes with bounded fixtures while
preserving repeated trials, behavioral rubrics, strict thresholds, and
hard-veto semantics.
- Added the unauthenticated GitHub fallback fixture and deterministic
skill-invocation/tool-call graders.
- Upgraded to Vally 0.12 and made aggregation fail closed on execution
errors, incomplete/skipped stimuli, malformed output, invocation
failures, and missing mandatory coverage.
- Added trusted fixture preparation plus path, symlink, Git,
environment, executable, attachment, hook, settings, MCP, executor, and
repository-control isolation.
- Serialized matrix legs while retaining three trials per stimulus.
- Made model discovery use only executed `eval*.vally.yaml` specs and
Vally 0.12's effective executor and prompt-grader fields; implicit
prompt-grader fallbacks are rejected.
- Added model-aware PAT selection with run/rerun/matrix-distributed
rotation and exact sentinel probes through the pinned evaluator runtime;
reused it in the advisory soak.
- Clarified that `try-fix` must preserve every pre-existing untracked
path, including evaluator-loaded skill inputs. Trusted validation
enforces both the skill contract and restoration fixture instruction
while retaining `diff-empty` as the method-independent veto.
- Exported the authoritative evaluation verdict before PR-comment API
calls, added bounded API retries, and made comment publication advisory
so transient GitHub failures cannot erase or invert the commit status.
- Reduced soak workflow permissions to `contents: read` and made `/user`
transport failures explicit without exposing PATs.
- Made required-stimulus policy fail closed when a configured stimulus
is renamed or removed, and bound each fixture marker/ref to the YAML
stimulus that owns it so a correctly named decoy cannot satisfy the
policy.
- Parse each eval spec once and reject duplicate semantic mapping keys,
textual YAML merge keys, and normalized explicit merge tags recursively
before loading. This prevents Psych/Vally parser disagreement from
bypassing prompt, ref, repository-control, or executable-environment
validation.
- Limited frozen-worktree test detection to full immutable commit IDs;
ordinary explicit branch bases continue using authoritative PR file
metadata.
- Added deterministic regressions for model planning, PAT distribution
and transport errors, deleted evaluator controls, host-only XAML
invocation, evaluator-owned input preservation, required-stimulus
rename/decoy/parser bypasses, branch-versus-immutable test detection,
and reporting-side verdict preservation.

### Validation

Current head: `fd8f3d543e1a1eb90e8432a0cbae07a18b52dbdd`.

- Exact-head [Skill Validation run
31807806898](https://github.com/dotnet/maui/actions/runs/31807806898),
[`maui-pr` build
1553690](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1553690),
Build Analysis, CLA, static checks, Pester, and the hermeticity gate are
green.
- All evaluated suites passed. Key suites: `try-fix-restore-protocol`
**1.00 / 1.00**, `try-fix-capabilities` **0.93 / 0.80**,
`pr-review-gh-auth` **1.00 / 0.80**, and
`verify-tests-fail-without-fix-capabilities` **0.94 / 0.87**.
- Local trusted evaluator/reporting harness: **70 tests, 306 assertions,
0 failures/errors/skips**.
- All **16** Vally specs pass strict lint with pinned
`@microsoft/vally-cli@0.12.0`.
- All **8** skill test directories pass trusted validation and resolve
the effective plan to `gpt-5.6-sol` plus `claude-opus-5`; non-eval
soak/hermeticity specs do not contaminate matrix selection.
- Ruby syntax, Bash syntax, ShellCheck, workflow YAML parsing, Pester
(**8 passed**), and `git diff --check` pass.
- Final whole-diff review found no high-confidence correctness or
security blockers; all review threads are resolved.
- `pull_request_target` executes trusted workflow/helper code from
default `main`; candidate selector/reporting helper behavior is
therefore covered deterministically here and becomes the credentialed
trusted path after merge.

### Issues Fixed

Follow-up to #36799.

---------

Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Vally Fixture <vally-fixture@example.invalid>
Copilot-Session: b9f7de2c-86d7-47cd-8ac8-aeff57d0b0f3
Copilot-Session: 806beb89-5041-4c7b-bcbf-998d6fbab8dc
<!-- 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!

### Description of Change

Extend the existing `release-readiness` skill with deterministic,
copy-ready Preview and servicing-release handoff generation from
readiness JSON plus separately verified public evidence.

- Keep missing or unverified release facts as explicit `TBD` values and
enforce public-safe URLs, structured metadata, NuGet configuration, and
Markdown output.
- Correct Preview workload installation guidance with package-source
mapping and the prior-major public compatibility feed while keeping
workload-set packages isolated to `dotnet-workloads`.
- Add focused regression coverage and run it in the release-readiness
validation workflow.

The renderer is a projection of the existing readiness engines rather
than a second survey, so Preview and SR semantics remain distinct while
sharing one public handoff format.

### Safety and Architecture

- Public output requires an explicit JSON boolean `PublicEvidence:
true`.
- The renderer rebuilds NuGet XML from an allow-list and accepts only
public `dnceng/public` Azure Artifacts feeds or the exact NuGet.org
service index.
- Public evidence URLs, structured build metadata, timestamps, Markdown,
local paths, credential-shaped values, and owner/sign-off prose are
validated or omitted.
- Workload-set packages map only to `dotnet-workloads`; component and
compatibility packages resolve through their appropriate public feeds.

### What Not to Do

- Do not use the handoff renderer as a second readiness survey or let it
select a newer build implicitly.
- Do not copy private source-page content, credentials, owners, or
sign-offs into public evidence.
- Do not map unrelated component packages to `dotnet-workloads`; missing
upstream packages can otherwise surface as misleading authorization
failures.

### Validation

- `pwsh -NoProfile -File
.github/skills/release-readiness/tests/Test-ReleaseHandoff.ps1`
- `pwsh -NoProfile -File
.github/skills/release-readiness/tests/Test-ReleaseReadiness.ps1
-SkipE2E`

### Issues Fixed

N/A

---------

Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3db5742d-7e40-4a23-a3ea-de3bc3f0848e
<!-- 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!

### Root Cause

MAUI's release flow implemented NuGet.org authentication, retries,
conflict handling, quota rotation, and publishing in
`eng/scripts/push_nuget_org.ps1`. Gather and push failures could also
continue without failing the release. The repository additionally
carried a duplicate internal release YAML.

### Description of Change

This makes `eng/pipelines/ci-official-release.yml` the canonical release
pipeline and moves package publication to the approved 1ES release path:

- Resolve the BAR build once and run one fail-fast `darc gather-drop`,
limited to BAR NuGet package assets rather than unrelated symbol/blob
assets.
- Preserve package include/exclude behavior and validate non-empty
workload-pack and workload-manifest sets.
- Produce separate SBOM-backed `MauiPacksForNuGet` and
`MauiManifestsForNuGet` artifacts.
- Publish from production `releaseJob` jobs with `1ES.PublishNuget@1`,
`useDotNetTask: false`, and the protected `nuget.org (dotnetframework)`
service connection.
- Require workload packs to publish and become resolvable before
manifest approval is available.
- Remove `maui-release-internal.yml`, `push_nuget_org.ps1`, raw API-key
inputs, and the arbitrary feed URL.
- Document the canonical release and recovery procedure.

No public API changes are involved.

### Duplicate and Partial-Publish Recovery

Internal build
[3050066](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050066)
proved that the service connection authenticates, but also proved that
the external-feed-backed task fails on HTTP 409 even with
`allowPackageConflicts: true`. Task-level retries are unsafe after a
partial batch because the retry can immediately encounter duplicates
created by the first attempt.

The final implementation therefore:

- Generates an `expected-packages.json` identity manifest for each
immutable artifact.
- Rejects duplicate package identities, duplicate package file names,
and unexpected `.nupkg` files before publication.
- Verifies the copied helper's SHA-256 before execution.
- Filters packages already visible through NuGet.org's flat-container
API before publishing.
- Uses separate recovery-only `nugetAlreadyAttemptedPackFilters` and
`nugetAlreadyAttemptedManifestFilters` parameters for packages accepted
but not yet visible during NuGet.org validation lag.
- Runs `1ES.PublishNuget@1` only when packages remain and does not use
task-level retries.
- Verifies the complete expected package set with transient-query
retries and a 30-minute deadline.

### Internal Validation

- Internal branch:
[`copilot/replace-custom-nuget-publishing`](https://dev.azure.com/dnceng/internal/_git/dotnet-maui?version=GBcopilot%2Freplace-custom-nuget-publishing)
- Final internal commit:
[`adf2ad774cd3a2092450df153e6b46a09a127552`](https://dev.azure.com/dnceng/internal/_git/dotnet-maui/commit/adf2ad774cd3a2092450df153e6b46a09a127552?refName=refs%2Fheads%2Fcopilot%2Freplace-custom-nuget-publishing)
- Build 3050066 confirmed the registered `dotnet-maui-release`
definition already executes the canonical YAML, so no
pipeline-definition migration is needed.
- Build
[3050237](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050237)
showed that a fail-fast unfiltered gather stops on a missing Foldable
symbol blob even though the shipping NuGet package downloads
successfully. The gather now uses Darc's slash-free package-asset
convention to exclude symbol/blob paths while remaining fail-fast for
every publishable package.
- Build
[3050279](https://dev.azure.com/dnceng/internal/_build/results?buildId=3050279)
confirmed the package-only gather succeeds and the `nuget.org
(dotnetframework)` connection authenticates: it published
`Microsoft.AspNetCore.Components.WebView.Maui.10.0.100`, then NuGet.org
rejected
`Microsoft.AspNetCore.Components.WebView.Maui.Msi.arm64.10.0.100` with
HTTP 403. The first package lists `dotnetframework` as an owner; the MSI
package lists only `Microsoft` and `Xamarin`. This is a NuGet.org
package-ownership/service-connection blocker, not a pipeline task-wiring
failure.
- Pester 5.9.0: 1,668 tests passed, including 15 package-filtering/retry
tests and 3 release-pipeline regression tests.
- PowerShell parsing, YAML parsing, documentation spellcheck, and
whitespace validation pass.

Before production use, either the service-connection identity must be
granted ownership of every MAUI package (including Xamarin-owned MSI
packages), or the release pipeline must be given an approved
Xamarin-scoped NuGet.org service connection. Once that external
credential issue is resolved, rerun the same commit and BAR selection;
the recovery logic will omit the package already published by build
3050279 and continue with the remaining set.

### What Not to Do

- Do not rely on `allowPackageConflicts` for an external NuGet.org feed;
build 3050066 proved it does not make 409 responses successful.
- Do not add task-level retries around a multi-package publish; they are
not safe after partial publication.
- Do not restore broad `--continue-on-error` gather behavior; exclude
non-release symbol/blob assets and keep publishable package gathering
fail-fast.
- Do not gather a different BAR drop while recovering a partial release;
rerun the same commit and selection filters.
- Do not exclude the Xamarin-owned MSI packages to make the build green;
they are shipping assets and require a credential with matching
NuGet.org ownership.

### Issues Fixed

Fixes #36567

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Copilot-Session: 150fe76a-707e-48ca-9e9d-38bfccead829
<!-- 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!

### Description of Change

Enhance local net11 preview release-readiness runs with automatic health
checks for the internal official `dotnet-maui` Azure DevOps pipeline
(definition 1095, `dnceng/internal`). The local release-readiness
skill/agent explicitly requests enriched output, then independently
discovers builds for `refs/heads/net11.0` and the evaluated release
branch when it exists. It requests a bounded, queue-time-ordered
five-build window and prefers the newest exact-HEAD build, then scans in
queue order while skipping candidates proven stale and buffering
indeterminate evidence. Disagreeing possible outcomes remain UNKNOWN; a
later proven-current failure remains RED only when every buffered
candidate is also a completed failure/cancellation. A terminal window
containing only same-branch failed/canceled indeterminate builds is
`failed-or-stale` and BLOCKED because every possible build is either red
or stale.

The check reports build status, ID/number, source SHA, and URL. Current
successful builds are green; failures/cancellations are red; partial
success is a WATCH state requiring manual review; running builds are in
progress; builds behind the newest trigger-eligible commit are stale;
missing or malformed evidence is unknown. When branch HEAD advances,
bounded local Git evaluates exact first-parent history and merge-result
changes against `eng/pipelines/ci-official.yml`. Successful no-op or
excluded-only advances remain current, while add/revert and
merge-result-only source changes still require a newer official build. A
conclusive Git non-ancestor result is stale; unavailable Git evidence
remains unknown unless every possible same-branch result is
independently blocking.

### Public/internal boundary

Direct script output remains public-safe by default. GitHub Actions
skips the internal query before invoking Azure CLI, while the local
skill/agent explicitly passes `'-PublicSafe:$false'` for enriched
artifacts that remain local. Public-safe output omits internal branch
records, build IDs/numbers, SHAs, URLs, and the local-only table.

Missing local Azure authentication fails open. Partial failures preserve
successful branch evidence, so known red/stale results cannot disappear.
Azure, GitHub, and local Git subprocesses have bounded execution;
process exit and redirected-output draining share the same deadline.
Local Git runs from the explicit repository root, performs a bounded
fetch of only the evaluated branch when objects are absent, and maps
unavailable currency evidence through the outcome lattice rather than
assuming current or stale. Windows `.cmd`/`.bat` Azure CLI launchers run
through `ComSpec` with structured arguments. Manual build overrides are
accepted only when the build belongs to definition 1095, and
Azure-controlled build numbers are constrained to the expected numeric
format before entering agent-facing output.

### Tests

- `pwsh -NoProfile -File
.github/skills/release-readiness/tests/Test-ReleaseReadiness.ps1` —
2,276 passed, 0 failed
- PowerShell parser validation for the helper, preview engine, and test
harness
- Live local smoke successfully queried both requested refs through the
enriched local path
- First-parent empty-commit, same-tree merge, merge-result source
change, add/revert, non-ancestor, missing-object, exact/proven-current
candidate selection, old-SHA retry, uncertain-failed/older-green
UNKNOWN, uncertain-failed/older-failed RED, blank-source-SHA/canceled
certainty, terminal failed-or-stale Details/NextAction, public-safe
generic BLOCKED rendering, explicit-CWD, Windows launcher,
trigger-exclusion, exact-path, timeout, auth-ordering, malformed-output,
and public-redaction fixtures
- GitHub Actions/public-safe smoke confirms the internal fetcher is not
invoked and internal coordinates remain absent

### Design tradeoffs

- Azure CLI remains the local adapter so public automation gains no
credentials or SDK dependency.
- A five-build, server-ordered window keeps the query bounded; selection
skips conclusively stale candidates, buffers uncertainty, and reports
only outcomes common to every possible currency result.
- Certain terminal blocking uses a distinct `failed-or-stale`
classification rather than falsely claiming the selected build is
current; local guidance restores currency evidence before choosing
failure repair versus a current-HEAD rerun, while public-safe output
remains generic.
- Local Git inspects exact first-parent commit and merge-result paths
rather than an aggregate compare diff, preventing second-parent history
and net-zero merges from producing false stale results while preserving
add/revert evidence.
- Missing local objects trigger one bounded fetch of the evaluated ref;
unresolved evidence remains UNKNOWN unless every possible outcome
blocks, while a conclusive non-ancestor result is stale.
- Total authentication unavailability is skipped; partial access loss
retains observed branch evidence.
- `-InternalBuildId` remains a diagnostic override, but normal local
skill/agent runs use branch-based discovery.

### Issues Fixed

N/A

---------

Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0e39d9d4-19e4-45f5-80f1-2bb3035c18c9
Removes the repository-owned VG20 import and synchronizes the relevant
Arcade credential-removal changes on `main`.

Tracked by https://dev.azure.com/dnceng/internal/_workitems/edit/12131

Copilot-Session: e890b71a-c1aa-416c-a15c-be8da9fdd9b4
### Description of Change

Replace MAUI's long-lived `dn-bot-ceapex-package-r` dependency with a
short-lived Entra token for OneLocBuild package restores.

- Acquire the Azure DevOps token through the existing DevDiv
`dnceng-onelocbuild-ceapex` workload-identity service connection.
- Reuse Arcade's shared `get-federated-access-token.yml` helper.
- Pass the resulting secret `CeapexEntraToken` to OneLocBuild for the
ceapex LCL/LocTools feeds.
- Keep the existing GitHub PR authentication unchanged.

The DevDiv service connection is configured for workload identity
federation and MAUI pipeline 13330 is authorized to use it.

### Validation

- Parsed the updated pipeline as YAML.
- Verified the shared federated-token helper exists on this branch.
- Verified the legacy ceapex PAT is no longer referenced by MAUI's
repo-owned localization pipeline.

### Issues Fixed

Tracks [dnceng work item
10151](https://dev.azure.com/dnceng/internal/_workitems/edit/10151).

Copilot-Session: 80f6a0c6-7947-4200-bb78-7f0fc01d671a
…atic event with WeakEventManager (#37645)

<!-- 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!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->


### Issue Details
When a page or view model subscribes to BindingDiagnostics.BindingFailed
(a helpful event that tells you when a data binding fails) and forgets
to unsubscribe, that page never gets cleaned up from memory. Every page
it holds — plus its images, view models, and data — stays alive until
the app closes. Over time, the app uses more and more memory.

### Root Cause
BindingFailed is a static event, which means it lives for the whole life
of the app. Normal C# events keep a strong reference to whoever
subscribed, so as long as the event is alive, its subscribers stay alive
too. Since this event never goes away, any subscriber that doesn't call
-= is stuck in memory forever.

### Description of Change
Switched BindingFailed from a normal event to one backed by
WeakEventManager, which keeps only a weak reference to subscribers — so
the garbage collector can clean them up even if someone forgets to
unsubscribe.
 

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #37245 

### Fix reference 
[maui/src/Controls/src/Core/Application/Application.cs at
bf62313 ·
…](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Application/Application.cs#L263)
[maui/src/Controls/src/Core/Command.cs at
bf62313 ·
dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/Command.cs#L128)
[maui/src/Controls/src/Core/ImageSource.cs at
bf62313 ·
dotnet/maui](https://github.com/dotnet/maui/blob/bf62313db2cecf3215f10c353720b341aba0a4ee/src/Controls/src/Core/ImageSource.cs#L175)

### Output  ScreenShot

|Before|After|
|--|--|
| <video
src="https://github.com/user-attachments/assets/86c6d76d-a051-458b-beb3-6c254545f87a"
>| <video
src="https://github.com/user-attachments/assets/e3b02ce7-71a7-4e90-94e0-dd6587c8e3cf">|
<!-- 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!

## Summary

- regenerate all 14 Copilot-based agentic workflows with gh-aw v0.86.2
- stage the installed Copilot CLI in a portable runner-local path
instead of invoking `/usr/local/bin/copilot`
- explicitly disable shell access in the automatic issue/PR labeler, as
required when `min-integrity: none`
- adopt gh-aw v0.86.2's intentional disabled-expiry sentinel for
action-failure issues when no maintenance workflow exists

## Root cause

The failing runs install Copilot CLI successfully, but gh-aw v0.85.4
then invokes `/usr/local/bin/copilot`. That path no longer exists on the
hosted runner, so the engine exits with `ENOENT` before producing output
or making a model request. gh-aw v0.86.2 includes the upstream
path-portability fix and resolves the installed executable from `PATH`.

The same generated path affected every Copilot workflow, including the
labeler, whose failure reporting is intentionally disabled.

Regeneration also incorporates
[github/gh-aw#51425](github/gh-aw#51425).
Because this repository does not generate an `agentics-maintenance.yml`
consumer for the implicit action-failure expiry, all 14 lockfiles now
set `GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS` to `"0"`. In gh-aw
v0.86.2, explicit `0` means expiration is disabled; it prevents
unenforceable expiry markers and does not make failure issues expire
immediately.

## Validation

- `gh aw compile --strict --validate --actionlint --no-emit`
- verified all 14 lockfiles use gh-aw v0.86.2 and portable Copilot
staging
- verified no generated workflow references `/usr/local/bin/copilot`
- verified all 14 generated locks use gh-aw's `"0"` disabled-expiry
sentinel consistently

No existing open MAUI PR addresses this gh-aw/Copilot path failure.

Fixes #37430
Fixes #37431
Fixes #37432
Fixes #37435
Fixes #37442

---------

Co-authored-by: Copilot CI <copilot-ci@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74cff858-a5a6-486e-a1d3-1d516fc3bdaa
Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
<!-- 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!

## Description

Adds .NET MAUI 10.0.100 and 11.0.0-preview.7 to both version selectors
in the bug-report issue form.

This lets users report issues against the released SR10 build and the
active .NET 11 Preview 7 version.

---------
)

<!-- 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!

### Problem

The internal `dotnet-maui` official build currently fails to compile the
pipeline YAML, before any stage runs:

```
/eng/pipelines/common/variables.yml (Line: 81, Col: 7): Expected at least one key-value pair in the mapping
```

### Cause

#37589 removed `- group: Publish-Build-Assets`, but that group was the
only child of the conditional that enclosed it, leaving an empty block
behind:

```yaml
    - group: AzureDevOps-Artifact-Feeds-Pats
    - ${{ if eq(variables['Build.DefinitionName'], 'dotnet-maui') }}:   # <- nothing under it
```

Azure DevOps requires a conditional insertion block to contain at least
one entry, so template expansion fails outright.

### Why PR validation stayed green

The empty block is nested inside an outer guard:

```yaml
- ${{ if or(eq(variables['Build.DefinitionName'], 'dotnet-maui'), eq(variables['Build.DefinitionName'], 'dotnet-maui-build')) }}:
  - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
```

For the public `maui-pr` definition that outer condition is false, so
Azure DevOps short-circuits and never expands the inner block. The
breakage is therefore invisible to PR CI and only manifests on the
internal official build.

### Fix

Remove the empty conditional. No file in the repository references the
`Publish-Build-Assets` variable group any more, so it is deleted
outright rather than repopulated.

### Validation

- `eng/pipelines/common/variables.yml` parses as valid YAML.
- Swept all 39 YAML files under `eng/pipelines/` for conditional blocks
with no body — this was the only one.
- `grep` for `Publish-Build-Assets` across `eng/` and `.github/` returns
no remaining references.

This blocks the internal build entirely, so it is worth merging ahead of
larger infra work such as #36257 (which carries the same one-line fix,
but cannot be validated on the internal pipeline until this is on
`main`).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the Material 3 surface color when selecting Android status bar icon appearance while retaining colorPrimary behavior for Material 2. Add device coverage for light and dark Material 3 themes and the Material 2 custom-primary scenario.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The screenshots remain available through the preceding commit for embedding in the pull request without adding binaries to the final diff.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 21, 2026 10:39
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37710

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37710"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adjusts Android status bar icon contrast selection to account for Material 3’s edge-to-edge status bar background (surface) while preserving the existing Material 2 behavior (primary), and adds device-test coverage to prevent regressions.

Changes:

  • Update translucent system bar configuration to derive AppearanceLightStatusBars from a resolved theme background color (surface for Material 3, primary for Material 2), with a day/night fallback when the theme attribute can’t be resolved.
  • Introduce GetStatusBarAppearance(...) helper to centralize the theme-attribute/luminance logic.
  • Add Android device tests covering Material 3 light/dark and Material 2 primary-color behavior.
Show a summary per file
File Description
src/Core/src/Platform/Android/WindowExtensions.cs Uses colorSurface for Material 3 and colorPrimary for Material 2 to pick status bar icon appearance via luminance.
src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs Adds device tests intended to validate Material 3 surface-based behavior and preserve Material 2 primary-based behavior.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

@mistressmeladeetwenty47-debug

Copy link
Copy Markdown

Description

Fixes #37705.

ConfigureTranslucentSystemBars started deriving Android status bar icon appearance from colorPrimary in 10.0.100. That remains correct for the Material 2 app bar and preserves the fix for #32987, but Material 3 draws colorSurface behind its transparent edge-to-edge status bar. Material 3's primary and surface colors intentionally have opposite luminance in both day and night themes, which inverted the status bar icons.

This change uses:

  • colorSurface for Material 3
  • colorPrimary for Material 2
  • the existing day/night fallback when the theme color cannot be resolved

It also adds Android device coverage using the real MAUI Material 3 light/dark resources and the Material 2 primary-color path.

Runtime verification

Reproduced with the default .NET 10 MAUI template, Microsoft.Maui.Controls 10.0.100, and <UseMaterial3>true</UseMaterial3> on an Android API 36 emulator. The same app was then rebuilt against this branch's local Microsoft.Maui project.

Theme 10.0.100 This PR
Light 10.0.100 light mode with unreadable white status bar icons Fixed light mode with readable dark status bar icons
Dark 10.0.100 dark mode with unreadable black status bar icons Fixed dark mode with readable white status bar icons

Validation

  • Android Core device-test project builds with 0 warnings and 0 errors.

  • All three new regression cases pass on an API 36 emulator:

    • Material 3 light surface uses dark icons.
    • Material 3 dark surface uses light icons.
    • Material 2 continues deriving icon contrast from colorPrimary.
  • Full device run: 3,031 tests executed; the new tests passed. One unrelated existing Switch pixel-color test failed consistently in both light and dark emulator modes.

  • The implementation and test strategy were challenged by three independent models and received a final independent code review with no findings.

@kamano1, when the PR artifacts become available, please try them with your app and let us know whether they resolve the issue on your Android 15/17 devices.

Pass the opposite theme fallback so the light and dark assertions can only succeed when colorSurface resolves and drives status bar icon appearance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: eb0d8262-304b-4382-bfdf-5e1463002287
Copilot AI review requested due to automatic review settings August 21, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs:61

  • activity.Resources?.Configuration uses a null-conditional but the result is passed directly into new Configuration(...) (which doesn't accept null). This is misleading and can still throw if Resources is unexpectedly null; either require non-null here or explicitly handle the null case.
				var activity = (AppCompatActivity)MauiProgramDefaults.DefaultContext;
				using var configuration = new Configuration(activity.Resources?.Configuration);
				configuration.UiMode = (configuration.UiMode & ~UiMode.NightMask) |
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Aug 21, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 3 findings

See inline comments for details.

{
// Material 3 draws its surface behind the transparent edge-to-edge status bar.
// The Material 2 app bar uses colorPrimary in the same area.
var backgroundAttribute = isMaterial3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔍 AI-Generated Review (multi-model)

[moderate] Logic and Correctness — The attribute choice keys off the global RuntimeFeature.IsMaterial3Enabled switch rather than the theme actually applied to the Activity, and the two can diverge. MauiAppCompatActivity.OnCreate only applies Maui.Material3.Theme.NoActionBar on the same switch, but an app can apply its own theme via [Activity(Theme = "@style/...")] or by overriding MainTheme.NoActionBar/AppTheme.NoActionBar (aliases in styles.xml whose parent chain is Maui.MainTheme.Base → Theme.MaterialComponents.DayNight). Concrete scenario: Material3 switch enabled + a Material2/AppCompat Activity theme with a dark colorPrimary toolbar. Theme.MaterialComponents.DayNight also defines colorSurface (near-white in light mode), so TryGetThemeColor succeeds, IsLightColor returns true, AppearanceLightStatusBars is set to true, and dark status-bar icons are drawn over the dark toolbar — the exact contrast case fixed by #36214. Resolving which attribute to read from the context's own theme (e.g. probing whether the Material3 theme is applied) would keep the two in sync.

? Resource.Attribute.colorSurface
: global::Android.Resource.Attribute.ColorPrimary;

return TryGetThemeColor(context, backgroundAttribute, out var backgroundColor)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔍 AI-Generated Review (multi-model)

[moderate] Logic and Correctness — When isMaterial3 is true and the applied theme does not define colorSurface (e.g. an app that sets a plain Theme.AppCompat.* Activity theme while the Material3 switch is on), TryGetThemeColor returns false and the result falls back to isLightTheme, silently dropping the luminance-based contrast behavior instead of falling back to colorPrimary — which resolves on every AppCompat theme and is the value #36214 relied on. A cascading lookup (colorSurface → colorPrimary → isLightTheme) would preserve the prior fix in that case.

});
}

[Theory]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔍 AI-Generated Review (multi-model)

[moderate] Regression Prevention and Test Coverage — The added tests call GetStatusBarAppearance with isMaterial3 passed explicitly, so the new branch is covered but its only production wiring is not: ConfigureTranslucentSystemBars (WindowExtensions.cs:63) is never exercised, so an incorrect RuntimeFeature.IsMaterial3Enabled → attribute mapping, or a regression in that call site, would not be caught. Two branches also lack a negative case: (1) the fallback path where TryGetThemeColor fails and isLightTheme is returned (no test applies a theme lacking the requested attribute), and (2) isMaterial3: true against a Material2 theme, which is the divergence scenario flagged on WindowExtensions.cs:73. Note the tests do correctly poison the isLightTheme fallback with an inverted value so they discriminate the color path from the fallback — extending that same pattern to the cases above would close the gap.

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@jfversluis — new AI review results are available based on commit e0c13d7.

Gate Passed Confidence High Platform Android


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: ANDROID · Base: main · Merge base: d48c3ba3

✅ Verified (new API / feature) — this PR adds new API and a test that references it in the same project, so reverting the fix un-compiles the test: there is no valid "fails without the fix" baseline to establish (a compile-coupled baseline). The gate instead verified the fix by a clean build + pass with the fix, so this is a real PASS rather than a non-committal INCONCLUSIVE.

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 WindowHandlerTests (Material3StatusBarAppearanceUsesSurfaceColor, Material2StatusBarAppearanceUsesPrimaryColor) Category=Window 🛠️ BUILD ERROR ✅ PASS — 383s
🔴 Without fix — 📱 WindowHandlerTests (Material3StatusBarAppearanceUsesSurfaceColor, Material2StatusBarAppearanceUsesPrimaryColor): 🛠️ BUILD ERROR · 258s

Error-relevant lines (filtered from the build log):

/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs(68,39): error CS0117: 'WindowExtensions' does not contain a definition for 'GetStatusBarAppearance' [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs(87,39): error CS0117: 'WindowExtensions' does not contain a definition for 'GetStatusBarAppearance' [/home/vsts/work/1/s/src/Core/tests/DeviceTests/Core.DeviceTests.csproj::TargetFramework=net10.0-android]
Build FAILED.
🟢 With fix — 📱 WindowHandlerTests (Material3StatusBarAppearanceUsesSurfaceColor, Material2StatusBarAppearanceUsesPrimaryColor): PASS ✅ · 383s

(no coded error found; showing last 1200 chars)

8-21 13:37:59.207 12630 12682 I DOTNET  : Xml file was written to the provided writer.
      08-21 13:37:59.207 12630 12682 I DOTNET  : === TEST EXECUTION SUMMARY ===
      08-21 13:37:59.207 12630 12682 I DOTNET  : Tests run: 1295 Passed: 5 Inconclusive: 0 Failed: 0 Ignored: 1290 Skipped: 0
info: <<XHARNESS_RESULT_START>>
      {
        "version": 1,
        "machineName": "runnervmyebny",
        "exitCode": 0,
        "exitCodeName": "SUCCESS",
        "platform": "android",
        "instrumentationExitCode": 0,
        "device": "emulator-5554",
        "deviceOsVersion": "API 30",
        "architecture": "x86_64",
        "files": [
          {
            "name": "testResults-52a236f45cc74b5b8d1eb516bbf2c2ab.xml",
            "type": "test-results"
          },
          {
            "name": "adb-logcat-com.microsoft.maui.core.devicetests-default.log",
            "type": "logcat"
          }
        ]
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
info: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 0
  Passed: 3
  Failed: 0
  Skipped: 0
  Total: 3
  Tests completed successfully

⚠️ Failure Details

  • 🛠️ WindowHandlerTests (Material3StatusBarAppearanceUsesSurfaceColor, Material2StatusBarAppearanceUsesPrimaryColor) without fix: build failed before tests could run
    • /home/vsts/work/1/s/src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs(68,39): error CS0117: 'WindowExtensions' does not contain a definition for 'GetStatusBarAppearance' [/home/...
📁 Fix files reverted (1 files)
  • src/Core/src/Platform/Android/WindowExtensions.cs

📋 Pre-Flight — Context & Validation

PR #37710 Pre-Flight

Context

  • Title: [Android] Fix Material 3 status bar icon contrast
  • Issue: #37705, a regression in Microsoft.Maui.Controls 10.0.100. With <UseMaterial3>true</UseMaterial3>, light themes show white status-bar content on white and dark themes show black content on black. Reported on Android 15 and 17; 10.0.90 was unaffected.
  • Root cause described by the PR: ConfigureTranslucentSystemBars derives status-bar icon appearance from colorPrimary. That matches the Material 2 app bar, but Material 3 draws colorSurface behind the transparent edge-to-edge status bar; the two attributes have opposite luminance in the supplied day/night themes.
  • Base / head: main at d48c3ba39b58c724e86aca99c3823458ca1df235; materialized squashed review commit 3baa6aff6810ba3594992f38b36026b400129bbc (upstream PR head e0c13d71ad8c2ee7b6fd9cb818181aeefe23929a).
  • Platform: Android.

Existing PR Approach

The PR changes src/Core/src/Platform/Android/WindowExtensions.cs so ConfigureTranslucentSystemBars calls a new internal GetStatusBarAppearance(Context, bool, bool) helper. The helper selects Resource.Attribute.colorSurface for Material 3 and Android colorPrimary for Material 2, resolves that attribute from the current theme, calculates luminance with ColorUtils.CalculateLuminance, and retains the day/night value as a fallback.

It also changes src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs with three regression cases:

  1. Material 3 light theme resolves the surface and requests dark status-bar content.
  2. Material 3 dark theme resolves the surface and requests light status-bar content.
  3. Material 2 continues to derive status-bar content from colorPrimary.

The Material 3 tests intentionally pass a fallback value opposite the expected result, preventing a missing theme-attribute lookup from producing a false pass. That correction addressed the only prior inline review comment.

Diff Scope and Alternative-Fix Boundary

  • Production fix file: src/Core/src/Platform/Android/WindowExtensions.cs
  • Regression-test file: src/Core/tests/DeviceTests/Handlers/Window/WindowHandlerTests.Android.cs
  • The alternative must preserve the test-required internal GetStatusBarAppearance(Context, bool, bool) surface and pass the existing tests, but use a mechanism meaningfully different from the PR's explicit Material-version-to-theme-attribute selector.
  • EstablishBrokenBaseline.ps1 previously identified only src/Core/src/Platform/Android/WindowExtensions.cs as a fix file. Each try-fix invocation must treat .github/.baseline-state.json's RevertedFiles as the final edit allow-list.
  • The worktree contains unrelated pre-existing changes under .github/ and eng/; they are out of scope and must remain untouched.

Validation Contract

The gate has already passed and must not be rerun. It observed the expected compile-coupled baseline failure when the production helper was removed and a passing Android device run with the PR fix.

Run only:

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=Window"

This filter covers the primary Material 3 light/dark theory and the mandatory Material 2 regression test, plus the existing Window-category coverage. Do not run a full suite. One implementation/test pass and at most one focused correction/retest are allowed.

Gate Evidence

  • Without fix: expected compile error because the retained regression tests call WindowExtensions.GetStatusBarAppearance.
  • With fix: XHarness success on emulator-5554 (API 30); 5 selected cases passed, including all three new regression cases.
  • Regression cross-reference: no overlap with recently labeled bug-fix PR removals.

🔬 Code Review — Deep Analysis

Expert PR Evaluation

Verdict: Approve with non-blocking comments
Confidence: High for the Android product fix; medium for unrelated CI/agent-tooling changes present in the review worktree.

Independent assessment

The submitted Android fix changes status-bar icon contrast selection so Material 3 resolves colorSurface, while Material 2 continues resolving colorPrimary; unresolved colors retain the existing day/night fallback. The extracted GetStatusBarAppearance helper is internal, has one production caller, and introduces no public API. The core behavior is sound for the normal MAUI theme path, and the added Android device tests deliberately invert the fallback input so they prove the requested theme color was actually resolved.

Findings

  1. Moderate — theme/switch divergence: Attribute selection is based on RuntimeFeature.IsMaterial3Enabled, not the theme actually applied to the Activity. A custom Material 2/AppCompat activity theme can coexist with the Material 3 switch; if that theme also resolves colorSurface, icon contrast may be derived from a surface color that is not behind the status bar.
  2. Moderate — missing cascade: When Material 3 is enabled but colorSurface is absent, the implementation falls directly to isLightTheme, losing the prior luminance-based colorPrimary behavior. A colorSurface → colorPrimary → day/night cascade would preserve contrast behavior for custom themes.
  3. Moderate — production wiring coverage: Tests call GetStatusBarAppearance with isMaterial3 supplied directly rather than exercising ConfigureTranslucentSystemBars; they do not cover feature-switch wiring, a missing requested attribute, or a Material 3 switch paired with a Material 2 theme.

The complete file:line findings are recorded in ../inline-findings.json.

Blast radius and failure modes

The runtime change is Android-only and localized to translucent system-bar configuration. It adds no static state, subscriptions, lifecycle ownership, or public API. The normal MAUI Material 2 and Material 3 theme paths remain coherent. The concrete adjacent risk is custom activity themes that diverge from the global Material 3 feature switch, including themes that either expose a semantically unrelated colorSurface or omit it entirely.

Recommendation

The submitted fix addresses the reported default-theme regression, and the trusted Gate confirms the regression tests fail without the fix and pass with it. The highest-value refinement is a single fallback cascade that first uses Material 3 colorSurface, then falls back to colorPrimary, and finally to the existing day/night value. The feature-switch/theme divergence should remain documented as residual uncertainty unless the candidate can reliably identify the actual applied theme.


🛠️ Try-Fix — Analysis & Comparison

Alternative Fix Candidates for PR #37710

Candidate 1 - Theme-Declared App-Bar Container Color

Approach: Resolve the active theme's appBarLayoutStyle, read that style's Android background, and calculate its luminance. This avoids the PR's explicit Material-version-to-color-attribute mapping and lets the theme declare the actual top-bar container color.

Result: Blocked

Diff: Empty. The mandatory baseline script rejected 41 pre-existing tracked worktree modifications before creating .github/.baseline-state.json, leaving no legal edit allow-list.

Tests: Not run. Testing unchanged HEAD would validate the PR rather than this candidate.

Failure analysis: The unrelated dirty files cannot be discarded, stashed, committed, or hidden under the try-fix restoration contract. The candidate made no src/Core changes; the no-state restore path reported Restored False, as permitted when baseline creation fails before any edit.

Detailed record: CustomAgentLogsTmp/PRState/37710/PRAgent/try-fix-1/content.md

Candidate 2 - Honor the Theme's System-Bar Appearance Contract

Approach: For Material 3, read the active theme's semantic android:windowLightStatusBar boolean instead of inferring icon appearance from a selected background. Preserve Material 2's existing colorPrimary luminance behavior and the day/night fallback. This is distinct from both the PR's explicit colorSurface mapping and candidate 1's app-bar-style background lookup.

Result: Blocked

Diff: Empty. The mandatory baseline script again rejected the 41 pre-existing tracked worktree modifications before producing an edit allow-list.

Tests: Not run. Testing unchanged HEAD would validate the PR rather than this candidate.

Failure analysis: The baseline guard could not be bypassed and unrelated changes could not be altered. No source edit occurred; the mandatory restore command returned the permitted no-state result, No baseline state found / Restored False.

Detailed record: CustomAgentLogsTmp/PRState/37710/PRAgent/try-fix-2/content.md

Aggregate Outcome

Two distinct alternatives were designed, but neither could be implemented or empirically evaluated because the required baseline script refuses the pre-existing dirty tracked worktree. Both attempts preserved the worktree and produced complete Blocked artifacts. No candidate is presented as passing.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winner: pr-plus-reviewer

The submitted fix addresses the default .NET MAUI Material 3 regression and passed the trusted Gate, but pr-plus-reviewer is the strongest candidate because it also handles the expert review's concrete custom-theme failure modes and passes the required targeted regression run.

Comparative analysis

Rank Candidate Implementation Validation Assessment
1 pr-plus-reviewer Uses the applied theme's isMaterial3Theme marker, resolves colorSurface for Material 3, cascades to colorPrimary, then preserves the day/night fallback. Adds a feature-setting/theme-divergence regression test. Passed: Android Core Category=Window, 6/6 tests, 0 failures. Best correctness and coverage. It preserves the submitted fix while avoiding incorrect surface selection when an app overrides its Activity theme and preserving primary-color contrast when a surface cannot be resolved.
2 pr Selects colorSurface or colorPrimary directly from RuntimeFeature.IsMaterial3Enabled, then falls back immediately to day/night. Passed trusted Gate: 5 selected Window cases; tests fail without the fix and pass with it. Correct for the standard MAUI Material 2/3 theme paths, but the global switch can disagree with the applied Activity theme, and a missing Material 3 surface skips the prior colorPrimary behavior.
3 try-fix-1 Proposed following appBarLayoutStyle to its background color. Blocked: no diff and no tests because baseline creation rejected the dirty raw worktree. Potentially theme-driven, but unimplemented and unvalidated; it cannot outrank either passing candidate.
4 try-fix-2 Proposed honoring android:windowLightStatusBar for Material 3 while retaining Material 2 primary-color luminance. Blocked: no diff and no tests because baseline creation rejected the dirty raw worktree. Semantically interesting, but unimplemented and unvalidated; it cannot outrank either passing candidate.

Expert review reconciliation

The single expert review produced three moderate inline findings:

  1. The raw PR ties attribute selection to the global Material 3 switch rather than the applied theme.
  2. A missing Material 3 surface falls directly to day/night instead of preserving the prior primary-color path.
  3. Tests do not cover feature-setting/theme divergence or the production selection boundary.

pr-plus-reviewer resolves the first two findings and adds a discriminating test for the divergence case. It does not add a direct ConfigureTranslucentSystemBars end-to-end assertion, so that wiring remains a limited coverage gap; the focused run nevertheless compiled the production call path and passed all six selected Window cases.

Recommendation

Apply pr-plus-reviewer/reviewer.patch to the submitted PR. The raw PR remains a valid fix for the reported default-theme case, but the winning candidate is safer for supported custom Activity themes and retains the earlier Material 2 contrast behavior as a fallback. The blocked STEP 5a alternatives provide no executable evidence and rank below both passing implementations.


📱 UI Tests — ViewBaseTests

Detected UI test categories: ViewBaseTests

✅ Deep UI tests — 118 passed, 0 failed, 1 skipped across 1 category on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
ViewBaseTests 118/119 (1 skipped) ✓ —
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)

🧭 Next Steps — reviewer changes required

The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.

Why: pr-plus-reviewer preserves the submitted Material 3 fix while selecting behavior from the applied theme and cascading to colorPrimary. Its focused Android Window run passed all 6 tests, whereas both try-fix candidates were blocked and unvalidated.

Address the actionable findings in this review before merging.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Aug 21, 2026
@kubaflo
kubaflo changed the base branch from main to inflight/current August 21, 2026 15:41
@kubaflo
kubaflo merged commit 10a0dc5 into inflight/current Aug 21, 2026
36 checks passed
@kubaflo
kubaflo deleted the jfversluis-fix-material3-status-bar branch August 21, 2026 15:42
@github-actions github-actions Bot added this to the .NET 10 SR11 milestone Aug 21, 2026
kubaflo pushed a commit that referenced this pull request Aug 22, 2026
Manual backport of #37710 for .NET MAUI 10.0.101.

Source head: e0c13d7

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1e7f77e3-4862-4b92-a662-d12b5918bb59
kubaflo pushed a commit that referenced this pull request Aug 27, 2026
Fixes #37705.

`ConfigureTranslucentSystemBars` started deriving Android status bar
icon appearance from `colorPrimary` in 10.0.100. That remains correct
for the Material 2 app bar and preserves the fix for #32987, but
Material 3 draws `colorSurface` behind its transparent edge-to-edge
status bar. Material 3's primary and surface colors intentionally have
opposite luminance in both day and night themes, which inverted the
status bar icons.

This change uses:

- `colorSurface` for Material 3
- `colorPrimary` for Material 2
- the existing day/night fallback when the theme color cannot be
resolved

It also adds Android device coverage using the real MAUI Material 3
light/dark resources and the Material 2 primary-color path.

Reproduced with the default .NET 10 MAUI template,
`Microsoft.Maui.Controls` 10.0.100, and
`<UseMaterial3>true</UseMaterial3>` on an Android API 36 emulator. The
same app was then rebuilt against this branch's local `Microsoft.Maui`
project.

| Theme | 10.0.100 | This PR |
| --- | --- | --- |
| Light | <img width="270" alt="10.0.100 light mode with unreadable
white status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-light.png">
| <img width="270" alt="Fixed light mode with readable dark status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-light.png">
|
| Dark | <img width="270" alt="10.0.100 dark mode with unreadable black
status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-dark.png">
| <img width="270" alt="Fixed dark mode with readable white status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-dark.png">
|

- Android Core device-test project builds with 0 warnings and 0 errors.
- All three new regression cases pass on an API 36 emulator:
  - Material 3 light surface uses dark icons.
  - Material 3 dark surface uses light icons.
  - Material 2 continues deriving icon contrast from `colorPrimary`.
- Full device run: 3,031 tests executed; the new tests passed. One
unrelated existing Switch pixel-color test failed consistently in both
light and dark emulator modes.
- The implementation and test strategy were challenged by three
independent models and received a final independent code review with no
findings.

@kamano1, when the PR artifacts become available, please try them with
your app and let us know whether they resolve the issue on your Android
15/17 devices.

---------
kubaflo added a commit that referenced this pull request Sep 1, 2026
…load (#37746)

<!-- 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!

<!-- release-readiness-agent: human-approval-required -->
## Summary

Integrates the staged **.NET MAUI 10.0.101 (SR10.1)** payload from
`inflight/10.0.101` into `release/10.0.1xx-sr10`, based on the shipped
`10.0.100` release.

The full release inventory and servicing decisions are tracked in
#37723. The [authoritative regression
query](https://github.com/dotnet/maui/issues?q=repo%3Adotnet%2Fmaui%20is%3Aissue%20is%3Aopen%20%28label%3A%22regressed-in-10.0.10%22%20OR%20label%3A%22regressed-in-10.0.20%22%20OR%20label%3A%22regressed-in-10.0.30%22%20OR%20label%3A%22regressed-in-10.0.40%22%20OR%20label%3A%22regressed-in-10.0.50%22%20OR%20label%3A%22regressed-in-10.0.60%22%20OR%20label%3A%22regressed-in-10.0.70%22%20OR%20label%3A%22regressed-in-10.0.80%22%20OR%20label%3A%22regressed-in-10.0.90%22%20OR%20label%3A%22regressed-in-10.0.100%22%29)
remains the source for the servicing-regression scope.

> [!IMPORTANT]
> Checked items under **Staged in this PR** are merged into
`inflight/10.0.101`, not yet into `release/10.0.1xx-sr10`. They reach
the release branch only when this aggregate PR is merged.

## Status at a glance

- [x] Stage the selected regression backports independently on
`inflight/10.0.101`.
- [x] Stage the SkiaSharp 4.150.1 payload and selective
`SKPath.AddCircle` compatibility fix.
- [x] Stage the isolated iOS 26 Liquid Glass TabBar payload from #37542.
- [ ] Complete or explicitly defer the six unresolved servicing
regressions listed below.
- [ ] Complete the release gates and merge this PR into
`release/10.0.1xx-sr10`.

## Staged in this PR

### Servicing regressions

- [x] #35826 — Android MediaPicker completion from child activities.
Source #35944; component backport #37724.
- [x] #36298 — Windows dynamic `ContentPresenter` assignment. Source
#36430; component backport #37725.
- [x] #36749 — preserve custom iOS Button styling. Source #36769;
component backport #37726.
- [x] #36736 — align Android SwipeItem content. Source #36820; component
backport #37727.
- [x] #34563 — per-edge iOS safe-area handling. Source #37033; component
backport #37728.
- [x] #37706 — Android root-page back handling. Source #37709; component
backport #37729.
- [x] #37705 — Android Material 3 status-bar contrast. Source #37710;
component backport #37730.
- [x] #37423 — restore native iOS 26 Liquid Glass TabBar behavior
through the isolated four-file payload from merged PR #37542.
- [x] #37418 — Android off-screen `TranslationY` layout padding. Source
fix #37772; focused backport commit `10799e67df`.
- [x] #37361 — iOS RefreshView pull-to-refresh with an empty
CollectionView. Source fix #37404; focused backport commit `d26faa8e93`.
- [x] #37638 — Android `Screenshot.CaptureAsync` synchronous UI-thread
deadlock. Source fix #37680; focused backport commit `778040a233`.

### Planned Skia payload

- [x] Port the Skia/Svg.Skia update from #36255 through component
backport #37731.
- [x] Include only the required `SKPath.AddCircle` compatibility change
from #36787; exclude its unrelated SourceGen changes.
- [x] Confirm a matching SkiaSharp 4.150.1 native-assets/PDB build for
`_SkiaSharpNativeAssetsVersion`, or record an explicit release-owner
waiver.

### Integration follow-ups

- [x] Apply the aggregate review fixes for safe-area cache invalidation,
Activity-for-result cancellation ownership, and Android theme-test
semantics.
- [x] Keep the final branch payload as focused release commits without
unrelated `inflight/current` history.
- [x] Validate the #37418 and #37638 focused Android UI tests on the
aggregate branch (2/2 passed).
- [ ] Validate the #37361 focused iOS UI test on the aggregate branch.

## Already present on the SR10 base — no new merge needed

- [x] #36852 — Android Shell hidden-fragment leak; fix #36903 is already
in SR10.
- [x] #36735 — Android ActivityIndicator visibility; fix #36748 is
already in SR10.
- [x] #36853 — Android Shell DI-singleton route blank page; fix #36903
is already in SR10.
- [x] #36942 — Android UI event handling; fix #36988 is already in SR10.
- [x] #37281 — Android scrolling inside shadowed containers; backport
#37312 is already in SR10.

## Completed disposition — no backport required

- [x] #37700 — closed as intended SR10 `SwipeView.Threshold` behavior
from #36878; any SwipeItem sizing concern should be tracked separately.

## Not included yet — merge, defer, or explicitly disposition before
payload freeze

- [ ] #35301 — Windows CollectionView applies WinUI styling by default;
no linked fix PR.
- [ ] #34491 — Android CollectionView selection with
`PointerGestureRecognizer`; replacement fix #37952 remains draft against
`main`.
- [ ] #35059 — iOS app becomes unresponsive when opening a ComboBox
dropdown in landscape; no linked fix PR.
- [ ] #37407 — iOS TimePicker default `t` format forces en-US; fix
#37797 remains draft against `main`.
- [ ] #36269 — Android `SafeAreaEdges` with Shell tab navigation and
hidden TabBar; source fix #36474 remains open against `main` and has no
SR10 backport.
- [ ] #37657 — Android Shell/root-page `OnBackButtonPressed()` in
Release builds; no linked fix PR.

## Release completion

### Before merging this PR

- [ ] Refresh the authoritative query and reconcile #37723 with its
current results.
- [ ] Record an include/defer/close decision for every unresolved
regression above.
- [ ] Validate every included regression on its reported OS/version
using the `10.0.101` candidate packages.
- [ ] Complete current-head aggregate CI and resolve or explicitly waive
every required build/device/UI-test failure.
- [ ] Resolve or waive the Skia native-assets/PDB release gate.
- [ ] Bump `eng/Versions.props` from patch `100` to `101` after the
payload is frozen.
- [ ] Obtain the required independent current-head maintainer approvals.
- [ ] Merge #37746 into `release/10.0.1xx-sr10`.

### After merge

- [ ] Confirm BAR promotion and the per-build validation feed used by
the ship assessment.
- [ ] Publish and tag `10.0.101`.
- [ ] Complete the Visual Studio insertion/default-MAUI-version update.

## Notes

- No automated `/backport` command was used for this release payload.
- Supersedes #37745, which GitHub automatically closed when the
integration branch was renamed from `vs/10.0.101` to
`inflight/10.0.101`.
kubaflo pushed a commit that referenced this pull request Sep 2, 2026
Fixes #37705.

`ConfigureTranslucentSystemBars` started deriving Android status bar
icon appearance from `colorPrimary` in 10.0.100. That remains correct
for the Material 2 app bar and preserves the fix for #32987, but
Material 3 draws `colorSurface` behind its transparent edge-to-edge
status bar. Material 3's primary and surface colors intentionally have
opposite luminance in both day and night themes, which inverted the
status bar icons.

This change uses:

- `colorSurface` for Material 3
- `colorPrimary` for Material 2
- the existing day/night fallback when the theme color cannot be
resolved

It also adds Android device coverage using the real MAUI Material 3
light/dark resources and the Material 2 primary-color path.

Reproduced with the default .NET 10 MAUI template,
`Microsoft.Maui.Controls` 10.0.100, and
`<UseMaterial3>true</UseMaterial3>` on an Android API 36 emulator. The
same app was then rebuilt against this branch's local `Microsoft.Maui`
project.

| Theme | 10.0.100 | This PR |
| --- | --- | --- |
| Light | <img width="270" alt="10.0.100 light mode with unreadable
white status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-light.png">
| <img width="270" alt="Fixed light mode with readable dark status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-light.png">
|
| Dark | <img width="270" alt="10.0.100 dark mode with unreadable black
status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-dark.png">
| <img width="270" alt="Fixed dark mode with readable white status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-dark.png">
|

- Android Core device-test project builds with 0 warnings and 0 errors.
- All three new regression cases pass on an API 36 emulator:
  - Material 3 light surface uses dark icons.
  - Material 3 dark surface uses light icons.
  - Material 2 continues deriving icon contrast from `colorPrimary`.
- Full device run: 3,031 tests executed; the new tests passed. One
unrelated existing Switch pixel-color test failed consistently in both
light and dark emulator modes.
- The implementation and test strategy were challenged by three
independent models and received a final independent code review with no
findings.

@kamano1, when the PR artifacts become available, please try them with
your app and let us know whether they resolve the issue on your Android
15/17 devices.

---------
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
Fixes #37705.

`ConfigureTranslucentSystemBars` started deriving Android status bar
icon appearance from `colorPrimary` in 10.0.100. That remains correct
for the Material 2 app bar and preserves the fix for #32987, but
Material 3 draws `colorSurface` behind its transparent edge-to-edge
status bar. Material 3's primary and surface colors intentionally have
opposite luminance in both day and night themes, which inverted the
status bar icons.

This change uses:

- `colorSurface` for Material 3
- `colorPrimary` for Material 2
- the existing day/night fallback when the theme color cannot be
resolved

It also adds Android device coverage using the real MAUI Material 3
light/dark resources and the Material 2 primary-color path.

Reproduced with the default .NET 10 MAUI template,
`Microsoft.Maui.Controls` 10.0.100, and
`<UseMaterial3>true</UseMaterial3>` on an Android API 36 emulator. The
same app was then rebuilt against this branch's local `Microsoft.Maui`
project.

| Theme | 10.0.100 | This PR |
| --- | --- | --- |
| Light | <img width="270" alt="10.0.100 light mode with unreadable
white status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-light.png">
| <img width="270" alt="Fixed light mode with readable dark status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-light.png">
|
| Dark | <img width="270" alt="10.0.100 dark mode with unreadable black
status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-dark.png">
| <img width="270" alt="Fixed dark mode with readable white status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-dark.png">
|

- Android Core device-test project builds with 0 warnings and 0 errors.
- All three new regression cases pass on an API 36 emulator:
  - Material 3 light surface uses dark icons.
  - Material 3 dark surface uses light icons.
  - Material 2 continues deriving icon contrast from `colorPrimary`.
- Full device run: 3,031 tests executed; the new tests passed. One
unrelated existing Switch pixel-color test failed consistently in both
light and dark emulator modes.
- The implementation and test strategy were challenged by three
independent models and received a final independent code review with no
findings.

@kamano1, when the PR artifacts become available, please try them with
your app and let us know whether they resolve the issue on your Android
15/17 devices.

---------
kubaflo pushed a commit that referenced this pull request Sep 6, 2026
Fixes #37705.

`ConfigureTranslucentSystemBars` started deriving Android status bar
icon appearance from `colorPrimary` in 10.0.100. That remains correct
for the Material 2 app bar and preserves the fix for #32987, but
Material 3 draws `colorSurface` behind its transparent edge-to-edge
status bar. Material 3's primary and surface colors intentionally have
opposite luminance in both day and night themes, which inverted the
status bar icons.

This change uses:

- `colorSurface` for Material 3
- `colorPrimary` for Material 2
- the existing day/night fallback when the theme color cannot be
resolved

It also adds Android device coverage using the real MAUI Material 3
light/dark resources and the Material 2 primary-color path.

Reproduced with the default .NET 10 MAUI template,
`Microsoft.Maui.Controls` 10.0.100, and
`<UseMaterial3>true</UseMaterial3>` on an Android API 36 emulator. The
same app was then rebuilt against this branch's local `Microsoft.Maui`
project.

| Theme | 10.0.100 | This PR |
| --- | --- | --- |
| Light | <img width="270" alt="10.0.100 light mode with unreadable
white status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-light.png">
| <img width="270" alt="Fixed light mode with readable dark status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-light.png">
|
| Dark | <img width="270" alt="10.0.100 dark mode with unreadable black
status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-dark.png">
| <img width="270" alt="Fixed dark mode with readable white status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-dark.png">
|

- Android Core device-test project builds with 0 warnings and 0 errors.
- All three new regression cases pass on an API 36 emulator:
  - Material 3 light surface uses dark icons.
  - Material 3 dark surface uses light icons.
  - Material 2 continues deriving icon contrast from `colorPrimary`.
- Full device run: 3,031 tests executed; the new tests passed. One
unrelated existing Switch pixel-color test failed consistently in both
light and dark emulator modes.
- The implementation and test strategy were challenged by three
independent models and received a final independent code review with no
findings.

@kamano1, when the PR artifacts become available, please try them with
your app and let us know whether they resolve the issue on your Android
15/17 devices.

---------
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
Fixes #37705.

`ConfigureTranslucentSystemBars` started deriving Android status bar
icon appearance from `colorPrimary` in 10.0.100. That remains correct
for the Material 2 app bar and preserves the fix for #32987, but
Material 3 draws `colorSurface` behind its transparent edge-to-edge
status bar. Material 3's primary and surface colors intentionally have
opposite luminance in both day and night themes, which inverted the
status bar icons.

This change uses:

- `colorSurface` for Material 3
- `colorPrimary` for Material 2
- the existing day/night fallback when the theme color cannot be
resolved

It also adds Android device coverage using the real MAUI Material 3
light/dark resources and the Material 2 primary-color path.

Reproduced with the default .NET 10 MAUI template,
`Microsoft.Maui.Controls` 10.0.100, and
`<UseMaterial3>true</UseMaterial3>` on an Android API 36 emulator. The
same app was then rebuilt against this branch's local `Microsoft.Maui`
project.

| Theme | 10.0.100 | This PR |
| --- | --- | --- |
| Light | <img width="270" alt="10.0.100 light mode with unreadable
white status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-light.png">
| <img width="270" alt="Fixed light mode with readable dark status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-light.png">
|
| Dark | <img width="270" alt="10.0.100 dark mode with unreadable black
status bar icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/baseline-dark.png">
| <img width="270" alt="Fixed dark mode with readable white status bar
icons"
src="https://raw.githubusercontent.com/dotnet/maui/a1ff2547464d3592ebe1334e66bbf0b8130876fb/.github/pr-evidence/37705/fixed-dark.png">
|

- Android Core device-test project builds with 0 warnings and 0 errors.
- All three new regression cases pass on an API 36 emulator:
  - Material 3 light surface uses dark icons.
  - Material 3 dark surface uses light icons.
  - Material 2 continues deriving icon contrast from `colorPrimary`.
- Full device run: 3,031 tests executed; the new tests passed. One
unrelated existing Switch pixel-color test failed consistently in both
light and dark emulator modes.
- The implementation and test strategy were challenged by three
independent models and received a final independent code review with no
findings.

@kamano1, when the PR artifacts become available, please try them with
your app and let us know whether they resolve the issue on your Android
15/17 devices.

---------
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-window Window platform/android s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Status bar icons become unreadable when UseMaterial3 is enabled in Microsoft.Maui.Controls 10.0.100