Repository navigation
Make Image fadeDuration and progressiveRenderingEnabled optional in C++ - #58863
Closed
bartlomiejbloniarz wants to merge 1 commit into
Closed
bartlomiejbloniarz wants to merge 1 commit into
bartlomiejbloniarz wants to merge 1 commit into
Conversation
…in C++ Summary: On Android, props equal to their C++ default are not sent when a view is created, so each `ImageProps` default must describe the state a new image view starts in. Two defaults could not: - `fadeDuration` defaulted to 300, while `ReactImageView` treats an unset duration as "no fade for local resources, 300ms for remote images". It is now a `std::optional<Float>` that is unset by default, the Android image request keeps using 300 when it is unset, and `ReactImageView` maps a removed `fadeDuration` back to unset instead of 0. - `progressiveRenderingEnabled` defaulted to `false`, which image views that defer to the image pipeline's default never received when passed explicitly. It is now a `std::optional<bool>` that is unset by default; the Android image request keeps using `false` when it is unset. Changelog: [General][Breaking] - `ImageProps::fadeDuration` and `ImageProps::progressiveRenderingEnabled` are now `std::optional` in C++ [Android][Fixed] - Fix explicit `fadeDuration` being ignored on newly created `Image`s Differential Revision: D123029512
|
@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123029512. |
|
This pull request has been merged in 98d6795. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
On Android, props equal to their C++ default are not sent when a view is created, so each
ImagePropsdefault must describe the state a new image view starts in. Two defaults could not:fadeDurationdefaulted to 300, whileReactImageViewtreats an unset duration as "no fade for local resources, 300ms for remote images". It is now astd::optional<Float>that is unset by default, the Android image request keeps using 300 when it is unset, andReactImageViewmaps a removedfadeDurationback to unset instead of 0.progressiveRenderingEnableddefaulted tofalse, which image views that defer to the image pipeline's default never received when passed explicitly. It is now astd::optional<bool>that is unset by default; the Android image request keeps usingfalsewhen it is unset.Changelog:
[General][Breaking] -
ImageProps::fadeDurationandImageProps::progressiveRenderingEnabledare nowstd::optionalin C++[Android][Fixed] - Fix explicit
fadeDurationbeing ignored on newly createdImagesDifferential Revision: D123029512