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

Refactoring service image #25

Merged
merged 10 commits into from
Nov 28, 2023
Merged

Refactoring service image #25

merged 10 commits into from
Nov 28, 2023

Conversation

StaehliJ
Copy link
Contributor

@StaehliJ StaehliJ commented Oct 20, 2023

Description

The goal of this PR is to enhance the integrator experience with image url handling.

The new api allow to write with ease image url like the SRG SSR required.

Examples

val media: Media = ...
media.imageUrl.url(ImageWidth.W1920)
media.imageUrl.url(ImageWidth.W1920, IlHost.TEST)

val chapter: Chapter = ...
chapter.imageUrl.url(ImageSize.MEDIUM)
  
val defaultDecorator = DefaultImageUrlDecorator(IlHost.PROD) // or custom decorator
media.imageUrl.url(defaultDecorator, ImageSize.MEDIUM)

Changes

  • ImageUrl.rawUrl is private now
  • Add ImageUrlDecorator to decorate image url with a width
  • Remove ImageProvider replaced by DefaultImageUrlDecorator

@StaehliJ StaehliJ linked an issue Oct 20, 2023 that may be closed by this pull request
2 tasks
@Loic-Dumas Loic-Dumas force-pushed the 24-simplify-image-url-handling branch from 2b5348c to d1df120 Compare November 2, 2023 13:19
Copy link
Member

@MGaetan89 MGaetan89 left a comment

Choose a reason for hiding this comment

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

I've put a couple of comments about adding the @Px annotation. It should help Android Studio to display a warning when it can infer that a non-pixel value is passed instead.

@StaehliJ StaehliJ added this pull request to the merge queue Nov 28, 2023
Merged via the queue into main with commit aca31b8 Nov 28, 2023
3 checks passed
@StaehliJ StaehliJ deleted the 24-simplify-image-url-handling branch November 28, 2023 13:07
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.

Simplify Image url handling
4 participants