-
Notifications
You must be signed in to change notification settings - Fork 2k
[Android] Implemented Material3 support for ImageButton #33649
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
Merged
kubaflo
merged 12 commits into
dotnet:inflight/current
from
Dhivya-SF4094:material_ImageButton
Mar 18, 2026
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8eefd3a
image button changes
Dhivya-SF4094 5ec4231
Updated MauiShapeableImageView.cs
Dhivya-SF4094 03f0bf9
changes reverted in attr.xml
Dhivya-SF4094 1d2ee8d
Updated remaining constructor to wrap context
Dhivya-SF4094 39a0df1
Updated MauiShapeableImageView and MauiMaterialContextThemeWrapper.cs
Dhivya-SF4094 f79fcde
Addressed review concern
Dhivya-SF4094 6ccc058
Added testcase and snapshot
Dhivya-SF4094 de6bbd4
Addressed Inconsistent Nullable Context Handling
Dhivya-SF4094 a11f6d5
Removed unnecessary Using directive
Dhivya-SF4094 4cb75a6
Fixed CI failure
Dhivya-SF4094 980fa21
Added MaterialShapeableImageView for Material3 ImageButton
Dhivya-SF4094 3cf94d9
Updated MaterialShapeableImageView
Dhivya-SF4094 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+130 KB
...-36/VerifyMaterial3ImageButtonAspect_AspectFillWithImageSourceFromFontImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+392 KB
...-notch-36/VerifyMaterial3ImageButtonAspect_AspectFitWithImageSourceFromFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+120 KB
...h-36/VerifyMaterial3ImageButtonAspect_AspectFitWithImageSourceFromFontImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+981 KB
...d-notch-36/VerifyMaterial3ImageButtonAspect_AspectFitWithImageSourceFromUri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+163 KB
...oid-notch-36/VerifyMaterial3ImageButtonAspect_CenterWithImageSourceFromFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+81.9 KB
...otch-36/VerifyMaterial3ImageButtonAspect_CenterWithImageSourceFromFontImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+435 KB
...droid-notch-36/VerifyMaterial3ImageButtonAspect_FillWithImageSourceFromFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
...-notch-36/VerifyMaterial3ImageButtonAspect_FillWithImageSourceFromFontImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.91 MB
...ndroid-notch-36/VerifyMaterial3ImageButtonAspect_FillWithImageSourceFromUri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+392 KB
...Tests/snapshots/android-notch-36/VerifyMaterial3ImageButtonFlowDirectionRTL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+392 KB
....Tests/snapshots/android-notch-36/VerifyMaterial3ImageButtonWithBorderColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+354 KB
...napshots/android-notch-36/VerifyMaterial3ImageButtonWithBorderColorAndWidth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+369 KB
....Tests/snapshots/android-notch-36/VerifyMaterial3ImageButtonWithBorderWidth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+378 KB
...s/android-notch-36/VerifyMaterial3ImageButtonWithBorderWidthAndCornerRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+409 KB
...Tests/snapshots/android-notch-36/VerifyMaterial3ImageButtonWithCornerRadius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+309 KB
...roid.Tests/snapshots/android-notch-36/VerifyMaterial3ImageButtonWithPadding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
414 changes: 414 additions & 0 deletions
414
...rols/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ImageButtonMaterial3FeatureTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,8 @@ | ||
| #nullable enable | ||
| #nullable enable | ||
| Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context! context) -> void | ||
| Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context! context, Android.Util.IAttributeSet? attrs) -> void | ||
| Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context! context, Android.Util.IAttributeSet? attrs, int defStyle) -> void | ||
| *REMOVED*Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context? context) -> void | ||
| *REMOVED*Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context? context, Android.Util.IAttributeSet? attrs) -> void | ||
| *REMOVED*Microsoft.Maui.Platform.MauiShapeableImageView.MauiShapeableImageView(Android.Content.Context? context, Android.Util.IAttributeSet? attrs, int defStyle) -> void | ||
| override Microsoft.Maui.Handlers.LabelHandler.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
We can't make public API changes? I think for other PRs we add things as internal and then add a TODO for .net 11 to make it public. Can we not do that here for some reason? @Dhivya-SF4094
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.
@jfversluis, Thanks for the suggestion. I have updated the PR to avoid public API changes for now.
Created a new internal class MaterialShapeableImageView with the required changes and updated ImageButtonHandler.Android.cs to use it.