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

MBL-1522: Blurry images on Campaign tab #2046

Merged
merged 4 commits into from
May 29, 2024

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented May 28, 2024

📲 What

A description of the change.

🤔 Why

So far: Campaign description comes from the HTML parser, we have reduce capabilities to deal or identify the content provided. After some changes made on the infra side we started having issues with images and gifs, Glide migration avoided crashes and gifs not loading but came with a problem causing low resolution images to be presented.

🛠 How

  • As the low resolution issues are tied only to images, we found a workaround with the least possible code changes, by using compose strategycaly to only load images.
  • Swapped the AppCompatImageView over a composeView to allow coil SubcomposeAsyncImage deal with the images, plus adding the loading indicator.
  • Downside here we loose the zoomIn capabilities on Images for campaign tab
  • No screenshot test available

👀 See

| Before 🐛 | After 🦋 |

Screenshot 2024-05-28 at 1 26 25 PM
  • Loading indicator on Images:
LoadingIndicator.mp4

| | |

📋 QA

Story 📖

MBL-1522

@@ -35,19 +42,43 @@ class ImageWithCaptionView @JvmOverloads constructor(
fun setImage(src: String) {
if (src.isEmpty() || src.isBlank()) {
binding.imageView.setImageDrawable(null)
binding.imageViewPlaceholder.setImageDrawable(null)
binding.composeViewImage.visibility = GONE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoids recycling cell issues

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image_view_placeholder"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The placeholder was the target of zoomIn images, no longer available.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.80%. Comparing base (13639aa) to head (09bad33).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2046      +/-   ##
============================================
- Coverage     67.80%   67.80%   -0.01%     
+ Complexity     2097     2096       -1     
============================================
  Files           353      353              
  Lines         21570    21570              
  Branches       3044     3044              
============================================
- Hits          14626    14625       -1     
  Misses         5304     5304              
- Partials       1640     1641       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Arkariang Arkariang marked this pull request as ready for review May 28, 2024 21:41
@Arkariang Arkariang self-assigned this May 28, 2024
@Arkariang Arkariang merged commit 8c0a861 into master May 29, 2024
3 checks passed
@Arkariang Arkariang deleted the imartin/blurry-images-compose branch May 29, 2024 16:44
Arkariang added a commit that referenced this pull request Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants