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

Assert view background with a plain color #371

Merged
merged 5 commits into from
Oct 1, 2020

Conversation

rocboronat
Copy link
Member

This PR fixes #370

As @alorma pointed in a private secret messaging app that only we have, this solution doesn't take into account colors with states. Just plain colors. Red 🧧 Green 💚 Blue 📘

What do you think about merging this? IMHO, this PR is a small step forward ⏩

EXTRA, EXTRA! 📰 This is how Chrome renders the blue_car emoji:

greenblue

@rocboronat rocboronat added the bug label Sep 30, 2020
val viewDrawable = view.background as ColorDrawable
return viewDrawable.color == expectedDrawable.color &&
viewDrawable.alpha == expectedDrawable.alpha &&
viewDrawable.opacity == expectedDrawable.opacity
Copy link
Member

Choose a reason for hiding this comment

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

alpha != opacity? :S

Copy link
Member Author

@rocboronat rocboronat Sep 30, 2020

Choose a reason for hiding this comment

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

🤷 honestly, I started comparing the values that seemed important. But don't know the difference between alpha and opacity.

@alorma
Copy link
Member

alorma commented Oct 1, 2020

Thanks for the PR @rocboronat !

@alorma alorma merged commit 8c38129 into master Oct 1, 2020
@alorma alorma deleted the assert-background-with-color branch October 1, 2020 10:31
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.

assertHasBackground doesn't work with colors
2 participants