-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix [Android] Image AspectFill is not honored #25072
base: main
Are you sure you want to change the base?
Fix [Android] Image AspectFill is not honored #25072
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
public void VerifyImageAspects() | ||
{ | ||
App.WaitForElement("LabelNames"); | ||
VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triggered the build, it should generate the reference snapshot for this test.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -17,6 +17,11 @@ public static void Clear(this ImageView imageView) | |||
|
|||
public static void UpdateAspect(this ImageView imageView, IImage image) | |||
{ | |||
if (image.Aspect is Aspect.AspectFill) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I delete this code the test still passes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new test has been added, and now the test only passes when the fix is applied. This ensures that the fix is correctly addressing the issue, and without it, the test fails as expected.
Azure Pipelines successfully started running 3 pipeline(s). |
Azure Pipelines successfully started running 3 pipeline(s). |
Root Cause
In Image Android Handler, set true for SetAdjustViewBounds(), when you enable view bounds adjustment, the ImageView will automatically resize to maintain the image's aspect ratio.
Description of Change
This update fixes image aspect handling for Android in ImageView, If the aspect is AspectFill, set the false for SetAdjustViewBounds(), so the view bounds are not adjusted, allowing the image to fill the view.
Tested the behaviour in the following platforms
Issues Fixed
Fixes #21368
Output Screenshot