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

πŸ‘©β€πŸ”¬ [Investment Day] Add Smart Invert Support #645

Merged
merged 4 commits into from
Apr 9, 2019

Conversation

dusi
Copy link
Contributor

@dusi dusi commented Mar 26, 2019

πŸ“² What

Adds Smart Invert support

πŸ€” Why

Smart invert allows inverting the "chrome" of our app while keeping images untouched. This is only supported on iOS 11 so it's behind availability check.

πŸ›  How

"Simply" applied style to all UIImageViews that qualify as displaying user generated content.

πŸ‘€ See

Before Smart Invert ⚫️ Normal βšͺ️
Screen Shot 2019-03-26 at 4 05 50 PM Screen Shot 2019-03-26 at 3 35 54 PM Screen Shot 2019-03-26 at 3 36 03 PM
Screen Shot 2019-03-26 at 4 06 29 PM Screen Shot 2019-03-26 at 3 39 06 PM Screen Shot 2019-03-26 at 3 39 18 PM
Screen Shot 2019-03-26 at 4 06 46 PM Screen Shot 2019-03-26 at 3 40 17 PM Screen Shot 2019-03-26 at 3 40 24 PM
Screen Shot 2019-03-26 at 4 07 07 PM Screen Shot 2019-03-26 at 3 41 21 PM Screen Shot 2019-03-26 at 3 41 28 PM
Screen Shot 2019-03-26 at 4 07 16 PM Screen Shot 2019-03-26 at 3 41 58 PM Screen Shot 2019-03-26 at 3 42 04 PM
Screen Shot 2019-03-26 at 4 07 29 PM Screen Shot 2019-03-26 at 3 42 13 PM Screen Shot 2019-03-26 at 3 42 19 PM
Screen Shot 2019-03-26 at 4 07 36 PM Screen Shot 2019-03-26 at 3 42 37 PM Screen Shot 2019-03-26 at 3 42 45 PM
Screen Shot 2019-03-26 at 4 07 43 PM Screen Shot 2019-03-26 at 3 43 47 PM Screen Shot 2019-03-26 at 3 43 55 PM
Screen Shot 2019-03-26 at 4 08 42 PM Screen Shot 2019-03-26 at 3 44 34 PM Screen Shot 2019-03-26 at 3 44 41 PM

♿️ Accessibility

To toggle Smart Invert on or off you can go to Settings > General > Accessibility > Display Accommodations > Invert Colors > Smart Invert or enable Accessibility Shortcut in Settings > General > Accessibility > Accessibility Shortcut (all the way in the bottom) > Smart Invert

  • All user generated content preserves its colors while Smart Invert is enabled

βœ… Acceptance criteria

  • All snapshot tests pass (ensures previous behaviour stays untouched)

@dusi dusi force-pushed the a11y-smart-invert-support branch from ba3fa89 to 8b4a4b4 Compare March 26, 2019 23:15
@dusi dusi added the blocked a PR that is blocked for external reasons label Mar 28, 2019
Copy link
Contributor

@justinswart justinswart left a comment

Choose a reason for hiding this comment

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

Pretty cool!

So far I just noticed that on the profile view the avatar is not adhering to the change. And as we discussed IRL, the tab bar icon. Looks like there are some questionable ways to get hold of that image view πŸ€”

@dusi
Copy link
Contributor Author

dusi commented Apr 1, 2019

@justinswart I've included Smart Invert support for CircleAvatarImageView (this should fix all the rounded avatar images thorough the app) and tried to play with inverting the tab bar item but this one without luck. I'd suggest we defer it to some future work for now.

@justinswart
Copy link
Contributor

Forgot about appearance proxy πŸ˜…

This seems to fix the profile avatar:

UIImageView.appearance(whenContainedInInstancesOf: [UITabBar.self]).accessibilityIgnoresInvertColors = true

And placing this line in one place might be all we need:

UIImageView.appearance().accessibilityIgnoresInvertColors = true

But as you mentioned IRL there might be image views where we do want to invert.

@dusi dusi requested a review from justinswart April 4, 2019 17:42
@dusi dusi removed the blocked a PR that is blocked for external reasons label Apr 5, 2019
@dusi dusi assigned justinswart and unassigned Scollaco Apr 5, 2019
Copy link
Contributor

@justinswart justinswart left a comment

Choose a reason for hiding this comment

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

This lgtm, I think the only question I'd have is whether we could achieve the whole change through UIAppearance proxy, but I think you mentioned that there are some UIImageViews that we don't want to apply this to.

@dusi dusi merged commit 27ecb04 into master Apr 9, 2019
@dusi dusi deleted the a11y-smart-invert-support branch April 9, 2019 16:38
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.

3 participants