Skip to content
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

ANDROID-14761 Fix Image size of EmptyStateScreenView when it's IMAGE_SIZE_FULL_WIDTH #363

Merged

Conversation

jeprubio
Copy link
Contributor

@jeprubio jeprubio commented Jun 4, 2024

🥅 What's the goal?

In EmptyStateScreenView when the image type is IMAGE_SIZE_FULL_WIDTH it loads the image in full width but it doesn't use the ratio of 16:9 to assign the height. As it's also using ScaleType.CENTER_CROP as scale type it results in the image being cropped.

🚧 How do we do it?

  • In order to not having to add a GlobalLayoutListener in order to calculate the height async that would result in the image blinking the simplest way is to update the layout so that the image is inside a ConstraintLayout instead of a LinearLayout and that way the aspect ratio can be used to get the height.

☑️ Checks

  • I updated the documentation, including readmes and wikis. If this is a breaking change, tag the PR with "Breaking Change" label and remember to include breaking change migration guide in release notes where this version is released.
  • Tested with dark mode.
  • Tested with API 24.

🧪 How can I test this?

before:
mistica_before
after:
mistica_after

ratioCalculator

And when applied to vivo:

Before After
update_screen_before update_screen_after
  • Mistica App QR or download link
  • Reviewed by Mistica design team

Copy link

github-actions bot commented Jun 4, 2024

📱 New catalog for testing generated: Download

@jeprubio jeprubio marked this pull request as ready for review June 5, 2024 08:14
@jeprubio jeprubio requested review from a team, dpastor, pmartinbTEF and yceballost and removed request for a team June 5, 2024 08:14
Copy link
Contributor

@yceballost yceballost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :)

Copy link
Contributor

@dpastor dpastor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! 👍

Copy link
Contributor

@pmartinbTEF pmartinbTEF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Did you try with vertical images? Did you try in api 24 device?

@jeprubio
Copy link
Contributor Author

jeprubio commented Jun 6, 2024

Nice! Did you try with vertical images? Did you try in api 24 device?

According to the specs it's only 16:9 images this type, I also checked the other types of images after doing the changes. I'm having trouble to create the api 24 emulator but I'll try again. By the way, shouldn't it be 25? I think we were going to set min api 25 everywhere.

@jeprubio
Copy link
Contributor Author

jeprubio commented Jun 6, 2024

Checked on both, api 24 and 25 as well.

@jeprubio jeprubio merged commit f654c69 into main Jun 6, 2024
5 checks passed
@jeprubio jeprubio deleted the bugfix/ANDROID-14761-EmptyStateScreenView_ImageDimensions branch June 6, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants