Skip to content

[Android] Restore native theme colors instead of hardcoded defaults for Shell/TabbedPage appearance under Material 3 - #37147

Merged
kubaflo merged 11 commits into
dotnet:inflight/currentfrom
SuthiYuvaraj:shell_pocnull
Sep 18, 2026
Merged

kubaflo merged 11 commits into
dotnet:inflight/currentfrom
SuthiYuvaraj:shell_pocnull

Conversation

@SuthiYuvaraj

Copy link
Copy Markdown
Contributor

Issue Description

When Material 3 is enabled via true, Android Shell top tabs correctly show the selected state, but the selected indicator color does not match the Material 3 tabs specification.

Root Cause

Android Shell/TabbedPage rendering (ShellToolbarAppearanceTracker, ShellTabLayoutAppearanceTracker, ShellBottomNavViewAppearanceTracker, TabbedPageManager) fell back to hardcoded default colors whenever a Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps never displayed correct theme colors on the Shell toolbar, top tabs (TabLayout), or bottom navigation (BottomNavigationView) unless every single color was explicitly set.

Description of Change

  • Each Android tracker captures the platform view's native/theme-provided color or background once, before any custom appearance is ever applied to it.
  • When a Shell.TabBar* color is later cleared back to null (e.g. removing a custom appearance), the tracker restores the originally-captured native value instead of substituting a hardcoded color.
  • This means M3 apps now correctly fall back to their native theme colors — matching platform conventions — rather than being forced into an unrelated hardcoded palette.

Issues Fixed

Fixes #35126

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Case Light Theme Dark Theme
Before Image After Fix
After Image After Fix

@github-actions

github-actions Bot commented Aug 6, 2026

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

Or

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

@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.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 6, 2026
@SuthiYuvaraj SuthiYuvaraj changed the title [Android] Restore native theme colors instead of hardcoded defaults for Shell/TabbedPage appearance under Material 3 [WIP][Android] Restore native theme colors instead of hardcoded defaults for Shell/TabbedPage appearance under Material 3 Aug 6, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@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 10, 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 — 8 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed AI could not verify tests catch the bug 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 11, 2026
@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 Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Warning

Your /review couldn't start: the pipeline branch improved-reviewer doesn't exist. Use --branch improved-reviewer (the current reviewer branch), or omit --branch to run on main. Valid platforms: android, ios, catalyst, windows (e.g. /review android --branch improved-reviewer).

@github-actions github-actions Bot removed the s/agent-review-in-progress AI review is currently running for this PR label Sep 18, 2026
@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 Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15376453 is running for android.

The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

@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 — 2 findings

See inline comments for details.

// using its own DefaultColor as the GetColorForState fallback (matches the pattern used
// by ShellBottomNavViewAppearanceTracker.MakeColorStateList). CaptureNativeColors always
// runs before SetColors on Material3, so _originalTextColors is guaranteed non-null here.
var materialTitleArgb = title?.ToPlatform().ToArgb() ?? _originalTextColors.DefaultColor;

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)

❌ Error — [major] Logic and Correctness — In the Material3 path, both selected and unselected tab text colors fall back to _originalTextColors.DefaultColor when title/unselected are null. Concrete failure: a page that only sets tab bar background (or clears custom colors) collapses selected/unselected states to the same color, so active tab emphasis is lost.


tabbedPage.BarBackgroundColor = null;

Assert.Equal(

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)

❌ Error — [critical] Regression Prevention and Test Coverage — This regression test is non-discriminating: it only asserts selected-state text/icon colors after clearing BarBackgroundColor, and it passed both without and with the fix. It does not exercise the bug condition needed to fail on the unfixed code path, so future regressions in restore behavior can merge undetected.

@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

@SuthiYuvaraj — new AI review results are available based on commit 4b0c039.

Gate Partial Confidence Low Platform Android


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

Gate Result: ❌ FAILED

Platform: ANDROID · Base: inflight/current · Merge base: 8d30bd4f

🩺 Test does not reproduce the bug — ran the same in both states (PASS without fix, PASS with fix). The repro test is not exercising the issue. Strengthen the test before reviewing the fix.

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 TabbedPageTests (ClearingBarBackgroundRestoresMaterial3ThemeColors) Category=TabbedPage ❌ PASS — 1515s ✅ PASS — 504s
🔴 Without fix — 📱 TabbedPageTests (ClearingBarBackgroundRestoresMaterial3ThemeColors): PASS ❌ · 1515s

(no coded error found; showing last 1200 chars)

            "totalMemoryBytes": 8322985984
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 0
  Passed: 1
  Failed: 0
  Skipped: 0
  Total: 1
  Tests completed successfully
🟢 With fix — 📱 TabbedPageTests (ClearingBarBackgroundRestoresMaterial3ThemeColors): PASS ✅ · 504s

(no coded error found; showing last 1200 chars)

            "totalMemoryBytes": 8322985984
          },
          "target": {
            "kind": "emulator",
            "name": "sdk_gphone_x86_64",
            "identifier": "emulator-5554",
            "operatingSystem": "Android",
            "operatingSystemVersion": "11",
            "apiLevel": 30,
            "architecture": "x86_64",
            "supportedArchitectures": [
              "x86_64",
              "x86",
              "arm64-v8a",
              "armeabi-v7a",
              "armeabi"
            ],
            "manufacturer": "Google",
            "model": "sdk_gphone_x86_64",
            "productName": "sdk_gphone_x86_64",
            "buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
            "cpuModel": "0",
            "cpuMaxFrequencyHertz": 2000,
            "totalMemoryBytes": 2077544448
          }
        }
      }
      <<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.controls.devicetests'..
info: Successfully uninstalled com.microsoft.maui.controls.devicetests
XHarness exit code: 0
  Passed: 1
  Failed: 0
  Skipped: 0
  Total: 1
  Tests completed successfully

⚠️ Failure Details

  • ❌ TabbedPageTests (ClearingBarBackgroundRestoresMaterial3ThemeColors) PASSED without fix (should fail) — tests don't catch the bug
📁 Fix files reverted (10 files)
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellBottomNavViewAppearanceTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentFragment.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellTabLayoutAppearanceTracker.cs
  • src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarAppearanceTracker.cs
  • src/Controls/src/Core/Platform/Android/TabbedPageManager.cs
  • src/Controls/src/Core/Shell/Shell.cs
  • src/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/PlatformInterop.java

📋 Pre-Flight — Context & Validation

Issue: #35126 - [Android] Shell top-tab selected indicator color does not align with Material 3 spec
PR: #37147 - [Android] Restore native theme colors instead of hardcoded defaults for Shell/TabbedPage appearance under Material 3
Platforms Affected: Android
Files Changed: 10 implementation, 3 test

Key Findings

  • The bug is that Material 3 Shell top tabs use a selected indicator color that does not match the native Material 3 specification in light and dark themes.
  • The PR replaces hardcoded Material 3 fallbacks with a capture-and-restore strategy across Shell toolbar, top-tab, bottom-navigation, and TabbedPage code. It captures native colors/backgrounds once, restores them when appearance properties are null, removes the forced white Java bottom-navigation background, and reverts shared hardcoded Material 3 defaults.
  • The committed change spans 13 files (+374/-79), including one Android device test and two updated Android snapshots.
  • The gate failed because ClearingBarBackgroundRestoresMaterial3ThemeColors passed both without and with the PR fix. Its Category=TabbedPage run therefore does not prove that the changed Material 3 semantics are exercised.
  • Existing PR discussion identifies risks around one-shot native-value capture becoming stale after runtime theme changes, preserving selected/unselected ColorStateList states, recovering the actual styled tab-indicator color, null capture fallbacks, and breadth beyond the single TabbedPage test.

Code Review Summary

Verdict: SKIPPED
Confidence: N/A
Errors: 0 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • Dedicated expert review is intentionally deferred to STEP 5b by the execution contract; no separate expert-review agent was launched in STEP 5a.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #37147 Capture native Android appearance once and restore it when Shell/TabbedPage appearance values are cleared ❌ Gate failed 10 implementation files Primary device test passed without the fix, so behavior remains unvalidated

🔬 Code Review — Deep Analysis

Code Review — PR #37147

Independent Assessment

What this changes: The Android Shell and TabbedPage paths replace several hardcoded fallback colors with per-view snapshots of native ColorStateList and background values, then restore those snapshots when MAUI appearance values are absent or cleared. The PR also stops forcing a white Shell bottom-navigation background and updates Android snapshots.

Inferred motivation: Preserve Material 3 theme styling for Shell toolbars, top tabs, bottom navigation, and TabbedPage instead of overwriting it with the legacy Material 2 palette.

Reconciliation with PR Narrative

Author claims: Native/theme-provided colors are captured before custom appearance is applied and restored when appearance values return to null.

Agreement/disagreement: The code broadly implements that strategy, but it does not faithfully preserve the native top-tab text state list: selected and unselected labels both fall back to DefaultColor. The submitted regression test also does not prove the claimed behavior because the trusted Gate observed it passing on both the broken baseline and PR head.

Prior Review Reconciliation

Prior finding Status Current-head evidence
ShellContentFragment omitted toolbar capture ✅ Fixed Current ShellContentFragment.OnCreateView calls CaptureNativeColors before registering the appearance observer.
Bottom-navigation reset could write uncaptured null values ✅ Fixed Current ResetAppearance gates native restoration on _originalAppearanceCaptured.
Top-positioned TabbedPage did not restore its native background ✅ Fixed Current TabbedPageManager captures and restores _originalTabLayoutBackground.
Selected and unselected Shell top-tab text collapse to one color ❌ Unresolved ShellTabLayoutAppearanceTracker.SetColors uses _originalTextColors.DefaultColor for both roles.
Nullable native TabTextColors is dereferenced without a fallback ❌ Unresolved _originalTextColors.DefaultColor remains unguarded after capture.
A partial Material 3 toolbar appearance sets toolbarTracker.TintColor to null ❌ Unresolved SetColors uses foreground rather than foreground ?? _originalNativeTitleColor.
The indicator “capture” assumes colorPrimary instead of the styled indicator color ❌ Unresolved CaptureNativeColors resolves Resource.Attribute.colorPrimary; custom tabIndicatorColor styling is not preserved.
One-shot captured values can become stale across an in-place theme change ⚠️ Unresolved risk All three Shell trackers retain one-way capture latches and expose no refresh path.
The regression test is non-discriminating and does not cover the reported Shell top-tab indicator ❌ Unresolved The trusted Gate reports PASS without fix and PASS with fix; the only added test exercises bottom TabbedPage.

Blast Radius Assessment

  • Runs for all instances: The changed appearance plumbing affects every Android Shell or TabbedPage using these renderers; only the fallback behavior is Material 3-specific.
  • Startup impact: No new static initializer was added, but the snapshots are captured during native Shell/TabbedPage view creation and affect initial appearance propagation.
  • Static/shared state: Existing static fallback lists remain; new captured state is instance-scoped.
  • Lifecycle/theme changes: New renderer instances capture independently, but existing trackers have no recapture path if the themed native state changes in place.
  • Null/default values: Null is a normal appearance input. The top-tab path currently assumes a non-null native TabTextColors, and partial toolbar appearance can still propagate a null tint.

CI Status

  • Trusted Gate: ❌ Failed — ClearingBarBackgroundRestoresMaterial3ThemeColors passed both without and with the fix.
  • Current public head: maui-pr is failing, including Windows Debug; the anonymous combined status is pending because other contexts have not completed.
  • Classification: Undetermined under this bounded review; no clean-CI claim is made.

Findings

❌ Error — Material 3 top-tab selected and unselected text states collapse

src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellTabLayoutAppearanceTracker.cs:60

When TitleColor and UnselectedColor are null, both values passed to SetTabTextColors come from _originalTextColors.DefaultColor. A default Material 3 Shell top-tab strip therefore loses the selected-state text contrast that the native ColorStateList supplied. The selected fallback must query the captured selected state, while the unselected fallback should retain the default state; both need a safe theme fallback if the native list is null.

❌ Error — Added regression test does not distinguish the fix

src/Controls/tests/DeviceTests/Elements/TabbedPage/TabbedPageTests.Android.cs:104

The test checks selected-state text/icon values around a BarBackgroundColor change, but those values already remain unchanged on the merge base. The trusted Gate consequently passed the same test in both states. It neither exercises the reported Shell top-tab selected-indicator path nor proves that native Material 3 fallback semantics were restored.

Failure-Mode Probing

  • Partial Shell appearance: With only a background set, null title/unselected colors are rewritten to the same default color, so selected-state emphasis is lost.
  • Custom theme with no resolved tabTextColor: Capture can yield a null TabTextColors; the first partial/default SetAppearance can dereference it.
  • Set then clear: Background snapshots are restored, but selected text-state fidelity is already lost in SetColors; clearing does not recover it unless ResetAppearance replaces the complete native list.
  • Runtime light/dark change without renderer recreation: The one-way capture latches retain the old theme values; this remains an unverified adjacent scenario.
  • Disconnect/reconnect: State is tracker-instance scoped and disposed with the renderer, but no test covers recreation or appearance reset after navigation.

External Output Contract

Not applicable.

Verdict: NEEDS_CHANGES

Confidence: low

The top-tab state-list regression is a concrete correctness defect in platform-specific Shell plumbing, and the submitted test is proven non-discriminating. The broad capture/restore direction is plausible, but the failed Gate, unresolved prior findings, and red/undetermined CI prevent approval.


🛠️ Try-Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 gpt-5.3-codex / try-fix Resolve current Material theme attributes at appearance-application time instead of restoring a one-shot native snapshot ⚠️ BLOCKED None Baseline script rejected the pre-existing dirty harness worktree before implementation
2 gpt-5.6-sol / try-fix Leave unspecified values under native ownership and recreate a themed Android widget when an explicit override is cleared ⚠️ BLOCKED None Same baseline-safety blocker; deliberately avoids both snapshots and dynamic attribute lookup
PR PR #37147 Capture native colors/backgrounds once and restore them when appearance values are cleared ❌ Gate failed 10 implementation files Primary device test passed both without and with the PR fix

Candidate 1 Narrative

Approach: Dynamically resolve Material theme attributes whenever appearance is applied. This differs at the mechanism level from the PR because it avoids cached native ColorStateList/drawable state and would follow live light/dark theme changes.

Diff:

(no code changes applied; blocked before implementation)

Primary test: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=TabbedPage" — NOT RUN.

Regression test: dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "ShellToolbarTests" — NOT RUN because the primary test did not run.

Result: Blocked.

Failure analysis: EstablishBrokenBaseline.ps1 aborted because the worktree contains pre-existing modified harness files. The try-fix restoration contract prohibits manual cleanup, so Candidate 1 made no edits and ran the mandatory restore command, which confirmed no baseline state existed. Inline self-review recorded 0 findings.

Candidate 2 Narrative

Approach: Keep Android in control whenever an appearance value is null. Track only whether MAUI applied an explicit override; on an explicit-to-null transition, recreate the affected toolbar, TabLayout, or bottom-navigation widget through its lifecycle so the current themed context reapplies the complete widget style.

Mechanism-level difference: Unlike PR #37147, Candidate 2 stores no native visual snapshot. Unlike Candidate 1, it synthesizes no value from theme attributes. Recreating the widget would preserve app-specific styles, selected/unselected state lists, and the actual styled indicator under the current theme.

Diff:

(no code changes applied; blocked before implementation)

Primary test: pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform android -TestFilter "Category=TabbedPage" — NOT RUN.

Regression test: dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --filter "ShellToolbarTests" — NOT RUN because the primary test did not run.

Result: Blocked.

Failure analysis: Candidate 2 encountered the same pre-existing dirty harness worktree. Without .github/.baseline-state.json and its RevertedFiles allow-list, implementation would violate restoration safety. It made no edits, ran the mandatory restore command, and recorded 0 inline self-review findings.

Cross-Pollination

Skipped by the STEP 5a execution contract.

Exhausted: Yes — both permitted model attempts were invoked once; no cross-pollination or follow-up agents were launched.
Selected Fix: None — both alternatives were blocked before implementation or testing, and the PR fix remains unvalidated because the gate test is non-discriminating.


🏁 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Winner: pr

The raw submitted PR is the winner only by elimination: it is the sole fully implemented candidate that was not blocked before implementation and did not introduce a known compile failure. It is not ready to approve. The trusted Gate failed because its regression test passed both without and with the fix, and the expert review found a concrete Material 3 top-tab state regression plus unresolved adjacent risks.

Comparative ranking

Rank Candidate Approach Validation evidence Decision
1 pr Capture native Android Shell/TabbedPage colors and backgrounds once, then restore them when appearance values are null or cleared. Gate ❌ FAILED: ClearingBarBackgroundRestoresMaterial3ThemeColors passed on both baseline and PR head. Current public maui-pr is red/undetermined. Best available implemented candidate, but selected/unselected Shell top-tab text states collapse and the test does not prove the fix.
2 pr-plus-reviewer Raw PR plus lazy/null-safe top-tab capture, distinct selected/default state restoration, aligned toolbar tint fallback, and a focused Material 3 state-list test. Primary ❌ FAIL: Android device-test project did not compile (CS1503, int cannot convert to Android.Graphics.Color). Ordered regressions were not eligible. Directionally improves the expert findings, but a non-compiling candidate cannot displace the raw PR. No repair/retest loop was permitted.
3 try-fix-1 Resolve current Material theme attributes at appearance-application time rather than restoring a one-shot snapshot. ⚠️ BLOCKED: no implementation, primary test, or regressions; baseline establishment rejected the dirty harness worktree. Plausible response to stale theme snapshots, but there is no candidate diff or empirical evidence.
4 try-fix-2 Leave null appearance values under native ownership and recreate affected native widgets after an explicit override is cleared. ⚠️ BLOCKED: no implementation, primary test, or regressions; same baseline-safety blocker. Unvalidated and carries the largest renderer lifecycle/rebinding risk.

No candidate passed the required regression tests. The raw PR's Gate failure is a test-validity failure rather than evidence that production behavior is correct; pr-plus-reviewer failed before tests executed; both try-fix-* candidates were blocked before implementation.

Regression-risk cross-reference

The deterministic regression scan reports OVERLAP, not REVERT: Shell.cs also intersects #36673, which fixed #36562, but only on different lines (revert_count: 0). Its mapped ShellToolbarTests regression remains relevant; it was not run for pr-plus-reviewer because the ordered primary Android command failed compilation.

Expert finding reconciliation

The sole expert-review path wrote two inline errors:

  1. ShellTabLayoutAppearanceTracker.SetColors uses _originalTextColors.DefaultColor for both selected and unselected Material 3 labels. With a partial/default appearance, active and inactive top-tab text becomes indistinguishable.
  2. The submitted Android device test is non-discriminating. The trusted Gate proves the assertion passes without the production fix and the test does not exercise the reported Shell top-tab indicator path.

Prior review surfaces show that the current head fixed earlier omissions for ShellContentFragment toolbar capture, uncaptured bottom-navigation reset, and top-positioned TabbedPage background restoration. Still unresolved are the nullable TabTextColors dereference, null toolbar tracker tint on partial appearance, colorPrimary standing in for an app-styled indicator color, one-shot theme snapshot staleness, and broader Shell/Material 2 coverage.

Why pr-plus-reviewer did not win

Its design is the strongest of the refinements because it preserves the native text-state distinction and makes capture self-contained. However, the one allowed Android command exposed a binding-type error before execution. The hard execution contract forbids correcting and rerunning it, and candidates with known build failures must rank below an otherwise buildable submitted change.

Required changes before approval

  • Preserve the selected entry from the native top-tab ColorStateList instead of assigning DefaultColor to both states, with a null-safe fallback compatible with the Android binding type.
  • Add a baseline-discriminating Android regression test for the actual Shell top-tab selected indicator/text-state behavior; it must not green-pass by returning when Material 3 is disabled.
  • Reconcile the remaining prior-review risks, especially partial toolbar tinting, custom tabIndicatorColor, and runtime theme changes.
  • Run the overlap-mapped ShellToolbarTests after the primary Android validation succeeds.
  • Obtain a passing Gate and required CI evidence.

Final rationale

pr wins the comparison because every alternative is either non-compiling or unimplemented, so winner.json identifies it as the PR fix. The failed Gate and concrete expert error make APPROVE impermissible; the submitted PR needs changes even though no current candidate safely supersedes it.


🔗 Regression Cross-Reference

🔍 Regression Cross-Reference

⚠ Overlaps with prior bug-fix PRs — same files modified, but no exact line revert detected.

File Fix PR Fixed issue(s)
src/Controls/src/Core/Shell/Shell.cs #36673 #36562

🧪 Regression Tests to Verify

These tests were added by the overlapping fix PRs. Running them to verify no side-effect regressions:

Fix PR Type Test Filter
#36673 UnitTest ShellToolbarTests ShellToolbarTests

🧪 Regression Test Results

✅ PASSED — 1 passed, 0 failed, 0 skipped

Fix PR Test Type Result
#36673 ShellToolbarTests UnitTest ✅ PASSED

📱 UI Tests — Shell

Detected UI test categories: Shell

❌ Deep UI tests — 336 passed, 2 failed, 13 skipped across 1 category on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Shell 336/351 (2 ❌, 13 skipped) —
🔍 AI analysis of failures — PR-related vs unrelated

🔍 AI-generated triage (GitHub Copilot CLI) — a heuristic judgement of whether each deep UI test failure is connected to this PR's changes. Verify before relying on it.

Likely unrelated: the failures appear pre-existing, flaky, or infrastructure.

  • ● Unrelated — Shell setup/state element-discovery timeouts (~2 tests): Both fail in generic WaitForElement setup locators—one before clear/recreate begins and one on the Options button in an explicitly order-dependent suite—without an exception or assertion tied to the PR's Android Shell appearance/background changes.
❌ Shell — 2 failed tests
ClearAndRecreateShellElements
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2790
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2817
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 826
   at Microsoft.Maui.TestCases.Tests.Issues.ShellItemIsVisible.ClearAndRecreateShellElements() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellItemIsVisible.cs:line 66
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* arg
...
VerifyShellSearch_IsSearchEnabledFalse
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2790
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2817
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 826
   at Microsoft.Maui.TestCases.Tests.ShellSearchHandlerFeatureTests.OpenOptions() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ShellSearchHandlerFeatureTests.cs:line 47
   at Microsoft.Maui.TestCases.Tests.ShellSearchHandlerFeatureTests.VerifyShellSearch_IsSear
...

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Sep 18, 2026
@kubaflo
kubaflo merged commit 56907ac into dotnet:inflight/current Sep 18, 2026
37 of 41 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Sep 18, 2026
kubaflo pushed a commit that referenced this pull request Sep 18, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Sep 21, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Sep 27, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Sep 27, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 3, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 3, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 6, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 6, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 13, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 13, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 14, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 14, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 18, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
kubaflo pushed a commit that referenced this pull request Oct 18, 2026
…or Shell/TabbedPage appearance under Material 3 (#37147)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Description
When Material 3 is enabled via <UseMaterial3>true</UseMaterial3>,
Android Shell top tabs correctly show the selected state, but the
selected indicator color does not match the Material 3 tabs
specification.

### Root Cause

Android Shell/TabbedPage rendering (`ShellToolbarAppearanceTracker`,`
ShellTabLayoutAppearanceTracker`, `ShellBottomNavViewAppearanceTracker`,
`TabbedPageManager`) fell back to hardcoded default colors whenever a
Shell.TabBar*/appearance color property was null.

Under Material 3, this hardcoded fallback overrode the native M3 theme's
own default colors (colorPrimary, colorOnSurface, etc.), so M3 apps
never displayed correct theme colors on the Shell toolbar, top tabs
(TabLayout), or bottom navigation (BottomNavigationView) unless every
single color was explicitly set.

### Description of Change

- Each Android tracker captures the platform view's
native/theme-provided color or background once, before any custom
appearance is ever applied to it.
- When a `Shell.TabBar*` color is later cleared back to null (e.g.
removing a custom appearance), the tracker restores the
originally-captured native value instead of substituting a hardcoded
color.
- This means M3 apps now correctly fall back to their native theme
colors — matching platform conventions — rather than being forced into
an unrelated hardcoded palette.

### Issues Fixed
Fixes #35126 

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Case| Light Theme | Dark Theme |
|----------|----------|----------|
| **Before**|<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/e8a6cc5f-5101-4d8d-9f0b-b199710b5da8">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/23b6e57c-34fd-48d3-8c92-0b18f2df4ea9">|
| **After** |<image width="100" height="200" alt="Image"
src="https://github.com/user-attachments/assets/d732e3bc-6a53-4cd8-93a9-c559576d0d5c">|<image
width="100" height="200" alt="After Fix" src
="https://github.com/user-attachments/assets/9c6ebe0f-b7ce-4d24-8d76-cad6f25cd785">|
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-shell community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-failed AI could not verify tests catch the bug 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] Shell top-tab selected indicator color does not align with Material 3 spec

5 participants