Repository navigation
[Android] Fix blurry Material 3 images when scaled - #38362
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38362Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38362" |
|
Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes Android handler rendering behavior for all Material 3 Image instances, and should be validated with CI/device testing plus a careful review of rendering/perf implications.
Pull request overview
This PR addresses an Android rendering regression when Material 3 is enabled by adjusting the native ShapeableImageView configuration used by ImageHandler2, aiming to prevent high-resolution images from becoming blurry when scaled/zoomed.
Changes:
- Set
ShapeableImageView’s layer type toLayerType.NoneinImageHandler2(Android) to avoid forced per-view layer behavior that can lead to blurry scaling. - Add an explanatory comment describing why the layer type is being set.
File summaries
| File | Description |
|---|---|
| src/Core/src/Handlers/Image/ImageHandler2.Android.cs | Sets ShapeableImageView layer type to None for Material 3 image rendering to avoid blurry scaling artifacts. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
/azp run maui-pr-uitests , maui-pr-devicetests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
A critical masking risk remains, and the test does not cover scaling or shape behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
src/Core/tests/DeviceTests/Handlers/Image/ImageHandlerTests.Android.cs:117
- The new test only verifies the constructor's final
LayerType; it does not exercise the blurry scaling scenario or verify thatShapeableImageViewstill clips/masks the bitmap after its required hardware layer is cleared. Add a deterministic device assertion for a scaled high-resolution image and a non-rectangular shape (or equivalent mask behavior) so this rendering tradeoff is covered, rather than relying only on the layer flag.
[Fact]
public async Task ImageHandler2PlatformViewDoesNotUseHardwareLayer()
{
var image = new TStub();
await InvokeOnMainThreadAsync(() =>
{
var handler = CreateHandler<ImageHandler2>(image);
var platformView = Assert.IsType<ShapeableImageView>(handler.PlatformView);
Assert.Equal(global::Android.Views.LayerType.None, platformView.LayerType);
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
| var imageView = new ShapeableImageView(MauiMaterialContextThemeWrapper.Create(Context)); | ||
|
|
||
| // Clear any forced per-view layer type (e.g. a hardware layer) to avoid blurry scaling when the view is transformed. | ||
| imageView.SetLayerType(global::Android.Views.LayerType.None, null); |
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@SubhikshaSf4851 — new AI review results are available based on commit
eafd463.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: ANDROID · Base: main · Merge base: 699f16e4
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
📱 ImageHandlerTests (ImageHandler2PlatformViewDoesNotUseHardwareLayer) Category=Image |
✅ FAIL — 491s | ✅ PASS — 386s |
🔴 Without fix — 📱 ImageHandlerTests (ImageHandler2PlatformViewDoesNotUseHardwareLayer): FAIL ✅ · 491s
(no coded error found; showing last 1200 chars)
"totalMemoryBytes": 8322990080
},
"target": {
"kind": "emulator",
"name": "sdk_gphone_x86_64",
"identifier": "emulator-5554",
"operatingSystem": "Android",
"operatingSystemVersion": "11",
"apiLevel": 30,
"architecture": "x86_64",
"supportedArchitectures": [
"x86_64",
"x86",
"arm64-v8a",
"armeabi-v7a",
"armeabi"
],
"manufacturer": "Google",
"model": "sdk_gphone_x86_64",
"productName": "sdk_gphone_x86_64",
"buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
"cpuModel": "0",
"cpuMaxFrequencyHertz": 2000,
"totalMemoryBytes": 2077544448
}
}
}
<<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
info: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 1 (TESTS_FAILED)
Passed: 0
Failed: 1
Skipped: 0
Total: 1
Tests completed with exit code: 1
🟢 With fix — 📱 ImageHandlerTests (ImageHandler2PlatformViewDoesNotUseHardwareLayer): PASS ✅ · 386s
(no coded error found; showing last 1200 chars)
624000,
"totalMemoryBytes": 8322990080
},
"target": {
"kind": "emulator",
"name": "sdk_gphone_x86_64",
"identifier": "emulator-5554",
"operatingSystem": "Android",
"operatingSystemVersion": "11",
"apiLevel": 30,
"architecture": "x86_64",
"supportedArchitectures": [
"x86_64",
"x86",
"arm64-v8a",
"armeabi-v7a",
"armeabi"
],
"manufacturer": "Google",
"model": "sdk_gphone_x86_64",
"productName": "sdk_gphone_x86_64",
"buildFingerprint": "google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys",
"cpuModel": "0",
"cpuMaxFrequencyHertz": 2000,
"totalMemoryBytes": 2077544448
}
}
}
<<XHARNESS_RESULT_END>>
info: Attempting to remove apk 'com.microsoft.maui.core.devicetests'..
info: Successfully uninstalled com.microsoft.maui.core.devicetests
XHarness exit code: 0
Passed: 1
Failed: 0
Skipped: 0
Total: 1
Tests completed successfully
📁 Fix files reverted (1 files)
src/Core/src/Handlers/Image/ImageHandler2.Android.cs
📋 Pre-Flight — Context & Validation
Issue: #38298 - [Android][Material 3] PDF Pages Render Blurry During Zooming After Upgrading from .NET MAUI 10.0.51 to 10.0.60+
PR: #38362 - [Android] Fix blurry Material 3 images when scaled
Platforms Affected: Android 14+ with Material 3 enabled
Files Changed: 1 implementation, 1 device test
Key Findings
- Material 3 registers
ImageHandler2, whose platform view isShapeableImageView; the reported high-resolution document images become blurry while zooming, while theAppCompatImageViewpath remains sharp. - The PR clears
ShapeableImageView's forced per-view hardware layer by callingSetLayerType(LayerType.None, null)immediately after construction. - The added Android Core device test asserts that an
ImageHandler2platform view reportsLayerType.None. The completed gate proved this test fails without the production change and passes with it. - Inline review raised a concrete adjacent-behavior risk:
ShapeableImageViewuses a hardware layer for its shape-mask drawing path, so alternatives should preserve non-rectangular clipping and transparent masking rather than merely repeat the PR's layer reset. - Earlier unimplemented hypotheses in prior review output (
HasOverlappingRendering()and togglingBitmapDrawable.FilterBitmap) were blocked before testing and should not be repeated. - The current worktree contains caller-owned changes to trusted review tooling. Try-fix must use
EstablishBrokenBaseline.ps1exactly as required and reportBlockedrather than alter or clean those files if baseline establishment rejects them.
Code Review Summary
Verdict: SKIPPED
Confidence: N/A
Errors: 0 | Warnings: 0 | Suggestions: 0
The dedicated expert pass is deferred to STEP 5b by the execution contract. No separate expert-review agent was launched during candidate generation.
Validation Scope
Primary test:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=Image" -IncludeClasses "Microsoft.Maui.DeviceTests.ImageHandlerTests" -IncludeMethods "ImageHandler2PlatformViewDoesNotUseHardwareLayer"
No additional mandatory regression tests were supplied. Do not rerun gate verification or any full test suite.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #38362 | Clear the forced per-view layer with LayerType.None |
PASS (Gate) | ImageHandler2.Android.cs, test |
Original PR; masking-path concern remains for STEP 5b |
🔬 Code Review — Deep Analysis
Code Review — PR #38362
Independent Assessment
What this changes: The Android Material 3 image handler clears ShapeableImageView's forced per-view hardware layer immediately after construction, while retaining the normal hardware-accelerated rendering pipeline. The added device test verifies that the resulting platform view reports LayerType.None.
Inferred motivation: A dedicated hardware layer rasterizes the image at view resolution and can remain blurry when a high-resolution image is subsequently scaled or zoomed. Returning layer selection to Android avoids that retained low-resolution surface.
Expert Reviewer Result
The single maui-expert-reviewer pass found no actionable file:line defects and wrote a valid empty findings array to inline-findings.json. It found no mapper, lifecycle, public-API, memory, threading, or null-safety issue in the submitted diff.
Reconciliation with PR Narrative
The implementation matches the stated root cause and fix: only the Material 3 ImageHandler2 path uses ShapeableImageView, and LayerType.None clears a forced per-view layer without disabling application-level hardware acceleration. The submitted PR now includes a device test, so the description's "Why test not Added?" section is stale.
Prior Review Reconciliation
| Prior finding | Source | Status | Evidence |
|---|---|---|---|
| The original comment incorrectly implied hardware acceleration was disabled | Copilot inline review | ✅ Fixed | The current comment accurately says the forced per-view layer is cleared. |
Clearing the layer may break ShapeableImageView's non-rectangular DST_OUT mask path |
Copilot inline review | The submitted test checks only LayerType.None; it does not render a shaped image or verify transparent corner masking. No submitted code or test disproves the adjacent behavior concern. |
|
| No deterministic regression coverage | MauiBot prior review | ✅ Addressed for the layer-policy regression | The trusted Gate proves ImageHandler2PlatformViewDoesNotUseHardwareLayer fails without the production change and passes with it. The test still does not cover visual sharpness or shape masking. |
Blast Radius Assessment
- Runs for all instances: Yes. Every Android Material 3
Imagecreated throughImageHandler2receives the layer reset. - Startup impact: No. It runs only while creating an image platform view.
- Static/shared state: None.
- Default/null state: Safe. The call targets a newly constructed, non-null native view and does not depend on a source, parent, handler recipient, or binding state.
CI Status
- Required-check query: unavailable because
ghis unauthenticated; this is a tool gap rather than evidence that required checks passed. - Trusted Gate: ✅ PASSED. The focused Android device test failed without the fix and passed with it.
- Broader UI evidence: the recorded Android UI run had an infrastructure fixture-setup failure for 23 tests; it does not establish a PR-caused regression.
Findings
No new actionable inline findings were produced by the expert reviewer. The prior shape-mask concern remains a concrete adjacent-behavior coverage gap and should be resolved by the one permitted reviewer refinement rather than by speculative production changes.
Failure-Mode Probing
- Handler disconnect/reconnect: No listener or retained state is added; each replacement platform view receives the same construction-time policy.
- Null
Parent,VirtualView, or image source: None is read by the new call, so these states do not alter behavior. - Images without transforms: They use Android's normal layer selection; the policy change still applies to every instance.
- Non-rectangular native shape customizations: The current test does not prove that transparent corner masking survives
LayerType.None; this is the only unresolved adjacent scenario. - Animated/source updates: No drawable sampling flag or source pipeline state is changed.
External Output Contract
Not applicable.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The submitted mechanism is localized, empirically satisfies its focused gate, and has no expert-identified implementation defect. Approval should remain conditional until the single reviewer candidate checks that clearing the forced layer preserves ShapeableImageView masking; uncertainty should be recorded if that validation is blocked.
🛠️ Try-Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | gpt-5.3-codex / try-fix |
Avoid activating the shape-mask rendering path for default rectangular images while preserving Material masking where needed | BLOCKED | None | Baseline guard rejected caller-owned dirty trusted-tool files before implementation |
| 2 | gpt-5.6-sol / try-fix |
Preserve the mask-capable hardware layer and rebuild it when effective transforms change | BLOCKED | None | Baseline guard rejected the same caller-owned dirty trusted-tool files before implementation |
| PR | PR #38362 | Clear the forced per-view hardware layer with LayerType.None |
PASS (Gate) | 1 implementation, 1 test | Original PR; inline review questions shape-mask preservation |
Candidate 1
Candidate 1 proposed retaining ShapeableImageView and controlling when its
shape-mask rendering path is active. Unlike the PR's unconditional layer reset,
the planned mechanism would keep default rectangular images on a normal
rendering path while preserving Material masking for genuinely shaped content.
It also avoided the previously blocked HasOverlappingRendering() and
BitmapDrawable.FilterBitmap hypotheses.
The candidate could not be implemented. The mandatory
EstablishBrokenBaseline.ps1 invocation rejected the caller-owned modified
trusted review-tool overlay as a dirty working directory before creating
.github/.baseline-state.json. Per the try-fix protocol, no tracked file was
edited and no workaround cleanup was attempted. The exact candidate diff is
empty.
The selected primary test was not run because baseline establishment blocked
the attempt:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=Image" -IncludeClasses "Microsoft.Maui.DeviceTests.ImageHandlerTests" -IncludeMethods "ImageHandler2PlatformViewDoesNotUseHardwareLayer"
Inline self-review recorded zero findings because there was no candidate diff.
The required script-only restore ran and reported No baseline state found /
Restored=False, which is the expected no-state result for this blocked path.
Detailed narrative:
CustomAgentLogsTmp/PRState/38362/PRAgent/try-fix-1/content.md
Candidate 2
Candidate 2 used candidate 1's recorded result and selected a distinct
transform-aware retained-layer strategy. It proposed preserving
ShapeableImageView's hardware-backed Material mask path while detecting
effective transform changes and invalidating or rebuilding the retained layer
before drawing. This targets stale view-resolution layer rasterization rather
than direct layer removal, mask-path activation, overlapping-render hints, or
bitmap filtering.
The candidate could not be implemented for the same environment reason as
candidate 1. The required baseline command rejected the pre-existing
caller-owned trusted-tool changes before creating a restore allow-list. No
tracked file was edited, candidate 1 was not reopened or rerun, and the exact
candidate diff is empty.
The primary test was not run because baseline establishment blocked the
attempt. The candidate also noted that the supplied test is deliberately
mechanism-specific: a strategy retaining a hardware layer would be expected to
fail its LayerType.None assertion even if it improved visual sharpness. The
test was not altered or weakened.
Inline self-review recorded zero findings against the empty diff. The mandatory
script-only restore ran and reported No baseline state found /
Restored=False, the expected result when baseline state was never created.
Detailed narrative:
CustomAgentLogsTmp/PRState/38362/PRAgent/try-fix-2/content.md
Captured Candidate Diffs
Candidate 1:
Candidate 2:
Validation Scope
The only permitted command for both attempts was:
pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=Image" -IncludeClasses "Microsoft.Maui.DeviceTests.ImageHandlerTests" -IncludeMethods "ImageHandler2PlatformViewDoesNotUseHardwareLayer"
It was not run because both attempts were blocked at mandatory baseline
establishment. No additional mandatory regression tests were supplied, and no
full suite, gate rerun, correction, or retest was performed.
Cross-Pollination
Skipped by execution contract.
Exhausted: Yes - both permitted model invocations completed, and no further
candidate or reviewer agent was launched.
Selected Fix: PR #38362's existing fix remains the only empirically validated
option because the gate passed for it. Neither alternative can supersede it:
both remain unimplemented, unreviewable hypotheses with no test execution.
Candidate 2 also conflicts with the current mechanism-specific test by design.
The masking-risk concern and the alternatives' conceptual tradeoffs remain for
STEP 5b's dedicated expert comparison.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the title omits the specific handler component, and the description is stale because the submitted PR now includes an Android device test.
Recommended title
[Android] ImageHandler2: Fix blurry Material 3 images when scaled
Recommended description
### Root Cause
On Android with Material 3 enabled, the MAUI `Image` control uses `ImageHandler2` with a `ShapeableImageView`. `ShapeableImageView` forces a dedicated per-view hardware layer, which can rasterize high-resolution image content at the view's unscaled resolution and make it appear blurry when zoomed.
The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force that dedicated view layer.
### Description of Change
Updated `ImageHandler2` to call `SetLayerType(LayerType.None, null)` immediately after creating its `ShapeableImageView`. This clears the forced per-view layer and restores Android's normal layer selection without disabling application-level hardware acceleration. The native platform view remains a `ShapeableImageView`, and Material 3 handler registration is unchanged.
Added the Android Core device test `ImageHandler2PlatformViewDoesNotUseHardwareLayer`, which verifies that an `ImageHandler2` platform view uses `LayerType.None`. The focused gate proves that this assertion fails without the production change and passes with it.
### Validation
A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but screenshots did not show a measurable difference with and without the fix. The fix was also validated manually using a high-resolution document image with fine details.
### Issues Fixed
Fixes #38298
### Tested the behavior in the following platforms
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac
| Before Issue Fix | After Issue Fix |
|---|---|
| <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" /> |
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr-plus-reviewer
Comparative Ranking
| Rank | Candidate | Implementation | Regression evidence | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Clears the persistent view hardware layer, then isolates ShapeableImageView's DST_OUT mask with a per-draw canvas layer |
PASS — the exact scoped Android method passed 1/1 and now checks both LayerType.None and parent-safe rounded masking |
Best balance: retains the blur fix's layer policy while preserving the Material shape-mask compositing contract. |
| 2 | pr |
Calls SetLayerType(LayerType.None, null) on the raw ShapeableImageView |
PASS — trusted Gate failed without the fix and passed with it | Fixes the verified layer-policy regression, but leaves DST_OUT drawing unisolated and tests only the final layer flag. |
| 3 | try-fix-1 |
Proposed avoiding the mask path for default rectangular images | BLOCKED — no diff and no test execution | Conceptually preserves shaped rendering, but remained an unimplemented hypothesis after baseline establishment rejected the dirty raw worktree. |
| 4 | try-fix-2 |
Proposed retaining and rebuilding the hardware view layer when transforms change | BLOCKED — no diff and no test execution | Unimplemented, lifecycle-heavy, and intentionally incompatible with the supplied LayerType.None regression assertion. |
No candidate failed an executed regression test. The two candidates with passing empirical evidence rank above both blocked try-fix hypotheses.
Expert Review
The single maui-expert-reviewer pass reported no new actionable inline findings and wrote [] to inline-findings.json. Independent prior-review reconciliation nevertheless confirmed that Material Components 1.12 sets LAYER_TYPE_HARDWARE because ShapeableImageView.OnDraw uses a PorterDuff.Mode.DST_OUT mask. Clearing that layer without another isolation boundary can erase content already drawn by the parent canvas.
Why pr-plus-reviewer Wins
The submitted PR is directionally correct and its trusted Gate proves the intended layer-policy change. pr-plus-reviewer keeps that behavior but supplies the compositing boundary the Material implementation relied on, then exercises the adjacent non-rectangular mask case inside the same required test method. Its build and focused Android validation passed from the exact pre-created sandbox.
The try-fix candidates cannot displace either tested implementation: both were blocked before producing code or evidence. Candidate 2 also adds substantially more transform-listener lifecycle risk than the localized winning approach.
Remaining Uncertainty
The automated test verifies layer policy and mask composition, not perceptual sharpness under an interactive high-resolution zoom. The winning approach uses a transient draw layer rather than a retained view layer, but the original manual high-resolution scenario should remain the final visual acceptance criterion.
Required Change
Apply pr-plus-reviewer/reviewer.patch to the submitted fix. Because the winning candidate contains changes not present in the raw PR, the required recommendation is REQUEST CHANGES.
📱 UI Tests — ViewBaseTests
Detected UI test categories: ViewBaseTests
✅ Deep UI tests — 118 passed, 0 failed, 1 skipped across 1 category on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
ViewBaseTests |
118/119 (1 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: pr-plus-reviewer retains the submitted LayerType.None blur fix while restoring the isolated drawing surface required by ShapeableImageView's DST_OUT mask. Its strengthened focused Android test passed and covers both the layer policy and parent-safe rounded masking; both try-fix alternatives were blocked without code or test evidence.
Address the actionable findings in this review before merging.
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Rootcause: On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses `AppCompatImageView`, which does not force a dedicated hardware layer. ### Description of Change Updated `ImageHandler2` to set the `ShapeableImageView` layer type to `LAYER_TYPE_NONE`. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preserving `ShapeableImageView` and Material 3 functionality <!-- Enter description of the fix in this section --> ### Why test not Added ? A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38298 ### Tested the behavior in the following platforms - [ ] Windows - [x] Android - [ ] iOS - [ ] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <img width="1080" height="2400" alt="Beforefix38298" src="https://github.com/user-attachments/assets/7e813199-f910-4c6a-8226-0875ea89b434" /> | <img width="1080" height="2400" alt="AfterFixBlur" src="https://github.com/user-attachments/assets/2dc27067-087c-441a-bcf3-7528fec0f62c" />| <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
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 whether this change resolves your issue. Thank you!
Rootcause:
On Android with Material 3 enabled, high-resolution images displayed using the MAUI Image control appear blurry when zoomed. The issue does not occur with Material 3 disabled because the standard handler uses
AppCompatImageView, which does not force a dedicated hardware layer.Description of Change
Updated
ImageHandler2to set theShapeableImageViewlayer type toLAYER_TYPE_NONE. This restores Android’s normal view rendering without disabling application-level hardware acceleration, while preservingShapeableImageViewand Material 3 functionalityWhy test not Added ?
A visual test using the .NET Bot image was evaluated on a Pixel 3 XL, but it passed with and without the fix because the screenshots did not show a measurable difference. Since it did not reliably detect the regression, it was not added. The fix was validated manually using a high-resolution document image with fine details.
Issues Fixed
Fixes #38298
Tested the behavior in the following platforms