-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Implemented material3 support for RadioButton #33468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Android] Implemented material3 support for RadioButton #33468
Conversation
|
Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
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 implements Material Design 3 support for RadioButton on Android, making the radio button UI consistent with Material3 guidelines when the runtime feature is enabled. The implementation conditionally registers the appropriate handler based on the RuntimeFeature.IsMaterial3Enabled flag.
Changes:
- Added
MaterialRadioButtonHandlerclass that createsMaterialRadioButtonplatform views with proper Material3 theming - Implemented conditional handler registration in
AppHostBuilderExtensions.csto use Material3 handler when feature is enabled - Removed unconditional RadioButton handler registration to prevent duplicate assignments
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Core/src/Handlers/RadioButton/RadioButtonHandler.Android.cs | Added MaterialRadioButtonHandler class that extends RadioButtonHandler and creates MaterialRadioButton with Material3 theming |
| src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs | Added conditional handler registration for Android using RuntimeFeature.IsMaterial3Enabled flag; removed duplicate unconditional registration |
Description of Change
This pull request introduces support for Material Design 3 radio buttons on Android, making the radio button UI consistent with the latest Material guidelines when the Material3 feature is enabled. The changes ensure that the appropriate handler is used depending on the runtime feature flag.
Android Material Design 3 support:
AppHostBuilderExtensions.cs, usingMaterialRadioButtonHandlerwhen Material3 is enabled, and falling back to the defaultRadioButtonHandlerotherwise.RadioButtonHandlerto prevent duplicate handler assignments.Handler implementation:
MaterialRadioButtonHandlerclass inRadioButtonHandler.Android.cs, which creates aMaterialRadioButtonplatform view with the correct theme wrapper and disables sound effects for consistency.Material Design Spec : RadioButton
Issues Fixed
Fixes #33467
Output