Skip to content

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

Description of Change

This pull request introduces the foundation for Material Design 3 (M3) support in .NET MAUI for Android. The changes allow developers to opt into Material Design 3 via a new MSBuild property, provide runtime detection of the Material version, and add the necessary Android resources and styles for M3. By default, apps continue to use Material Design 2 to maintain backward compatibility.

Material Design 3 opt-in and configuration:

  • Added a new MSBuild property UseMaterial3 (default: false) to allow developers to opt into Material Design 3 for Android. Internal build properties are set based on this value, and a build log message informs developers which Material version is active. (Microsoft.Maui.Controls.Common.targets) [1] [2]
  • The Material Design version is now surfaced as a runtime feature switch (Microsoft.Maui.RuntimeFeature.IsMaterial3Enabled), which is set during the build process if UseMaterial3 is specified. (Microsoft.Maui.Controls.targets, RuntimeFeature.cs) [1] [2] [3]

Runtime and theming support:

  • Introduced MaterialDesignHelper for runtime detection of Material Design 3 enablement, with caching for performance and a method to retrieve the current Material version. (MaterialDesignHelper.cs)
  • Updated MauiMaterialContextThemeWrapper to dynamically select the correct base theme (Material 2 or Material 3) at runtime using the new helper. (MauiMaterialContextThemeWrapper.cs)

Android resource additions for Material Design 3:

  • Added comprehensive Material Design 3 color definitions for both light and dark themes, including compatibility colors for legacy components. (colors-material3.xml)
  • Added Material Design 3 style definitions, including base theme, no action bar variant, action mode, and splash theme. (styles-material3.xml)

Issues Fixed

Fixes #33073

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

🚀 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 -- 33074

Or

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

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement UseMaterial3 MSBuild property to enable M3 at build time

1 participant