Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Conversation

@rachelmcr
Copy link
Contributor

Part of: woocommerce/woocommerce-ios#3824

Description

In LoginPrologueViewController, we have the option to provide a background color for the prologue buttons and have that background color extend the full width of the screen (when buttonsBackgroundColor and prologueViewBackgroundColor are the same color).

However, setting that background color to a dynamic color breaks the behavior in the same way as in the original issue woocommerce/woocommerce-ios#3319.

Changes

In #539, the fix for woocommerce/woocommerce-ios#3319 includes a check to compare prologueViewBackgroundColor and buttonsBackgroundColor, to determine if the blur effect should be applied or if the view's background color should be set.

However, that compares the UIColor objects, which may be different even if their color values are the same. This PR compares the CGColor value instead, to ensure we're doing a valid comparison of the color data.

/ Before After
Light Simulator Screen Shot - iPad Pro (12 9-inch) (4th generation) - 2021-03-18 at 17 30 45 Simulator Screen Shot - iPad Pro (12 9-inch) (4th generation) - 2021-03-18 at 17 40 31
Dark Simulator Screen Shot - iPad Pro (12 9-inch) (4th generation) - 2021-03-18 at 16 05 27 Simulator Screen Shot - iPad Pro (12 9-inch) (4th generation) - 2021-03-18 at 16 03 24

Testing

Build and run the app from the branch in WooCommerce that uses these changes, to confirm the background looks as expected in light and dark mode: https://github.com/woocommerce/woocommerce-ios/tree/issue/3824-prologue-carousel

@rachelmcr rachelmcr added the bug Something isn't working label Mar 18, 2021
@rachelmcr rachelmcr requested a review from ctarda March 18, 2021 17:43
Copy link
Contributor

@ctarda ctarda left a comment

Choose a reason for hiding this comment

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

Fantastic!

Thanks for preparing a branch in WooCommerce to test this. This is how the login prologue looks for me:

:shipit:

@rachelmcr rachelmcr merged commit d21b61d into develop Mar 18, 2021
@rachelmcr rachelmcr deleted the fix/prologue-bgcolor branch March 18, 2021 20:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants