Skip to content

Commit 1f0bc7d

Browse files
Dhivya-SF4094sheiksyedm
authored andcommitted
[Android] Implemented material3 support for Button (#33173)
<!-- 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. !!!!!!! --> ## Description of Change This pull request adds support for Material 3 styling for the Button control on Android in .NET MAUI. It introduces runtime feature toggling for Material 3, configures the necessary Android resources and theming infrastructure, and applies Material 3 styling to Button controls. ### Material 3 Button support and theming: - **Added `MauiMaterialButton` style**, which extends `Widget.Material3.Button` and applies Material 3 design to MAUI buttons. This style removes Android Material 3 default constraints (minWidth, minHeight, padding, insets) to allow full MAUI control over button sizing and layout, and sets `iconSize` to 0dp for proper icon sizing.[[1]](diffhunk://#diff-ad5ac218072f5fc910079c411a1cb0a014f67083b7bcbbfd3e8fd041f4a1588eR39-R55) - **Integrated `MauiMaterialButton` into Material 3 base theme** by setting `materialButtonStyle` attribute to reference the custom button style, ensuring all buttons automatically receive Material 3 styling when the feature is enabled. [[1]](diffhunk://#diff-ad5ac218072f5fc910079c411a1cb0a014f67083b7bcbbfd3e8fd041f4a1588eR8) Fixes #33172 ### Screenshots Material Design Spec - [Button](https://m3.material.io/components/buttons/specs) | Material 2  | Material 3 | |---------|--------| | <img height=600 width=300 src="https://github.com/user-attachments/assets/dd767cb0-2672-4514-bdb6-7b2cb8582e14"> |  <img height=600 width=300 src="https://github.com/user-attachments/assets/92e69117-fc8b-4942-898b-aa129bead4dc">  |
1 parent f118ecc commit 1f0bc7d

23 files changed

+411
-3
lines changed
63.6 KB
Loading
96.8 KB
Loading
63.6 KB
Loading
67.1 KB
Loading
63.8 KB
Loading
63.3 KB
Loading
63.2 KB
Loading
62.8 KB
Loading
63 KB
Loading
104 KB
Loading

0 commit comments

Comments
 (0)