Skip to content

[Android] Fix AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled#35121

Merged
kubaflo merged 4 commits into
dotnet:inflight/currentfrom
HarishwaranVijayakumar:m3-alertdialogs
Apr 27, 2026
Merged

[Android] Fix AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled#35121
kubaflo merged 4 commits into
dotnet:inflight/currentfrom
HarishwaranVijayakumar:m3-alertdialogs

Conversation

@HarishwaranVijayakumar

@HarishwaranVijayakumar HarishwaranVijayakumar commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Note

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

Issue Details:

  • When Material 3 (M3) is enabled, dialogs such as AlertDialog, ActionSheet, and PromptDialog still appear to use Material 2 (M2) styles.

Description of Change

Android Dialog Rendering Updates:

  • Updated the DialogBuilder logic in AlertManager.Android.cs to use MaterialAlertDialogBuilder with a Material 3 theme wrapper when Material 3 is enabled, ensuring dialogs have M3 styling such as rounded corners and updated typography.
  • Added the necessary import for Google.Android.Material.Dialog to support the use of MaterialAlertDialogBuilder.

Testing:

  • Added a new test page, Issue35119, to manually verify that dialogs render with M3 styling when enabled. This page provides buttons to trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the results.
  • Introduced a new automated UI test in TestCases.Shared.Tests/Tests/Issues/Issue35119.cs to validate that dialogs appear with the expected Material 3 styling, using screenshots for verification.

Issues Fixed

Fixes #35119

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - iOS
  • - Mac
Title Before After
AlertDialog
ActionSheet
PromptDialog

kubaflo and others added 3 commits April 23, 2026 09:17
…tnet#34994)

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

Integrates the standalone `code-review` skill into the `pr-review`
orchestrator so that deep code analysis happens during Pre-Flight and
its findings feed into Try-Fix exploration.

### Changes

**Pre-Flight (Phase 1)** — `.github/pr-review/pr-preflight.md`
- Added Part B (Step 7): Invokes code-review skill as an independent
sub-agent
- Independence-first principle preserved — sub-agent receives only the
PR number, not Part A context
- Outputs both `content.md` (context + code review summary) and
`code-review.md` (full review)

**Try-Fix (Phase 2)** — `.github/skills/pr-review/SKILL.md`
- Try-fix prompt template now includes `code_review_findings` (errors,
warnings, failure modes, blast radius)
- Findings are advisory hints — inform approach, not a mandatory
checklist
- Only root-cause-relevant findings included to avoid distraction

**Report (Phase 3)** — `.github/pr-review/pr-report.md`
- Code Review row added to Phase Status table
- Hard gate: `NEEDS_CHANGES` verdict blocks `APPROVE` regardless of
Gate/Try-Fix
- New "Code Review Impact on Try-Fix" section

**AI Summary** — `.github/scripts/post-ai-summary-comment.ps1`
- Full code-review output shown as separate "🔬 Code Review — Deep
Analysis" collapsible section
- Gracefully skipped if `code-review.md` does not exist

### Design decisions
- The `code-review` skill itself is NOT modified — stays standalone and
independently invokable
- The `try-fix` skill is NOT modified — already accepts hints
- Code review runs as a sub-agent to prevent anchoring bias
(independence-first)
- Report hard gate prevents approving PRs with unresolved code review
errors

---------

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

github-actions Bot commented Apr 24, 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 -- 35121

Or

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

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Apr 24, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 24, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review April 24, 2026 07:27
Copilot AI review requested due to automatic review settings April 24, 2026 07:27
@sheiksyedm

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

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

This PR updates Android dialog creation so that MAUI’s DisplayAlert, DisplayActionSheet, and DisplayPromptAsync use Material 3 dialog styling when <UseMaterial3>true</UseMaterial3> is enabled, aligning dialogs with the rest of the M3-themed controls.

Changes:

  • Use MaterialAlertDialogBuilder (with MAUI’s Material context theme wrapper) for AppCompat-based dialogs when Material 3 is enabled.
  • Add a HostApp issue page (Issue35119) to manually exercise Alert/ActionSheet/Prompt dialogs under Material 3.
  • Add a Material3-category UI test (Issue35119) that verifies dialog visuals via screenshots.

Reviewed changes

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

File Description
src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs Switches dialog builder to MaterialAlertDialogBuilder under Material 3 to ensure M3 styling.
src/Controls/tests/TestCases.HostApp/Issues/Issue35119.cs Adds a repro page with buttons to open Alert, ActionSheet, and Prompt dialogs for manual validation.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35119.cs Adds an automated Material3 UI test that captures/compares screenshots for the three dialogs.

Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35119.cs Outdated
Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue35119.cs Outdated

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

Looks like the test will run on all platforms - can you add snapshots then?

@kubaflo

kubaflo commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from MauiBot Apr 25, 2026
@MauiBot

MauiBot commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI Summary

👋 @HarishwaranVijayakumar — new AI review results are available. Please review the latest session below.

📊 Review Session3a574d5 · Modify test · 2026-04-26 02:18 UTC
🚦 Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: ANDROID · Base: main · Merge base: 388b82f1

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue35119 Issue35119 ✅ FAIL — 558s ❌ FAIL — 561s
🔴 Without fix — 🖥️ Issue35119: FAIL ✅ · 558s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:07:12.01
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.44]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/26/2026 00:51:17 FixtureSetup for Issue35119(Android)
>>>>> 04/26/2026 00:51:20 DialogsRenderWithM3Styling Start
>>>>> 04/26/2026 00:51:29 DialogsRenderWithM3Styling Stop
>>>>> 04/26/2026 00:51:29 Log types: logcat, bugreport, server
  Failed DialogsRenderWithM3Styling [10 s]
  Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 412
   at UITest.Appium.HelperExtensions.<>c__DisplayClass2_0.<Tap>b__0() in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 36
   at UITest.Appium.HelperExtensions.<>c__DisplayClass186_0.<RunWithTimeout>b__0() in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3075
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UITest.Appium.HelperExtensions.RunWithTimeout[T](Func`1 action, Nullable`1 timeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3063
   at UITest.Appium.HelperExtensions.RunWithTimeout(Action action, Nullable`1 timeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3075
   at UITest.Appium.HelperExtensions.Tap(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 36
   at Microsoft.Maui.TestCases.Tests.Issues.Issue35119.DialogsRenderWithM3Styling() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35119.cs:line 28
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

NUnit Adapter 4.5.0.0: Test execution complete

Test Run Failed.
Total tests: 1
     Failed: 1
 Total time: 27.8518 Seconds

🟢 With fix — 🖥️ Issue35119: FAIL ❌ · 561s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:07:07.33
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.13938661
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.51]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/26/2026 01:00:32 FixtureSetup for Issue35119(Android)
>>>>> 04/26/2026 01:00:34 DialogsRenderWithM3Styling Start
>>>>> 04/26/2026 01:00:50 DialogsRenderWithM3Styling Stop
>>>>> 04/26/2026 01:00:51 Log types: logcat, bugreport, server
  Failed DialogsRenderWithM3Styling [16 s]
  Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 412
   at UITest.Appium.HelperExtensions.<>c__DisplayClass2_0.<Tap>b__0() in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 36
   at UITest.Appium.HelperExtensions.<>c__DisplayClass186_0.<RunWithTimeout>b__0() in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3075
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UITest.Appium.HelperExtensions.RunWithTimeout[T](Func`1 action, Nullable`1 timeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3063
   at UITest.Appium.HelperExtensions.RunWithTimeout(Action action, Nullable`1 timeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 3075
   at UITest.Appium.HelperExtensions.Tap(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 36
   at Microsoft.Maui.TestCases.Tests.Issues.Issue35119.DialogsRenderWithM3Styling() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35119.cs:line 34
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

NUnit Adapter 4.5.0.0: Test execution complete

Test Run Failed.
Total tests: 1
     Failed: 1
 Total time: 35.7369 Seconds

⚠️ Issues found
  • Issue35119 FAILED with fix (should pass)
    • DialogsRenderWithM3Styling [16 s]
    • System.NullReferenceException : Object reference not set to an instance of an object.
📁 Fix files reverted (1 files)
  • src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs

🧪 UI Tests — Category Detection

Detected UI test categories: Material3


🔍 Pre-Flight — Context & Validation

Issue: #35119 - [Android] AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled
PR: #35121 - [Android] Fix AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled
Platforms Affected: Android only
Files Changed: 1 implementation, 5 test (3 snapshot PNGs + 2 CS test files)

Key Findings

  • Root cause: DialogBuilder in AlertManager.Android.cs always used AppCompatAlertDialog.Builder, which produces M2-styled dialogs even when M3 is enabled via RuntimeFeature.IsMaterial3Enabled
  • Fix: Guard on RuntimeFeature.IsMaterial3Enabled — use MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create(activity)) when M3 is enabled
  • This pattern is consistent with how PickerHandler2.Android.cs uses MaterialAlertDialogBuilder (though without the outer guard)
  • Gate FAILED: Test fails with fix due to NullReferenceException at App.Tap("ShowPromptButton") — ActionSheet not fully dismissed before next tap; also missing android/ snapshot baselines
  • Prior inline review comments flag: buttonIndex: 1 on TapDisplayAlertButton("Cancel", buttonIndex: 1) is ignored on Android (only used on MacCatalyst)

Edge Cases

  • M2 fallback path still uses AppCompatAlertDialog.Builder (unchanged — correct)
  • MauiMaterialContextThemeWrapper.Create(activity) handles context wrapping safely (returns existing wrapper if already wrapped)
  • The fix applies to all three dialog types (Alert, ActionSheet, Prompt) — they all share the DialogBuilder abstraction

Impacted UI Test Categories

  • ActionSheet — PR changes ActionSheet dialog rendering
  • DisplayAlert — PR changes Alert dialog rendering

Code Review Summary

Verdict: NEEDS_CHANGES
Confidence: high
Errors: 1 | Warnings: 2 | Suggestions: 1

Key code review findings:

  • ❌ Missing android/AlertDialog.png, android/ActionSheet.png, android/PromptDialog.png snapshot baselines — only android-notch-36/ variants added
  • ⚠️ Single test method testing 3 independent dialog behaviors — should be split into 3 separate [Test] methods
  • ⚠️ CI maui-pr macOS Debug build failing (appears pre-existing, not caused by this PR)
  • 💡 if (IsMaterial3Enabled) guard is redundant since MauiMaterialContextThemeWrapper already checks IsMaterial3Enabled internally — consider aligning with PickerHandler2 pattern (no outer guard)

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35121 Use MaterialAlertDialogBuilder + MauiMaterialContextThemeWrapper.Create(activity) when M3 enabled ❌ FAILED (Gate) AlertManager.Android.cs Core logic correct; test has defects

🔬 Code Review — Deep Analysis

Code Review — PR #35121

Independent Assessment

What this changes: A single guarded branch is added inside DialogBuilder(Activity activity) — when RuntimeFeature.IsMaterial3Enabled is true, MaterialAlertDialogBuilder (wrapped in MauiMaterialContextThemeWrapper.Create(activity)) is used instead of AppCompatAlertDialog.Builder. The non-M3 path is unchanged. A new _IssuesUITest-based test page and screenshot test are also added.

Inferred motivation: The dialog builder previously always used AppCompatAlertDialog.Builder, which produces M2-styled dialogs. Callers that enabled M3 would see the rest of the app in M3 styling but dialogs still in M2 — a visual regression when M3 is opted in.


Reconciliation with PR Narrative

Author claims: When M3 is enabled, AlertDialog, ActionSheet, and Prompt dialogs render with M2 styles. Fix by using MaterialAlertDialogBuilder + M3 theme wrapper.

Agreement/disagreement: Code matches the claim. The fix is minimal and conservative — only the M3-enabled path changes, minimising regression risk. One point worth noting: the fix uses MauiMaterialContextThemeWrapper.Create(activity) which itself already inspects IsMaterial3Enabled and picks the correct theme resource; the outer if (IsMaterial3Enabled) guard in the diff is therefore partially redundant (the wrapper would apply M3 theme correctly either way), but keeping it as a structural gate so MaterialAlertDialogBuilder is not used at all in the M2 path is a deliberate conservative choice.


Findings

❌ Error — Missing snapshot baselines for android/ (non-notch) configuration

src/Controls/tests/TestCases.Android.Tests/snapshots/ has two directories: android/ and android-notch-36/. The PR only adds baselines under android-notch-36/. When the CI test job runs on a standard non-notch Android agent (API 30 etc.), VerifyScreenshotOrSetException will look for android/AlertDialog.png, android/ActionSheet.png, and android/PromptDialog.png — none of which exist. This will produce a baseline-missing failure at runtime.

snapshots/
  android/               ← AlertDialog.png, ActionSheet.png, PromptDialog.png  MISSING
  android-notch-36/      ← AlertDialog.png, ActionSheet.png, PromptDialog.png  ✅ added

The android/ baselines must be added alongside the android-notch-36/ ones.


⚠️ Warning — Single test method exercises three independent dialog types

DialogsRenderWithM3Styling in TestCases.Shared.Tests/Tests/Issues/Issue35119.cs drives three separate dialogs (Alert, ActionSheet, Prompt) and uses a deferred-exception pattern to continue after each screenshot. Per the review rules, tests that verify independent behaviors should be split into separate methods so failures pinpoint the exact regression.

Suggested split:

[Test] AlertDialogRenderWithM3Styling()
[Test] ActionSheetRenderWithM3Styling()
[Test] PromptDialogRenderWithM3Styling()

⚠️ Warning — CI: maui-pr (Build .NET MAUI Build macOS (Debug)) failing

The required maui-pr check is failing, with the macOS Debug build job failing while macOS Release passes. Since this PR only modifies Android-specific code (AlertManager.Android.cs) and Android-specific test snapshots, the failure appears pre-existing rather than caused by this PR. However, per policy this must be confirmed (e.g., by checking whether the same failure exists on main or an adjacent PR) before the PR is merged.


💡 Suggestion — Consistency with PickerHandler2 pattern

PickerHandler2.Android.cs (line 175) always uses MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create(Context)) without an IsMaterial3Enabled guard — the wrapper already selects the correct base theme. The PR introduces a different pattern (explicit if (IsMaterial3Enabled) guard at the call site). Both are correct, but the inconsistency may confuse future contributors. Consider aligning to the established pattern (no outer guard needed).


Devil's Advocate

  • Is the M3 gate really needed? The wrapper handles theming internally; MaterialAlertDialogBuilder with Maui_MainTheme_Base should render as M2. The explicit guard is redundant but harmless, and deliberately avoids touching the non-M3 path — reasonable for a bug fix.
  • Does MaterialAlertDialogBuilder.Create() return an AppCompatAlertDialog? Yes — MaterialAlertDialogBuilder extends AppCompatAlertDialog.Builder; its Create() returns a MaterialAlertDialog which extends AppCompatAlertDialog. The existing code is fully compatible.
  • Am I missing a platform-behavior concern? The change is Android-only (AlertManager.Android.cs). iOS/macOS/Windows are unaffected.

Verdict: NEEDS_CHANGES

Confidence: high

Summary: The core logic change (4 lines in DialogBuilder) is correct, safe, and uses established infrastructure. However, snapshot baselines are missing for the standard android/ CI configuration — this will cause test failures on non-notch Android agents. The test also has a reliability issue (no wait after ActionSheet dismissal before tapping ShowPromptButton) that causes the gate failure with the PR's fix applied.


🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35121 MaterialAlertDialogBuilder with IsMaterial3Enabled guard ❌ FAILED (Gate) AlertManager.Android.cs Core logic correct; test has defects (NRE, missing snapshots)
1 try-fix (claude-opus-4.6) Remove guard — always use MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create()) + WaitForElement + remove buttonIndex:1 + android/ snapshots ✅ PASS AlertManager.Android.cs, Issue35119.cs, 3 snapshots Simpler code; consistent with PickerHandler2 pattern
2 try-fix (claude-sonnet-4.6) Kept PR's guard + split into 3 separate [Test] methods with try/finally + android/ baselines ✅ PASS AlertManager.Android.cs, Issue35119.cs, 3 snapshots Better test isolation; production code matches PR
3 try-fix (gpt-5.3-codex) Kept PR's guard + kept single test + App.Back() for ActionSheet dismissal + WaitForElement sync + android/ snapshots ✅ PASS AlertManager.Android.cs, Issue35119.cs, 3 snapshots App.Back() for ActionSheet dismissal
4 try-fix (gpt-5.4) Kept PR's guard + WaitForElement("StatusLabel") text sync after each dismiss + android/ snapshots ✅ PASS AlertManager.Android.cs, Issue35119.cs, 3 snapshots App state-machine sync via statusLabel

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 2 No "Solution space well-covered; no novel fix direction"

Exhausted: Yes

Selected Fix: Candidate #1 (Attempt 1 — claude-opus-4.6)

Reason: Simplest production code (no conditional guard — removes branching), most consistent with codebase pattern (PickerHandler2.Android.cs already uses MaterialAlertDialogBuilder without guard), minimal test change (add 2 WaitForElement calls, remove erroneous buttonIndex: 1). Code review specifically flagged the redundant IsMaterial3Enabled guard as a suggestion.

The best approach for the author to incorporate:

  1. Production code: Replace the if (IsMaterial3Enabled) block with a single unconditional line: _appcompatBuilder = new MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create(activity));
  2. Test: Add App.WaitForElement("ShowActionSheetButton") before ActionSheet tap, add App.WaitForElement("ShowPromptButton") before Prompt tap, change TapDisplayAlertButton("Cancel", buttonIndex: 1) to TapDisplayAlertButton("Cancel")
  3. Snapshots: Add android/AlertDialog.png, android/ActionSheet.png, android/PromptDialog.png (captured from API30 emulator)

📋 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #35119, PR #35121 — Android-only M3 dialog fix
Code Review NEEDS_CHANGES (high confidence) 1 error, 2 warnings
Gate ❌ FAILED Android — test fails WITH fix (NullReferenceException + missing snapshots)
Try-Fix ✅ COMPLETE 4 attempts, 4 passing — gemini-3-pro-preview unavailable, used gpt-5.4
Report ✅ COMPLETE

Code Review Impact on Try-Fix

The code review's ❌ Error (missing android/ snapshot baselines) directly guided all 4 try-fix attempts to add the correct baselines. The ⚠️ Warning about buttonIndex: 1 being ignored on Android was addressed by Attempts 1 and 3 (removed/fixed). The 💡 Suggestion to remove the IsMaterial3Enabled guard was adopted by Attempt 1 (the selected best fix), which produced simpler, more consistent code aligned with PickerHandler2.Android.cs.

Summary

PR #35121 fixes a real bug: Android dialogs (Alert, ActionSheet, Prompt) render with M2 styles even when M3 is enabled. The production code fix (using MaterialAlertDialogBuilder) is conceptually correct. However:

  1. The test has a NullReferenceException caused by missing WaitForElement before tapping page elements after dialog dismissal
  2. Three required snapshot baselines (android/AlertDialog.png, android/ActionSheet.png, android/PromptDialog.png) are missing — only android-notch-36/ variants were added
  3. buttonIndex: 1 in TapDisplayAlertButton("Cancel", buttonIndex: 1) is ignored on Android (MacCatalyst-only parameter)

Try-Fix found a better production fix (Candidate #1): remove the redundant IsMaterial3Enabled guard and always use MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create(activity)). This is simpler and consistent with the established codebase pattern (PickerHandler2.Android.cs line 175).

Root Cause

DialogBuilder in AlertManager.Android.cs always used AppCompatAlertDialog.Builder, which produces M2-styled dialogs. Other M3-aware handlers (PickerHandler2, SwitchHandler2, SliderHandler2) already use MaterialAlertDialogBuilder with MauiMaterialContextThemeWrapper. Dialogs were missed in the M3 rollout.

Fix Quality

The PR's production fix works but has structural redundancy (outer IsMaterial3Enabled guard when MauiMaterialContextThemeWrapper already handles it internally). Try-Fix Candidate #1 improves on this with a single unconditional line — same correctness, simpler code, better consistency.

Required changes for the PR author:

  1. Production code (AlertManager.Android.cs): Replace the if (IsMaterial3Enabled) block with a single line:

    _appcompatBuilder = new MaterialAlertDialogBuilder(MauiMaterialContextThemeWrapper.Create(activity));

    (Remove the if/else guard entirely)

  2. Test (TestCases.Shared.Tests/Tests/Issues/Issue35119.cs):

    • Add App.WaitForElement("ShowActionSheetButton"); before tapping ShowActionSheetButton
    • Add App.WaitForElement("ShowPromptButton"); before tapping ShowPromptButton
    • Change App.TapDisplayAlertButton("Cancel", buttonIndex: 1);App.TapDisplayAlertButton("Cancel");
  3. Snapshots: Add android/AlertDialog.png, android/ActionSheet.png, android/PromptDialog.png captured from API30 emulator (non-notch configuration)

Selected Fix: Candidate #1 (Attempt 1) — removes redundant guard, simplest solution, 4 passing tests


@MauiBot MauiBot added s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Apr 26, 2026
@HarishwaranVijayakumar

Copy link
Copy Markdown
Contributor Author

Looks like the test will run on all platforms - can you add snapshots then?

I have now restricted the test to Android only

@kubaflo kubaflo changed the base branch from main to inflight/current April 27, 2026 15:08
@kubaflo kubaflo merged commit a0be7b7 into dotnet:inflight/current Apr 27, 2026
25 of 33 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR7 milestone Apr 27, 2026
PureWeen pushed a commit that referenced this pull request Apr 28, 2026
…al 2 styles when Material 3 is enabled (#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes #35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Apr 29, 2026
…al 2 styles when Material 3 is enabled (#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes #35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions Bot pushed a commit that referenced this pull request May 6, 2026
…al 2 styles when Material 3 is enabled (#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes #35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo added s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-suggestions-implemented Maintainer applies when PR author adopts agent's recommendation and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels May 20, 2026
github-actions Bot pushed a commit that referenced this pull request May 25, 2026
…al 2 styles when Material 3 is enabled (#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes #35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen mentioned this pull request Jun 2, 2026
PureWeen added a commit that referenced this pull request Jun 2, 2026
## What's Coming

.NET MAUI inflight/candidate introduces significant improvements across
all platforms with focus on quality, performance, and developer
experience. This release includes 85 commits with various improvements,
bug fixes, and enhancements.


## Button
- [Android, iOS] Button: Fix VisualState properties not restored when
leaving custom state by @BagavathiPerumal in
#33346
  <details>
  <summary>🔧 Fixes</summary>

- [Button VisualStates do not
work](#19690)
  </details>

## CollectionView
- Fix CollectionView grid spacing updates for first row and column by
@KarthikRajaKalaimani in #34527
  <details>
  <summary>🔧 Fixes</summary>

- [[MAUI] I2_Vertical grid for horizontal Item Spacing and Vertical Item
Spacing - horizontally updating the spacing only applies to the second
column](#34257)
  </details>

- CarouselView: Fix cascading PositionChanged/CurrentItemChanged events
on collection update by @praveenkumarkarunanithi in
#31275
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] CurrentItemChangedEventArgs and PositionChangedEventArgs
Not Working Properly in
CarouselView](#29529)
  </details>

- [Windows] Fixed ItemSpacing doesn't work in Carousel View by
@SubhikshaSf4851 in #30014
  <details>
  <summary>🔧 Fixes</summary>

- [ItemSpacing on CarouselView is not applied on
Windows.](#29772)
  </details>

- Fix CollectionView not scrolling to top on iOS status bar tap by
@jfversluis in #34687
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] UICollectionView ScrollToTop does not
work](#19866)
  </details>

- [iOS] Fixed CollectionView Scroll Jitter for TextType HTML Labels by
@SubhikshaSf4851 in #34383
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView scrolling is jittery when ItemTemplate contains Label
with TextType="Html" in .NET
10](#33065)
  </details>

- Fix CollectionView Header is not visible when ItemsSource is not set
and an EmptyView is set in iOS, Mac platform by @KarthikRajaKalaimani in
#34989
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView Header is not visible when ItemsSource is not set and
EmptyView is set in iOS, Mac
platform](#34897)
  </details>

- [Android] Fix CollectionView EmptyView not displayed correctly by
@KarthikRajaKalaimani in #34956
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] CollectionView - EmptyView not displayed
correctly](#34861)
  </details>

- [iOS] Fix CollectionView ScrollOffset not resetting when ItemsSource
changes by @SyedAbdulAzeemSF4852 in
#34488
  <details>
  <summary>🔧 Fixes</summary>

- [[IOS] CollectionView ScrollOffset does not reset when the ItemSource
is changed in iOS.](#26366)
- [Re-enable Issue7993 test on iOS/Catalyst - CollectionView scroll
position not reset when updating
ItemsSource](#33500)
  </details>

- [Revert] [iOS] Fixed CollectionView Scroll Jitter for TextType HTML
Labels by @SubhikshaSf4851 in #35341

## Core Lifecycle
- [Android] Fix NRE in ContainerView when Android Context is null during
lifecycle transition by @rmarinho in
#34901
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] NullReferenceException in NavigationRootManager.Connect
when mapping Window
content](#34900)
  </details>

## DateTimePicker
- [Android] Fix for TimePicker Dialog doesn't update the layout when
rotating the device with dialog open by @HarishwaranVijayakumar in
#31910
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] TimePicker Dialog doesn't update the layout when rotating
the device with dialog
open](#31658)
  </details>

- [Android, iOS] Fixed TimePicker FlowDirection Not Applied Across
Platforms by @Dhivya-SF4094 in #30369
  <details>
  <summary>🔧 Fixes</summary>

- [TimePicker FlowDirection Not Working on All
Platforms](#30192)
  </details>

- [Windows] Fixed TimePicker CharacterSpacing issue by @SubhikshaSf4851
in #30533
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] TimePicker CharacterSpacing Property Not Working on
Windows](#30199)
  </details>

- [MacCatalyst] Fix DatePicker Opened/Closed events not being raised by
@SubhikshaSf4851 in #34970
  <details>
  <summary>🔧 Fixes</summary>

- [[MacCatalyst] DatePicker Opened and Closed events are not raised on
Mac platform](#34848)
  </details>

## Dialogalert
- [Android] Fix AlertDialog, ActionSheet, and Prompt render with
Material 2 styles when Material 3 is enabled by @HarishwaranVijayakumar
in #35121
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] AlertDialog, ActionSheet, and Prompt render with Material 2
styles when Material 3 is
enabled](#35119)
  </details>

## Docs
- docs: Add UITesting-Guide, ReleasePlanning, and ReleaseProcess to
docs/README.md index by @PureWeen in
#35195

- docs: Fix hardcoded path and add library overview in Essentials.AI
README by @PureWeen in #35194

- docs: Update branch reference from net10.0 to net11.0 in
DEVELOPMENT.md by @PureWeen in #35193

## Drawing
- Fix Path Rendering Issue Inside StackLayout When Margin Is Set by
@Shalini-Ashokan in #28071
  <details>
  <summary>🔧 Fixes</summary>

- [Path does not render if it has
Margin](#13801)
  </details>

- Fixed FlowDirection property not working on Drawable control and
GraphicsView by @Dhivya-SF4094 in
#34557
  <details>
  <summary>🔧 Fixes</summary>

- [[Android, Windows, iOS, macOS] FlowDirection property not working on
BoxView Control](#34402)
  </details>

- [iOS & Mac] Fix image tile misalignment in GraphicsView ImagePaint by
@SubhikshaSf4851 in #34935
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Image resized with ResizeMode.Fit is not rendered correctly in
GraphicsView](#34755)
  </details>

- Fix Shadow does not honour Styles by @KarthikRajaKalaimani in
#35081
  <details>
  <summary>🔧 Fixes</summary>

- [Shadow does not honour
Styles](#19560)
  </details>

## Entry
- [iOS/macCatalyst] Fix Entry and Editor BackgroundColor reset when set
to null by @Shalini-Ashokan in #34741
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Maccatalyst] Entry & Editor BackgroundColor not reset to
Null](#34611)
  </details>

- [Windows] Fix password Entry crash when setting text on empty field by
@praveenkumarkarunanithi in #33891
  <details>
  <summary>🔧 Fixes</summary>

- [[WinUI] Password Obfuscation causes unhandled
crash](#33334)
  </details>

## Essentials
- [Essentials] Use mean sea level altitude on Android API 34+ by
@KitKeen in #35097
  <details>
  <summary>🔧 Fixes</summary>

- [Add support for MslAltitudeMeters in Essentials Geolocation on
Android](#27554)
  </details>

## Flyout
- Fixed Flyout Not Displayed on Android When FlyoutWidth Is Set Only for
Desktop via OnIdiom by @NanthiniMahalingam in
#29028
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] FlyoutWidth with OnIdiom shows no
flyout](#13243)
  </details>

- Revert "[Windows] Fix Flyout/Locked mode header collapse regression
causing UI test failures on candidate branch" by @kubaflo in
#35339

- Revert "Revert "[Windows] Fix Flyout/Locked mode header collapse
regression causing UI test failures on candidate branch"" by @kubaflo in
#35342

## Flyoutpage
- Fix [Android] Title of FlyOutPage is not updating anymore after
showing a NonFlyOutPage by @KarthikRajaKalaimani in
#34839
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Title of FlyOutPage is not updating anymore after showing a
NonFlyOutPage](#33615)
  </details>

## Label
- [iOS] Fix span Tap gesture on wrapped Label lines in iOS 26+ by
@SubhikshaSf4851 in #34640
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS]Span TapGestureRecognizer does not work on the second line of
the span, if the span is wrapped to the next
line](#34504)
  </details>

## Layout
- Fixed Stacklayout is not rendered when clip is applied and StackLayout
placed child to the Border control in iOS/ Mac platform by
@KarthikRajaKalaimani in #33330
  <details>
  <summary>🔧 Fixes</summary>

- [[Mac/iOS] StackLayout fails to render content while applying Clip,
and the layout is placed inside a Border with Background in .NET
MAUI](#33241)
  </details>

## Map
- Fix Changing Location on a Pin does nothing by @NirmalKumarYuvaraj in
#30201
  <details>
  <summary>🔧 Fixes</summary>

- [[Maps] [Regression from Xamarin.Forms.Maps] Changing Location on a
Pin does nothing](#12916)
  </details>

## Mediapicker
- [iOS] Fix HEIC images picked via PickPhotosAsync not displayed by
@HarishwaranVijayakumar in #34954
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] [Regression] HEIC images picked via PickPhotosAsync not
displayed](#34953)
  </details>

- [Android] Fix MediaPicker.PickPhotosAsync UnauthorizedAccessException
on API 28 and below by @HarishwaranVijayakumar in
#34981
  <details>
  <summary>🔧 Fixes</summary>

- [MediaPicker.PickPhotos fails to modify image, tries to load original
source, fails to load source on Android
9.0](#34889)
  </details>

## Pages
- [iOS] Fix ContentPage with ToolbarItem Clicked event leaks when
presented as modal page by @devanathan-vaithiyanathan in
#35009
  <details>
  <summary>🔧 Fixes</summary>

- [ContentPage with ToolbarItem Clicked event leaks when presented as
modal page](#34892)
  </details>

## Platform
- [Android] Fix OnBackButtonPressed not invoked for Shell by
@Dhivya-SF4094 in #35150
  <details>
  <summary>🔧 Fixes</summary>

- [On Screen Back Button Does Not Fire OnBackButtonPressed in
Android](#9095)
  </details>

## RadioButton
- Fix RadioButtonGroup not working with ContentView by @Dhivya-SF4094 in
#34781
  <details>
  <summary>🔧 Fixes</summary>

- [RadioButtonGroup not working with
ContentView](#34759)
  </details>

- [Windows] Fix for RadioButton BorderColor and BorderWidth not updated
at runtime by @SyedAbdulAzeemSF4852 in
#28335
  <details>
  <summary>🔧 Fixes</summary>

- [RadioButton Border color not working for focused visual
state](#15806)
  </details>

- [iOS] Fix RadioButton BackgroundColor bleeding outside CornerRadius by
@SyedAbdulAzeemSF4852 in #34844
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] RadioButton BackgroundColor bleeds outside
CornerRadius](#34842)
  </details>

## SafeArea
- [iOS] Fix stale bottom safe area after changing SafeAreaEdges with
keyboard open by @praveenkumarkarunanithi in
#35083
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] ContentPage bottom has white space after changing SafeAreaEdges
while keyboard is open](#34846)
  </details>

## ScrollView
- [Windows] Fix Preserve ScrollView offsets when Orientation changes to
Neither by @SubhikshaSf4851 in #34827
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] ScrollView offsets do not preserve when Orientation changes
to Neither](#34671)
  </details>

## Searchbar
- [iOS] Fix SearchBar unexpected left margin in iPad windowed mode on 26
Version by @SubhikshaSf4851 in #34704
  <details>
  <summary>🔧 Fixes</summary>

- [in iPad windowed mode SearchBar adds left margin equivaltent to
SafeAreaInsets when placed inside
grid](#34551)
  </details>

## Shell
- [Windows] Fix for Shell.FlyoutBehavior="Flyout" forces the title
height space above the tab bar even if the page title is empty by
@BagavathiPerumal in #30382
  <details>
  <summary>🔧 Fixes</summary>

- [(Windows) Shell.FlyoutBehavior="Flyout" forces the title height space
above the tab bar even if the page title is
empty](#30254)
  </details>

- Fix Shell flyout items scrolling behind FlyoutHeader on iOS by @Qythyx
in #34936
  <details>
  <summary>🔧 Fixes</summary>

- [Shell flyout items scroll behind FlyoutHeader on
iOS](#34925)
  </details>

- [iOS, Mac] Fix Shell.CurrentState.Location stale in OnNavigated after
GoToAsync by @Vignesh-SF3580 in
#34880
  <details>
  <summary>🔧 Fixes</summary>

- [Shell.OnNavigated not called for route
navigation](#34662)
  </details>

- [iOS26]Fix
BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate UITest
fails by @devanathan-vaithiyanathan in
#34890
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS 26] BackButtonBehavior_IsEnabled_False_BackButtonDoesNotNavigate
test fails with
TimeoutException](#34771)
  </details>

- [iOS] Fix Shell page memory leak when using TitleView with x:Name by
@Shalini-Ashokan in #35082
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Title view memory
leak](#34975)
  </details>

- [Material 3] Fix Material 2 color flash in AppBar when switching tabs
for the first time by @Dhivya-SF4094 in
#35117
  <details>
  <summary>🔧 Fixes</summary>

- [Material 3: AppBar briefly displays Material 2 colors when switching
tabs for the first time](#35116)
  </details>

- [Android] Fix Shell/TabbedPage "More" BottomSheet uses hard-coded M2
colors when Material3 is enabled by @HarishwaranVijayakumar in
#35129
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Shell/TabbedPage "More" BottomSheet uses hard-coded M2
colors when Material3 is
enabled](#35127)
  </details>

- [Android] Shell: Fix top-tab unselected text visibility in Material 3
light theme by @SyedAbdulAzeemSF4852 in
#35128
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Shell top-tab unselected text appears too faint in Material
3 light theme](#35125)
  </details>

- Fix Shell.Items.Clear() memory leak by disconnecting child handlers on
removal (#34898) by @Shalini-Ashokan in
#35031
  <details>
  <summary>🔧 Fixes</summary>

- [Shell.Items.Clear() does not disconnect handlers
correctly](#34898)
  </details>

- [iOS&Mac] Fix Shell SearchHandler Query update on Initial load by
@SubhikshaSf4851 in #35008
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS&Mac] Shell SearchHandler Query not shown in search bar on
initial load](#35005)
  </details>

## SwipeView
- [iOS,MacCatalyst] Fix for SwipeView.Open() throwing an
ArgumentException on the second programmatic call by @BagavathiPerumal
in #34982
  <details>
  <summary>🔧 Fixes</summary>

- [[net 11.0][iOS,MacCatalyst] SwipeView.Open() throws ArgumentException
on second programmatic
call](#34917)
  </details>

- [Android/iOS] Fix SwipeItem visibility change causing double command
execution in Execute mode by @praveenkumarkarunanithi in
#35087
  <details>
  <summary>🔧 Fixes</summary>

- [Changing visibility on an SwipeItem causes multiple items to be
executed](#7580)
  </details>

## Switch
- [iOS] Fix Switch ThumbColor reset on iOS 26+ theme changes. by
@Shalini-Ashokan in #33953
  <details>
  <summary>🔧 Fixes</summary>

- [Switch ThumbColor not Initialized Using VisualStateManager on iOS
Device](#33783)
- [I9-On macOS 26.2, the "Animate scroll" button is white by default on
iOS and Maccatalyst
platforms.](#33767)
  </details>

## TabbedPage
- [Windows] TabbedPage: Refresh layout when NavigationView size changes
by @BagavathiPerumal in #26217
  <details>
  <summary>🔧 Fixes</summary>

- [TabbedPage - ScrollView not allowing scrolling when it
should](#26103)
- [TabbedPage App on resize hides page bottom
content](#11402)
- [Grid overflows child ContentPage of parent TabbedPage on initial load
and when resizing on
Windows](#20028)
  </details>

- [Android] Material 3 Fixed BottomNavigationView overflowing in Tabbed
page by @NirmalKumarYuvaraj in #35064
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Material3 - TabbedPage bottom tabs overflowing the
contents](#35063)
  </details>

- [Windows] Fix for Multiple Tabs Being Selected in WinUI TabbedPage by
@SyedAbdulAzeemSF4852 in #33312
  <details>
  <summary>🔧 Fixes</summary>

- [WinUI TabbedPage can have multiple tabs
selected](#31799)
  </details>

## Theming
- [iOS] Fix StaticResource Hot Reload crash on iOS by @StephaneDelcroix
in #35020
  <details>
  <summary>🔧 Fixes</summary>

- [The maui app quit and no errors in error list after editing
ResourceDictionary XAML file on iOS Simulator with MAUI SR6
10.0.60](#35018)
  </details>

## Toolbar
- [Windows] Fix for CS1061 build error caused by missing
HasMenuBarContent property in MauiToolbar by @BagavathiPerumal in
#35040

## Tooling
- Fix VisualStateGroups duplicate name crash with implicit styles
(#34716) by @StephaneDelcroix in
#34719
  <details>
  <summary>🔧 Fixes</summary>

- [SourceGen: VisualStateManager.VisualStateGroups causes 'Names must be
unique' at startup](#34716)
  </details>

## WebView
- Refactor the HybridWebView and properly support complex parameters by
@mattleibow in #32491

- [Android] Fix WebView scrolling inside ScrollView by @Shalini-Ashokan
in #33133
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] WebView's content does not scroll when placed inside a
ScrollView](#32971)
  </details>


<details>
<summary>🔧 Infrastructure (1)</summary>

- [Windows] Fix Narrator announcing ContentView children twice when
Description is set by @praveenkumarkarunanithi in
#33979
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] SemanticProperties.Description announced twice when set on
focusable container cell (Label
inside)](#33373)
  </details>

</details>

<details>
<summary>🧪 Testing (14)</summary>

- [Testing] SafeArea Feature Matrix Test Cases for ContentPage by
@TamilarasanSF4853 in #34877
- [Windows] Fix CollectionView ScrollTo related test cases failed in CI
by @HarishwaranVijayakumar in #34907
  <details>
  <summary>🔧 Fixes</summary>

- [[Testing][Windows]CollectionView ScrollTo related test cases failed
in CI](#34772)
  </details>
- [Testing] Fixed Build error on inflight/ candidate PR 35234 by
@HarishKumarSF4517 in #35241
- Fix CI for
ValidateKeyboardRuntime_SwitchContainerToSoftInput_WhileKeyboardOpen
test failure in May 4th Candidate by @devanathan-vaithiyanathan in
#35307
- [Windows] Fix Flyout/Locked mode header collapse regression causing UI
test failures on candidate branch by @BagavathiPerumal in
#35312
- [iOS/macCatalyst] [Candidate Fix] Editor shadow and theme regression
caused by BackgroundColor reset on initial handler connection by
@Shalini-Ashokan in #35343
- [Testing] Fixed UI test image failure in PR 35234 - [30/03/2026]
Candidate - 1 by @HarishKumarSF4517 in
#35325
- [iOS] Fix ShellFeatureMatrix test failures on candidate branch by
@Vignesh-SF3580 in #35346
- [Windows] Fix Issue29529VerifyPreviousPositionOnInsert test failure on
candidate branch by @praveenkumarkarunanithi in
#35398
- [Android] [Candidate Fix] Shell: Fix handler disconnect timing to
preserve WebView navigation and memory leak fix by @Shalini-Ashokan in
#35417
- [Testing]Revert 'Fix Preserve ScrollView offsets when Orientation
changes to Neither' by @TamilarasanSF4853 in
#35412
- [Windows] Fix VerifyAllIndicatorDotsShowShadowsWhenIndicatorSize test
failure on candidate branch by @praveenkumarkarunanithi in
#35458
- [Testing] Fixed test failure in PR 35234 - [05/08/2026] Candidate by
@TamilarasanSF4853 in #35362
- [Testing] Fixed test failure in PR 35234 - [05/04/2026] Candidate - 3
by @TamilarasanSF4853 in #35639

</details>

<details>
<summary>📦 Other (6)</summary>

- [UIKit] Avoid useless measure invalidation propagation cycles by
@albyrock87 in #33459
- BindableObject property access micro-optimizations by @albyrock87 in
#33584
- Extract filename from DisplayName and add extension if missing by
@mattleibow in #35050
- [core] Add keyed-DI screenshot extensibility for 3rd-party platform
backends by @Redth in #35096
  <details>
  <summary>🔧 Fixes</summary>

- [`ViewExtensions.CaptureAsync(IView)` and `IPlatformScreenshot` need
extensibility for third-party platform
backends](#34266)
  </details>
- Fix MainThread throwing on custom platform backends by @Redth in
#35070
  <details>
  <summary>🔧 Fixes</summary>

- [`MainThread.BeginInvokeOnMainThread` throws on custom platform
backends - Common UI-thread marshaling pattern crashes; `Dispatcher`
works but isn't the documented/recommended
path](#34101)
  </details>
- Tests: Add 11 missing UnitConverters unit tests by @PureWeen in
#35191

</details>

<details>
<summary>📝 Issue References</summary>

Fixes #7580, Fixes #9095, Fixes #11402, Fixes #12916, Fixes #13243,
Fixes #13801, Fixes #15806, Fixes #19560, Fixes #19690, Fixes #19866,
Fixes #20028, Fixes #26103, Fixes #26366, Fixes #27554, Fixes #29529,
Fixes #29772, Fixes #30192, Fixes #30199, Fixes #30254, Fixes #31658,
Fixes #31799, Fixes #32971, Fixes #33065, Fixes #33241, Fixes #33334,
Fixes #33373, Fixes #33500, Fixes #33615, Fixes #33767, Fixes #33783,
Fixes #34101, Fixes #34257, Fixes #34266, Fixes #34402, Fixes #34504,
Fixes #34551, Fixes #34611, Fixes #34662, Fixes #34671, Fixes #34716,
Fixes #34755, Fixes #34759, Fixes #34771, Fixes #34772, Fixes #34842,
Fixes #34846, Fixes #34848, Fixes #34861, Fixes #34889, Fixes #34892,
Fixes #34897, Fixes #34898, Fixes #34900, Fixes #34917, Fixes #34925,
Fixes #34953, Fixes #34975, Fixes #35005, Fixes #35018, Fixes #35063,
Fixes #35116, Fixes #35119, Fixes #35125, Fixes #35127

</details>

**Full Changelog**:
main...inflight/candidate
@PureWeen PureWeen modified the milestones: .NET 10 SR7, .NET 10 SR8 Jun 11, 2026
Shalini-Ashokan pushed a commit to Shalini-Ashokan/maui that referenced this pull request Jun 15, 2026
…al 2 styles when Material 3 is enabled (dotnet#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes dotnet#35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dhivya-SF4094 pushed a commit to Dhivya-SF4094/maui that referenced this pull request Jun 15, 2026
…al 2 styles when Material 3 is enabled (dotnet#35121)

<!-- 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 Material 3 (M3) is enabled, dialogs such as AlertDialog,
ActionSheet, and PromptDialog still appear to use Material 2 (M2)
styles.

### Description of Change
**Android Dialog Rendering Updates:**

* Updated the `DialogBuilder` logic in `AlertManager.Android.cs` to use
`MaterialAlertDialogBuilder` with a Material 3 theme wrapper when
Material 3 is enabled, ensuring dialogs have M3 styling such as rounded
corners and updated typography.
* Added the necessary import for `Google.Android.Material.Dialog` to
support the use of `MaterialAlertDialogBuilder`.

**Testing:**

* Added a new test page, `Issue35119`, to manually verify that dialogs
render with M3 styling when enabled. This page provides buttons to
trigger AlertDialog, ActionSheet, and Prompt dialogs and displays the
results.
* Introduced a new automated UI test in
`TestCases.Shared.Tests/Tests/Issues/Issue35119.cs` to validate that
dialogs appear with the expected Material 3 styling, using screenshots
for verification.<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Issues Fixed

Fixes dotnet#35119 

### Tested the behaviour in the following platforms

- [ ] - Windows 
- [x] - Android
- [ ] - iOS
- [ ] - Mac

Title | Before | After |
|----------|----------|----------|
|AlertDialog| <img
src="https://github.com/user-attachments/assets/0b19c03f-42df-456d-9f57-610dd5fd4982">|
<img
src="https://github.com/user-attachments/assets/5b5143c2-08f7-4cd0-9324-fbc99dab518f">
|
|ActionSheet| <img
src="https://github.com/user-attachments/assets/e74890d5-6fe9-4100-918a-01eb20a29c48">
| <img
src="https://github.com/user-attachments/assets/c8db0a7a-be5b-48e0-be62-5133ba971a73">
|
|PromptDialog| <img
src="https://github.com/user-attachments/assets/29336af9-d368-422a-9285-54d120524231">
| <img
src="https://github.com/user-attachments/assets/dcb7876d-ae39-4380-bc00-d33de537e0de">
|


<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution material3 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-implemented PR author implemented the agent suggested fix s/agent-fix-win AI found a better alternative fix than the PR 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) s/agent-suggestions-implemented Maintainer applies when PR author adopts agent's recommendation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] AlertDialog, ActionSheet, and Prompt render with Material 2 styles when Material 3 is enabled

6 participants