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

Adds a LocalPreviewImageLoader CompositionLocal. #2201

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JayShortway
Copy link
Member

Description

This replaces the previewImageLoader parameter in RemoteImage with a LocalPreviewImageLoader CompositionLocal. This is similar to how previews are handled in Coil 3.

Motivation

This will be very helpful in rendering images in our template previews. Without this change, we would have to propagate the previewImageLoader parameter through the entire component tree, adding it to every ComponentView. This change avoids that, because we can just wrap our previewed composable in ProvidePreviewImageLoader().

@JayShortway JayShortway self-assigned this Feb 28, 2025
@@ -72,6 +72,7 @@ import com.revenuecat.purchases.ui.revenuecatui.components.style.ImageComponentS
import com.revenuecat.purchases.ui.revenuecatui.composables.RemoteImage
Copy link
Member Author

Choose a reason for hiding this comment

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

I highly recommend reviewing this file with whitespace hidden on GitHub.

Copy link

emerge-tools bot commented Feb 28, 2025

📸 Snapshot Test

56 added, 206 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
56 0 0 0 206 0 ⏳ Needs approval

🛸 Powered by Emerge Tools

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.47%. Comparing base (d2ecc90) to head (43b03d9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2201   +/-   ##
=======================================
  Coverage   80.47%   80.47%           
=======================================
  Files         277      277           
  Lines        9460     9460           
  Branches     1335     1335           
=======================================
  Hits         7613     7613           
  Misses       1287     1287           
  Partials      560      560           

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

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.

1 participant