Skip to content

[Android] Implemented Material3 support for Image#33661

Merged
kubaflo merged 6 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:material_Image
Mar 5, 2026
Merged

[Android] Implemented Material3 support for Image#33661
kubaflo merged 6 commits intodotnet:inflight/currentfrom
Dhivya-SF4094:material_Image

Conversation

@Dhivya-SF4094
Copy link
Copy Markdown
Contributor

@Dhivya-SF4094 Dhivya-SF4094 commented Jan 22, 2026

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!

Description of Change

This pull request introduces platform-specific logic for registering image handlers on Android, enabling support for Material 3 by conditionally using a new handler. It also adds a new internal ImageHandler2 class for Android, which utilizes Google's Material ShapeableImageView for improved image rendering.

Android-specific handler registration:

  • The registration of the Image handler in AppHostBuilderExtensions.cs is now conditional: if Material 3 is enabled on Android, ImageHandler2 is used; otherwise, the original ImageHandler is used. On other platforms, ImageHandler continues to be used.

New Image Handler for Material 3:

  • Introduced a new internal ImageHandler2 class for Android, which overrides the platform view creation to use ShapeableImageView from Google's Material library.

Issues Fixed

Fixes #33660

Screenshot

Material 2  Material 3 
   

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 22, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review January 22, 2026 08:25
Copilot AI review requested due to automatic review settings January 22, 2026 08:25
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 pull request introduces Material 3 support for the Image control on Android by creating a new internal ImageHandler2 class that uses Google's Material ShapeableImageView instead of the standard AppCompatImageView. The handler is conditionally registered based on the RuntimeFeature.IsMaterial3Enabled flag.

Changes:

  • Adds new ImageHandler2.Android.cs that extends ImageHandler and overrides CreatePlatformView() to use ShapeableImageView with Material theming
  • Updates handler registration in AppHostBuilderExtensions.cs to conditionally register ImageHandler2 on Android when Material 3 is enabled
  • Maintains backward compatibility by continuing to use ImageHandler when Material 3 is disabled or on other platforms

Reviewed changes

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

File Description
src/Core/src/Handlers/Image/ImageHandler2.Android.cs New internal handler that creates ShapeableImageView with Material context wrapper for Material 3 support
src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs Updated handler registration to conditionally use ImageHandler2 on Android when Material 3 is enabled

@kannanrs
Copy link
Copy Markdown

HI.. can these style be supported with a sample code, im more interested in the botoombar as in mdc-maui

TIA

@rmarinho
Copy link
Copy Markdown
Member

rmarinho commented Feb 17, 2026

🤖 AI Summary

📊 Expand Full Review
🔍 Pre-Flight — Context & Validation
📝 Review SessionAddressed the review concern · b461339

Issue: #33660 - Implement Material3 support for Image
PR: #33661 - [Android] Implemented Material3 support for Image
Author: Dhivya-SF4094 (Syncfusion partner)
Platforms Affected: Android only
Labels: platform/android, area-controls-image, material3, , partner/syncfusioncommunity
Milestone: .NET 10 Servicing
Files Changed: 3 implementation files, 0 test files

Issue Summary

When UseMaterial3 MSBuild property is enabled, the Image control should adopt Material 3 visual design. The issue is that Image currently uses Material 2-style visuals (standard AppCompatImageView) instead of Material 3-specific styling using ShapeableImageView with Material context theming.

PR's Approach

  1. New ImageHandler2.Android. Internal class extending ImageHandlerthat overridesCreatePlatformView()to return aShapeableImageViewwrapped inMauiMaterialContextThemeWrapper.Create(Context), with SetAdjustViewBounds(true).cs
  2. Conditional handler registration in AppHostBuilderExtensions. On Android, registers ImageHandler2whenRuntimeFeature.IsMaterial3Enabledis true, otherwise registersImageHandler. Non-Android platforms always use ImageHandler.cs
  3. ImageViewExtensions.cs Updated UpdateAspect() to correctly allow SetAdjustViewBounds() for ShapeableImageView when used as Image (not ImageButton). Old code skipped bounds adjustment for ALL ShapeableImageView instances.fix

Reviewer Feedback (copilot-pull-request-reviewer)

Issue File:Line Status
No test coverage for ImageHandler2 `ImageHandler2.Android.cs: OPEN 19`
Handler registration not in alphabetical order `AppHostBuilderExtensions.cs: OPEN 109`
skipped bounds adjustment for ShapeableImageView RESOLVED
TODO comment lacks tracking issue reference `ImageHandler2.Android.cs: OPEN 5`

Prior Agent Review Found

A prior complete agent review was found (2026-02-17, commit b461339). PR has not been updated since. Findings imported.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33661 New ImageHandler2 using ShapeableImageView for Material3, conditional PENDING (Gate) 3 files Original PR registration

🚦 Gate — Test Verification
📝 Review SessionAddressed the review concern · b461339

** FAILED - No tests existResult:**
Platform: android (selected)
Mode: Full Verification - BLOCKED (no tests to run)

Gate Failure Reason

No issue-specific tests were found for Issue #33660 or PR #33661. The PR contains 0 test all 3 changed files are implementation files:files

  • src/Core/src/Handlers/Image/ImageHandler2.Android.cs (new)
  • src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs (modified)
  • src/Core/src/Platform/Android/ImageViewExtensions.cs (modified)

Tests Not Found

  • src/Controls/tests/TestCases.HostApp/Issues/ does NOT existIssue33660*
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ does NOT existIssue33660*
  • No device tests in src/Core/tests/DeviceTests for ImageHandler2 or Material3 Image behavior

Action Required

Tests must be added before this PR can be merged. Suggested tests:

  1. Device test: Verify that when Material 3 is enabled on Android, ImageHandler2 is used and the platform view is a ShapeableImageView
  2. Device test: Verify UpdateAspect() correctly sets AdjustViewBounds for ImageHandler2

The write-tests-agent can help create these tests.


🔧 Fix — Analysis & Comparison
📝 Review SessionAddressed the review concern · b461339

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #33661 New ImageHandler2 using ShapeableImageView for Material3, conditional PENDING (Gate failed - no tests) 3 files Original PR registration

Exhausted: N/A (Gate failed - Phase 3 skipped)
Selected Fix: N/A - Gate did not pass; no fix candidates evaluated.


📋 Report — Final Recommendation
📝 Review SessionAddressed the review concern · b461339

Final Recommendation: REQUEST CHANGES##

Summary

PR #33661 introduces Material 3 support for the Image control on Android by adding a new ImageHandler2 class that uses ShapeableImageView with Material context theming. The implementation approach is reasonable and follows existing patterns in the codebase (e.g., how Button and Switch conditionally use Material 3 handlers). However, the PR is missing tests entirely, which prevents Gate from passing.

Root Cause (Issue #33660)

When UseMaterial3 is enabled on Android, the Image control continued to use AppCompatImageView (via the standard ImageHandler) instead of a Material 3-compatible view. ShapeableImageView from Google's Material library supports Material 3 theming via MauiMaterialContextThemeWrapper, enabling proper container shape, colors, elevation, and shadow behavior consistent with other Material 3 controls.

Additionally, ImageViewExtensions.UpdateAspect() had a bug where it unconditionally skipped SetAdjustViewBounds() for ALL ShapeableImageView instances (originally only intended to skip for ImageButton). Since ImageHandler2 also uses ShapeableImageView, this was correctly fixed to check both: imageView is ShapeableImageView && image is IImageButton.

Gate Result

FAILED - No tests exist for this issue. The PR contains 0 test files. Gate could not run.

Phase 3: Fix

Gate did not pass.Skipped

Code Review Findings

  1. No tests - No device tests verifying that ImageHandler2 creates a ShapeableImageView on Android when Material 3 is enabled, and no tests verifying UpdateAspect() behavior on ImageHandler2.

  2. Alphabetical order disrupted (AppHostBuilderExtensions.cs:98- Image handler was originally registered between GraphicsViewandLayout(alphabetical). After this PR, the#if ANDROIDblock is placed afterHybridWebView. Recommendation: Move to its original alphabetical position.109)

  3. Missing newline at end of file (ImageHandler2.Android. Minor consistency issue.cs)

  4. TODO without issue tracking (ImageHandler2.Android.cs: // TODO: make it public in .net 11 lacks a GitHub issue reference.5)

Looks Good:

  1. ImageViewExtensions.UpdateAspect() fix is Changes from if (imageView is not ShapeableImageView) to shouldSkipBoundsAdjustment = imageView is ShapeableImageView && image is IImageButton. Correctly handles the new case where ShapeableImageView is used by both ImageButton AND ImageHandler2.correct

  2. Pattern follows codebase Conditional handler registration via RuntimeFeature.IsMaterial3Enabled is consistent with how other Material 3 handlers are registered.conventions

  3. MauiMaterialContextThemeWrapper.Create(Context) usage is Standard approach for Material 3 controls.correct

Recommended Actions for Author

  1. Add tests ( Use write-tests-agent:blocking)
    • Device test: Verify ImageHandler2 creates ShapeableImageView when Material 3 is enabled
    • Device test: Verify UpdateAspect() sets AdjustViewBounds correctly on ShapeableImageView (Image, not ImageButton)
  2. Fix alphabetical Move the #if ANDROID Image handler block between GraphicsView and Layoutordering
  3. Fix missing newline at EOF in ImageHandler2.Android.cs
  4. Reference tracking issue in TODO comment

📋 Expand PR Finalization Review
Title: ✅ Good

Current: [Android] Implemented Material3 support for Image

Description: ✅ Good

Description needs updates. See details below.

✨ Suggested PR Description

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

Description of Change

This pull request introduces Material 3 support for the Android Image control by adding a new ImageHandler2 handler that uses ShapeableImageView as the platform view. It also fixes aspect-ratio adjustment logic in ImageViewExtensions to account for the new usage of ShapeableImageView by the Image control.

**1. AppHostBuilderExtensions. Conditional handler registration (Android only)**cs

On Android, the Image handler is now registered conditionally based on whether Material 3 is enabled (RuntimeFeature.IsMaterial3Enabled):

  • If Material 3 is enabled: registers ImageHandler2
  • Otherwise: registers the original ImageHandler

On all other platforms, the original ImageHandler is registered unconditionally (unchanged behavior).

**2. ImageHandler2.Android. New Material 3 image handler**cs

Introduced a new internal class ImageHandler2 (in src/Core/src/Handlers/Image/) that extends ImageHandler and overrides CreatePlatformView() to:

  • Return a ShapeableImageView (from Google's Material library) instead of the default ImageView
  • Wrap the context with MauiMaterialContextThemeWrapper to apply the Material 3 theme
  • Call SetAdjustViewBounds(true) to enable proper intrinsic aspect ratio handling during measurement

The class is currently internal with a TODO to consider making it public in a future release.

**3. ImageViewExtensions. Fix aspect adjustment logic for ShapeableImageView**cs

UpdateAspect() previously skipped SetAdjustViewBounds() for all ShapeableImageView instances, because ShapeableImageView was only used by ImageButton. Now that ImageHandler2 also uses ShapeableImageView for the Image control, this blanket exclusion would incorrectly suppress aspect adjustment for Image.

The fix changes the condition to:

  • Before: if (imageView is not skip bounds adjustment for any ShapeableImageViewShapeableImageView)
  • After: if (!(imageView is ShapeableImageView && image is skip bounds adjustment only when the view is a ShapeableImageViewbeing used as anImageButtonIImageButton))

Issues Fixed

Fixes #33660

Screenshot

Material 2 Material 3
Code Review: ✅ Passed

Code PR #33661Review

1. No test coverage for ImageHandler2 or the conditional registration

Files: src/Core/src/Handlers/Image/ImageHandler2.Android.cs, src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs

Problem: There are no device tests (or unit tests) verifying:

  1. When Material 3 is enabled, the Image handler creates a ShapeableImageView as the platform view
  2. When Material 3 is disabled, the Image handler creates a standard ImageView
  3. UpdateAspect() correctly applies SetAdjustViewBounds for Image (not just ImageButton) when ShapeableImageView is used

This is a behavioral change that could regress silently. The existing ImageHandlerTests only cover the base ImageHandler and don't exercise the new code path.

Recommendation: Add Android device tests to Controls.DeviceTests or Core.DeviceTests:

  • Verify the platform view type is ShapeableImageView when Material 3 is enabled
  • Verify SetAdjustViewBounds behavior with the new handler

2. Handler registration disrupts alphabetical ordering

File: src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs

Problem: The Image handler registration was moved from its original position between GraphicsView and Layout (alphabetical order) to after the HybridWebView conditional block. The method registers handlers alphabetically (CheckBox, DatePicker, Editor, Entry, GraphicsView, Image, Layout, Picker, ...), and the new placement breaks this convention.

Recommendation: Move the #if ANDROID Image handler block back between GraphicsView and Layout to maintain alphabetical ordering:

handlersCollection.AddHandler<GraphicsView, GraphicsViewHandler>();
#if ANDROID
    if (RuntimeFeature.IsMaterial3Enabled)
        handlersCollection.AddHandler<Image, ImageHandler2>();
    else
        handlersCollection.AddHandler<Image, ImageHandler>();
#else
    handlersCollection.AddHandler<Image, ImageHandler>();
#endif
handlersCollection.AddHandler<Layout, LayoutHandler>();

3. TODO comment lacks a tracking issue reference

File: src/Core/src/Handlers/Image/ImageHandler2.Android.cs, line 5

Problem: // TODO: make it public in .net 11 references a specific future release but has no associated GitHub issue to track the decision. This makes it hard to find and act on.

Recommendation: Either link to an existing tracking issue or replace with a more general comment:

// TODO: Consider making this public in a future release - see #XXXXX

4. Missing newline at end of file

File: src/Core/src/Handlers/Image/ImageHandler2.Android.cs

Problem: The diff shows \ No newline at end of file at the end of the new file. This is a minor style issue that can cause noise in future diffs.

Recommendation: Add a trailing newline at the end of the file.


Looks Good

ImageViewExtensions.UpdateAspect() fix is correct

The change from imageView is not ShapeableImageView to imageView is ShapeableImageView && image is IImageButton is the right fix. It correctly identifies the case where bounds adjustment should be skipped (ImageButton using ShapeableImageView) while allowing the Image control's new ShapeableImageView usage to benefit from bounds adjustment. Using IImageButton as the discriminator is appropriate since it's a stable interface boundary.

MauiMaterialContextThemeWrapper.Create(Context) used correctly

ImageHandler2.CreatePlatformView() passes Context (not this) to MauiMaterialContextThemeWrapper.Create(), and that method correctly detects if the context is already a MauiMaterialContextThemeWrapper to avoid double-wrapping. This follows the same pattern used by CheckBoxHandler and other Material 3 handlers.

Conditional registration follows existing Material 3 patterns

Using RuntimeFeature.IsMaterial3Enabled for conditional handler registration is consistent with how other controls (CheckBox, etc.) implement Material 3 behavior. The #if ANDROID guard correctly limits the new handler to Android only.


@rmarinho rmarinho added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Feb 18, 2026
@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).

@kubaflo kubaflo removed the s/agent-fix-win AI found a better alternative fix than the PR label Feb 20, 2026
@Dhivya-SF4094
Copy link
Copy Markdown
Contributor Author

Dhivya-SF4094 commented Feb 20, 2026

Added UI tests and addressed all valid concerns.

@sheiksyedm sheiksyedm added the s/agent-suggestions-implemented Maintainer applies when PR author adopts agent's recommendation label Feb 20, 2026
@kubaflo kubaflo removed the s/agent-changes-requested AI agent recommends changes - found a better alternative or issues label Feb 25, 2026
jfversluis
jfversluis previously approved these changes Feb 27, 2026
@jfversluis jfversluis changed the base branch from main to inflight/current February 27, 2026 18:22
@jfversluis jfversluis changed the base branch from inflight/current to main February 27, 2026 18:23
@jfversluis jfversluis dismissed their stale review February 27, 2026 18:23

The base branch was changed.

jfversluis
jfversluis previously approved these changes Feb 27, 2026
@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).

@jfversluis jfversluis changed the base branch from main to inflight/current March 2, 2026 14:35
@jfversluis jfversluis changed the base branch from inflight/current to main March 2, 2026 14:36
@jfversluis jfversluis dismissed their stale review March 2, 2026 14:36

The base branch was changed.

@jfversluis
Copy link
Copy Markdown
Member

@Dhivya-SF4094 with all the latest merges and changes there is a conflict here now. Can you have a look? Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

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

Or

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

@Dhivya-SF4094
Copy link
Copy Markdown
Contributor Author

@Dhivya-SF4094 with all the latest merges and changes there is a conflict here now. Can you have a look? Thanks!

@jfversluis, resolved conflict and could you please review once.

@PureWeen PureWeen modified the milestones: .NET 10 SR5, .NET 10 SR6 Mar 3, 2026
@kubaflo kubaflo changed the base branch from main to inflight/current March 4, 2026 23:58
@kubaflo kubaflo merged commit baa767c into dotnet:inflight/current Mar 5, 2026
2 of 11 checks passed
PureWeen pushed a commit that referenced this pull request Mar 11, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes #33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Mar 11, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes #33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@PureWeen PureWeen mentioned this pull request Mar 17, 2026
PureWeen pushed a commit that referenced this pull request Mar 19, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes #33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Mar 20, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes #33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Mar 22, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes #33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@kubaflo kubaflo added the s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) label Mar 23, 2026
PureWeen added a commit that referenced this pull request Mar 24, 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 66 commits with various improvements,
bug fixes, and enhancements.


## Activityindicator
- [Android] Implemented material3 support for ActivityIndicator by
@Dhivya-SF4094 in #33481
  <details>
  <summary>🔧 Fixes</summary>

- [Implement material3 support for
ActivityIndicator](#33479)
  </details>

- [iOS] Fix: ActivityIndicator IsRunning ignores IsVisible when set to
true by @bhavanesh2001 in #28983
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] [ActivityIndicator] `IsRunning` ignores `IsVisible` when set to
`true`](#28968)
  </details>

## Button
- [iOS] Button RTL text and image overlap - fix by @kubaflo in
#29041

## Checkbox
- [iOS/MacCatalyst] Fix CheckBox foreground color not resetting when set
to null by @Ahamed-Ali in #34284
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Color of the checkBox control is not properly worked on dynamic
scenarios](#34278)
  </details>

## CollectionView
- [iOS] Fix: CollectionView does not clear selection when SelectedItem
is set to null by @Tamilarasan-Paranthaman in
#30420
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView not being able to remove selected item highlight on
iOS](#30363)
- [[MAUI] Select items traces are
preserved](#26187)
  </details>

- [iOS] CV2 ItemsLayout update by @kubaflo in
#28675
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView CollectionViewHandler2 doesnt change ItemsLayout on
DataTrigger](#28656)
- [iOS CollectionView doesn't respect a change to ItemsLayout when using
Items2.CollectionViewHandler2](#31259)
  </details>

- [iOS][CV2] Fix CollectionView renders large empty space at bottom of
view by @devanathan-vaithiyanathan in
#31215
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] [MacCatalyst] CollectionView renders large empty space at
bottom of view](#17799)
- [[iOS/Mac] CollectionView2 EmptyView takes up large horizontal space
even when the content is
small](#33201)
  </details>

- [iOS] Fixed issue where group Header/Footer template was set to all
items when IsGrouped was true for an ObservableCollection by
@Tamilarasan-Paranthaman in #29144
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Group Header/Footer Repeated for All Items When IsGrouped is
True for ObservableCollection in
CollectionView](#29141)
  </details>

- [Android] Fix CollectionView selection crash with HeaderTemplate by
@NirmalKumarYuvaraj in #34275
  <details>
  <summary>🔧 Fixes</summary>

- [[Bug] [Android] System.ArgumentOutOfRangeException: Index was out of
range. Must be non-negative and less than the size of the collection.
Parameter name: index](#34247)
  </details>

## DateTimePicker
- [iOS] Fix TimePicker AM/PM frequently changes when the app is closed
and reopened by @devanathan-vaithiyanathan in
#31066
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] TimePicker AM/PM frequently changes when the app is closed and
reopened](#30837)
- [Maui 10 iOS TimePicker Strange Characters in place of
AM/PM](#33722)
  </details>

- Android TimePicker ignores 24 hour system setting when using Format
Property - fix by @kubaflo in #28797
  <details>
  <summary>🔧 Fixes</summary>

- [Android TimePicker ignores 24 hour system setting when using Format
Property](#28784)
  </details>

## Drawing
- [iOS, Mac, Windows] GraphicsView: Fix Background/BackgroundColor not
updating by @NirmalKumarYuvaraj in
#31254
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Mac, Windows] GraphicsView does not change the
Background/BackgroundColor](#31239)
  </details>

- [iOS] GraphicsView DrawString - fix by @kubaflo in
#26304
  <details>
  <summary>🔧 Fixes</summary>

- [DrawString not rendering in
iOS.](#24450)
- [GraphicsView DrawString not rendering in
iOS](#8486)
- [DrawString doesn't work on
maccatalyst](#4993)
  </details>

- [Android] - Fix Shadow Rendering For Transparent Fill, Stroke (Lines),
and Text on Shapes by @prakashKannanSf3972 in
#29528
  <details>
  <summary>🔧 Fixes</summary>

- [Ellipse Transparency Not Rendered When Drawing Arc Inside the Ellipse
Using GraphicsView on
Android](#29394)
  </details>

- Revert "[iOS, Mac, Windows] GraphicsView: Fix
Background/BackgroundColor not updating (#31254)" by @Ahamed-Ali via
@Copilot in #34508

## Entry
- [iOS 26] Fix Entry MaxLength not enforced due to new multi-range
delegate by @kubaflo in #32045
  <details>
  <summary>🔧 Fixes</summary>

- [iOS 26 - The MaxLength property value is not respected on an Entry
control.](#32016)
- [.NET MAUI Entry Maximum Length not working on iOS and
macOS](#33316)
  </details>

- [iOS] Fixed Entry with IsPassword toggling loses previously entered
text by @SubhikshaSf4851 in #30572
  <details>
  <summary>🔧 Fixes</summary>

- [Entry with IsPassword toggling loses previously entered text on iOS
when IsPassword is
re-enabled](#30085)
  </details>

## Essentials
- Fix for FilePicker PickMultipleAsync nullable reference type by
@SuthiYuvaraj in #33163
  <details>
  <summary>🔧 Fixes</summary>

- [FilePicker PickMultipleAsync nullable reference
type](#33114)
  </details>

- Replace deprecated NetworkReachability with NWPathMonitor on iOS/macOS
by @jfversluis via @Copilot in #32354
  <details>
  <summary>🔧 Fixes</summary>

- [NetworkReachability is obsolete on iOS/maccatalyst
17.4+](#32312)
- [Use NWPathMonitor on iOS for Essentials
Connectivity](#2574)
  </details>

## Essentials Connectivity
- Update Android Connectivity implementation to use modern APIs by
@jfversluis via @Copilot in #30348
  <details>
  <summary>🔧 Fixes</summary>

- [Update the Android Connectivity implementation to user modern
APIs](#30347)
  </details>

## Flyout
- [iOS] Fixed Flyout icon not updating when root page changes using
InsertPageBefore by @Vignesh-SF3580 in
#29924
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Flyout icon not replaced by back button when root page is
changed using
InsertPageBefore](#29921)
  </details>

## Flyoutpage
- [iOS] Flyout Items Not Displayed in RightToLeft FlowDirection in
Landscape - fix by @kubaflo in #26762
  <details>
  <summary>🔧 Fixes</summary>

- [Flyout Items Not Displayed in RightToLeft FlowDirection on iOS in
Landscape Orientation and Hamburger Icon Positioned
Incorrectly](#26726)
  </details>

## Image
- [Android] Implemented Material3 support for Image by @Dhivya-SF4094 in
#33661
  <details>
  <summary>🔧 Fixes</summary>

- [Implement Material3 support for
Image](#33660)
  </details>

## Keyboard
- [iOS] Fix gap at top of view after rotating device while Entry
keyboard is visible by @praveenkumarkarunanithi in
#34328
  <details>
  <summary>🔧 Fixes</summary>

- [Focusing and entering texts on entry control causes a gap at the top
after rotating simulator.](#33407)
  </details>

## Label
- [Android] Support for images inside HTML label by @kubaflo in
#21679
  <details>
  <summary>🔧 Fixes</summary>

- [Label with HTML TextType does not display images on
Android](#21044)
  </details>

- [fix] ContentLabel Moved to a nested class to prevent CS0122 in
external source generators by @SubhikshaSf4851 in
#34514
  <details>
  <summary>🔧 Fixes</summary>

- [[MAUI] Building Maui App with sample content results CS0122
errors.](#34512)
  </details>

## Layout
- Optimize ordering of children in Flex layout by @symbiogenesis in
#21961

- [Android] Fix control size properties not available during Loaded
event by @Vignesh-SF3580 in #31590
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView on Android does not provide height, width, logical
children once loaded, works fine on
Windows](#14364)
- [Control's Loaded event invokes before calling its measure override
method.](#14160)
  </details>

## Mediapicker
- [iOS/Android] MediaPicker: Fix image orientation when RotateImage=true
by @michalpobuta in #33892
  <details>
  <summary>🔧 Fixes</summary>

- [MediaPicker.PickPhotosAsync does not preserve image
orientation](#32650)
  </details>

## Modal
- [Windows] Fix modal page keyboard focus not shifting to newly opened
modal by @jfversluis in #34212
  <details>
  <summary>🔧 Fixes</summary>

- [Keyboard focus does not shift to a newly opened modal page: Pressing
enter clicks the button on the page beneath the modal
page](#22938)
  </details>

## Navigation
- [iOS26] Apply view margins in title view by @kubaflo in
#32205
  <details>
  <summary>🔧 Fixes</summary>

- [NavigationPage TitleView iOS
26](#32200)
  </details>

- [iOS] System.NullReferenceException at
NavigationRenderer.SetStatusBarStyle() by @kubaflo in
#29564
  <details>
  <summary>🔧 Fixes</summary>

- [System.NullReferenceException at
NavigationRenderer.SetStatusBarStyle()](#29535)
  </details>

- [iOS 26] Fix back button color not applied for NavigationPage by
@Shalini-Ashokan in #34326
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Color not applied to the Back button text or image on iOS
26](#33966)
  </details>

## Picker
- Fix Picker layout on Mac Catalyst 26+ by @kubaflo in
#33146
  <details>
  <summary>🔧 Fixes</summary>

- [[MacOS 26] Text on picker options are not centered on macOS
26.1](#33229)
  </details>

## Progressbar
- [Android] Implemented Material3 support for ProgressBar by
@SyedAbdulAzeemSF4852 in #33926
  <details>
  <summary>🔧 Fixes</summary>

- [Implement Material3 support for
Progressbar](#33925)
  </details>

## RadioButton
- [iOS, Mac] Fix for RadioButton TextColor for plain Content not working
by @HarishwaranVijayakumar in #31940
  <details>
  <summary>🔧 Fixes</summary>

- [RadioButton: TextColor for plain Content not working on
iOS](#18011)
  </details>

- [All Platforms] Fix RadioButton warning when ControlTemplate is set
with View content by @kubaflo in
#33839
  <details>
  <summary>🔧 Fixes</summary>

- [Seeking clarification on RadioButton + ControlTemplate + Content
documentation](#33829)
  </details>

- Visual state change for disabled RadioButton by @kubaflo in
#23471
  <details>
  <summary>🔧 Fixes</summary>

- [RadioButton disabled UI issue -
iOS](#18668)
  </details>

## SafeArea
- [Android] Fix for TabbedPage BottomNavigation BarBackgroundColor not
extending to system navigation bar by @praveenkumarkarunanithi in
#33428
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] TabbedPage BottomNavigation BarBackgroundColor does not
extend to system navigation bar area in Edge-to-Edge
mode](#33344)
  </details>

## ScrollView
- [Android] ScrollView: Fix HorizontalScrollBarVisibility not updating
immediately at runtime by @SubhikshaSf4851 in
#33528
  <details>
  <summary>🔧 Fixes</summary>

- [Runtime Scrollbar visibility not updating correctly on Android and
macOS platforms.](#33400)
  </details>

- Fixed crash when calling ItemsView.ScrollTo on unloaded CollectionView
by @kubaflo in #25444
  <details>
  <summary>🔧 Fixes</summary>

- [App crashes when calling ItemsView.ScrollTo on unloaded
CollectionView](#23014)
  </details>

## Shell
- [Shell] Update logic for iOS large title display in ShellItemRenderer
by @kubaflo in #33246

- [iOS][Shell] Fix navigation lifecycle and back button for More tab (>5
tabs) by @kubaflo in #27932
  <details>
  <summary>🔧 Fixes</summary>

- [OnAppearing and OnNavigatedTo does not work when using extended
Tabbar (tabbar with more than 5 tabs) on
IOS.](#27799)
- [Shell.BackButtonBehavior does not work when using extended Tabbar
(tabbar with more than 5 tabs)on
IOS.](#27800)
- [Shell TabBar More button causes ViewModel command binding
disconnection on back
navigation](#30862)
- [Content page onappearing not firing if tabs are on the more tab on
IOS](#31166)
  </details>

- [iOS 26] Fix tab bar ghosting when navigating from modal to tabbed
Shell content by @SubhikshaSf4851 in
#34254
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Tab bar ghosting issue on iOS 26 (liquid
glass)](#34143)
  </details>

- Fix for Shell tab visibility not updating when navigating back
multiple pages by @BagavathiPerumal in
#34403
  <details>
  <summary>🔧 Fixes</summary>

- [Changing Shell Tab Visibility when navigating back multiple pages
ignores Shell Tab
Visibility](#33351)
  </details>

- [iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation
Bar Button by @Dhivya-SF4094 in
#34401
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] OnBackButtonPressed not firing for Shell Navigation Bar
button](#34190)
  </details>

## Slider
- [iOS] Fix for Slider ThumbImageSource is not centered properly on iOS
26 by @HarishwaranVijayakumar in
#34019
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS 26] Slider ThumbImageSource is not centered
properly](#33967)
  </details>

- [Android] Fix improper rendering of ThumbimageSource in Slider by
@NirmalKumarYuvaraj in #34064
  <details>
  <summary>🔧 Fixes</summary>

- [[Slider] MAUI Slider thumb image is big on
android](#13258)
  </details>

## Stepper
- [iOS] Fix Stepper layout overlap in landscape on iOS 26 by
@Vignesh-SF3580 in #34325
  <details>
  <summary>🔧 Fixes</summary>

- [[.NET10] D10 - Customize cursor position - Rotating simulator makes
the button and label
overlap](#34273)
  </details>

## SwipeView
- [iOS] SwipeView: Honor FontImageSource.Color in SwipeItem icon by
@kubaflo in #27389
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] SwipeView: SwipeItem.IconImageSource.FontImageSource color
value not honored](#27377)
  </details>

## Switch
- [Android] Fix Switch thumb shadow missing when ThumbColor is set by
@Shalini-Ashokan in #33960
  <details>
  <summary>🔧 Fixes</summary>

- [Android Switch Control Thumb
Shadow](#19676)
  </details>

## Toolbar
- [iOS/Mac Catalyst 26] Fix Shell.ForegroundColor not applied to
ToolbarItems by @SyedAbdulAzeemSF4852 in
#34085
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS26] Shell.ForegroundColor is not applied to
ToolbarItems](#34083)
  </details>

- [Android] VoiceOver on Toolbar Item by @kubaflo in
#29596
  <details>
  <summary>🔧 Fixes</summary>

- [VoiceOver on Toolbar
Item](#29573)
- [SemanticProperties do not work on
ToolbarItems](#23623)
  </details>


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

- [Testing] Additional Feature Matrix Test Cases for CollectionView by
@TamilarasanSF4853 in #32432
- [Testing] Feature Matrix UITest Cases for VisualStateManager by
@LogishaSelvarajSF4525 in #34146
- [Testing] Feature Matrix UITest Cases for Clip by @TamilarasanSF4853
in #34121
- [Testing] Feature matrix UITest Cases for Map Control by
@HarishKumarSF4517 in #31656
- [Testing] Feature matrix UITest Cases for Visual Transform Control by
@HarishKumarSF4517 in #32799
- [Testing] Feature Matrix UITest Cases for Shell Pages by
@NafeelaNazhir in #33945
- [Testing] Feature Matrix UITest Cases for Triggers by
@HarishKumarSF4517 in #34152
- [Testing] Refactoring Feature Matrix UITest Cases for CheckBox Control
by @LogishaSelvarajSF4525 in #34283
- Resolve UI test Build Sample failures - Candidate March 16 by
@Ahamed-Ali in #34442
- Fix the failures in the Candidate branch- March 16 by @Ahamed-Ali in
#34453
  <details>
  <summary>🔧 Fixes</summary>

  - [March 16th, Candidate](#34437)
  </details>
- Fixed the iOS 18.5 Candidate failures (March 16,2026) by @Ahamed-Ali
in #34593
  <details>
  <summary>🔧 Fixes</summary>

  - [March 16th, Candidate](#34437)
  </details>

</details>

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

- Fixed candidate test failures caused by PR #33428. by @Ahamed-Ali in
#34515
  <details>
  <summary>🔧 Fixes</summary>

- [[.NET10] On Android, there's a big space at the top for I, M and N2 &
N3](#34509)
  </details>
- Revert "[iOS] Button RTL text and image overlap - fix (#29041)" in
b0497af

</details>

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

Fixes #2574, Fixes #4993, Fixes #8486, Fixes #13258, Fixes #14160, Fixes
#14364, Fixes #17799, Fixes #18011, Fixes #18668, Fixes #19676, Fixes
#21044, Fixes #22938, Fixes #23014, Fixes #23623, Fixes #24450, Fixes
#26187, Fixes #26726, Fixes #27377, Fixes #27799, Fixes #27800, Fixes
#28656, Fixes #28784, Fixes #28968, Fixes #29141, Fixes #29394, Fixes
#29535, Fixes #29573, Fixes #29921, Fixes #30085, Fixes #30347, Fixes
#30363, Fixes #30837, Fixes #30862, Fixes #31166, Fixes #31239, Fixes
#31259, Fixes #32016, Fixes #32200, Fixes #32312, Fixes #32650, Fixes
#33114, Fixes #33201, Fixes #33229, Fixes #33316, Fixes #33344, Fixes
#33351, Fixes #33400, Fixes #33407, Fixes #33479, Fixes #33660, Fixes
#33722, Fixes #33829, Fixes #33925, Fixes #33966, Fixes #33967, Fixes
#34083, Fixes #34143, Fixes #34190, Fixes #34247, Fixes #34273, Fixes
#34278, Fixes #34437, Fixes #34509, Fixes #34512

</details>

**Full Changelog**:
main...inflight/candidate
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Mar 30, 2026
<!-- 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!

### Description of Change

This pull request introduces platform-specific logic for registering
image handlers on Android, enabling support for Material 3 by
conditionally using a new handler. It also adds a new internal
`ImageHandler2` class for Android, which utilizes Google's Material
`ShapeableImageView` for improved image rendering.

**Android-specific handler registration:**

* The registration of the `Image` handler in
`AppHostBuilderExtensions.cs` is now conditional: if Material 3 is
enabled on Android, `ImageHandler2` is used; otherwise, the original
`ImageHandler` is used. On other platforms, `ImageHandler` continues to
be used.

**New Image Handler for Material 3:**

* Introduced a new internal `ImageHandler2` class for Android, which
overrides the platform view creation to use `ShapeableImageView` from
Google's Material library.

### Issues Fixed

Fixes dotnet#33660 

### Screenshot
| Material 2  | Material 3 |
|---------|--------|
| <img height=600 width=300
src="https://github.com/user-attachments/assets/c30a18fd-bf44-4a93-a751-bfb296f0d5ea">
|  <img height=600 width=300
src="https://github.com/user-attachments/assets/77a6a06b-d656-4bb3-9e39-dd3442c2f131"> 
|

---------

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

Labels

area-controls-image Image control community ✨ Community Contribution material3 partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) 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.

Implement Material3 support for Image

9 participants