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] update scroll views to support wide gamut color #43197

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ryanlntn
Copy link
Contributor

Summary:

This builds on previous PRs for the wide gamut color RFC and extends Android scroll views with support for DisplayP3 color.

Changelog:

[ANDROID] [ADDED] - update scroll views to support wide gamut color

Test Plan:

  1. Pull changes from these previous PRs:
    [JS] Add support for CSS4 color() functions #42831
    [Android] Update ColorPropConverterto support color function values #43031
    [Android] Add isWideColorGamutEnabled to ReactActivityDelegate #43036
    [Android] Add DisplayP3 background and border support to View #43056
  2. Follow the test steps for each PR
  3. Pull these changes and build RNTester for Android: cd packages/rn-tester && yarn android
  4. Navigate to ScrollViewExample and modify to set DisplayP3 background/borders/endFill

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Infinite Red Partner: Infinite Red Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Feb 26, 2024
@ryanlntn ryanlntn force-pushed the feat/wide-gamut-color-android-scrollview branch 2 times, most recently from eeb6432 to 42778aa Compare March 15, 2024 10:35
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@@ -857,9 +858,10 @@ private boolean isScrollPerfLoggingEnabled() {
public void draw(Canvas canvas) {
if (mEndFillColor != Color.TRANSPARENT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right, since we are now comparing int color to packed color long.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe in this case they both evaluate to 0L but I'll update to make it explicit.

if (contentView != null && contentView.getBottom() < getHeight()) {
Paint paint = new Paint();
paint.setColor(mEndFillColor);
canvas.drawRect(0, contentView.getBottom(), getWidth(), getHeight(), paint);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we do this if we are creating mEndBackground from new color?

Copy link
Contributor Author

@ryanlntn ryanlntn Apr 8, 2024

Choose a reason for hiding this comment

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

That was an oversight. I meant to remove mEndBackground as we need to draw on the canvas directly in order to use paint.

@cipolleschi
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the feat/wide-gamut-color-android-scrollview branch from cfbfc83 to 07105c3 Compare April 10, 2024 11:23
@react-native-bot
Copy link
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 8, 2024
@cipolleschi
Copy link
Contributor

do not close

@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Infinite Red Partner: Infinite Red Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants