-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add Black Boundary on White Button #273
Conversation
if self.color == .white { | ||
self.containerView.layer.borderColor = UIColor.black.cgColor | ||
self.containerView.layer.borderWidth = 2 | ||
} else { | ||
self.containerView.layer.borderColor = UIColor.clear.cgColor | ||
self.containerView.layer.borderWidth = 0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.color == .white { | |
self.containerView.layer.borderColor = UIColor.black.cgColor | |
self.containerView.layer.borderWidth = 2 | |
} else { | |
self.containerView.layer.borderColor = UIColor.clear.cgColor | |
self.containerView.layer.borderWidth = 0 | |
} | |
containerView.layer.borderColor = color == .white ? UIColor.black.cgColor : UIColor.clear.cgColor | |
containerView.layer.borderWidth = color == .white ? 2 : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed here: f55c9fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does Android handle the boarder in dark mode? It seems like it'd have the same issue as a white button. Not sure if we want to consider triple checking with a designer on how/if the boarder on the white button should be handled for light vs dark mode.
I looked at Android code and they have logic in there where if color is white, black border with 2 points is made. I will post design docs on Slack, looks like there was black boundary around it. Let me check how it looks on dark mode, that's a good point. I guess issue would be visibility around white button against white or off white background colors if there is no border. Since there is no separate treatment on the button colors on dark/light themes, I think that should be a separate ticket. I can check on devices, check if their look is consistent across different modes and system background colors. |
|
||
private func customizeAppearance() { | ||
containerView.layer.borderColor = color == .white ? UIColor.black.cgColor : UIColor.clear.cgColor | ||
containerView.layer.borderWidth = color == .white ? 2 : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does Android use for border width? Looks like it's 1px but I'm not sure because the Merchant's image of the buttons you shared in Slack is very small. Figma designs show 1px https://www.figma.com/design/gn4AXdmJUOMVlrCMpyhfrf/QL---Checkout-Buttons?node-id=1-73&t=C9Kq3Q5LMzl7DqsD-0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thank you! I saw 2 in Android. But it did look a bit thick to me on screenshot for iOS.
It was 1 point in Android defined as a constant. Will make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up on my questions! 🚀
Reason for changes
Inbound from Merchant LI-47312 asking for parity on appearance of white button having
black boundary on Android SDK vs none in iOS SDK (no black boundary on white button)
Summary of changes
Before:
![buttonInboundPic](https://private-user-images.githubusercontent.com/9273272/332173254-f380e69c-f0d0-4f32-bac8-034e0e673859.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzEzMjEsIm5iZiI6MTczOTE3MTAyMSwicGF0aCI6Ii85MjczMjcyLzMzMjE3MzI1NC1mMzgwZTY5Yy1mMGQwLTRmMzItYmFjOC0wMzRlMGU2NzM4NTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcwMzQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTE4ODBhYWM1OWMzNTA0YzcyZWFhZjg5OTQ4ODEyYTAxMTUzOTVjOWVhYWQ3YWFkZjg2N2ZjNzA5N2U3YWNjZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.rNBHabIcwPKlGPKo8zxS_y1tYYisEsPyYzrWL2xzQFw)
After:
![Pay Later Button](https://private-user-images.githubusercontent.com/9273272/333302709-d2634249-ef1b-4c76-9c90-097cfe034602.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzEzMjEsIm5iZiI6MTczOTE3MTAyMSwicGF0aCI6Ii85MjczMjcyLzMzMzMwMjcwOS1kMjYzNDI0OS1lZjFiLTRjNzYtOWM5MC0wOTdjZmUwMzQ2MDIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcwMzQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGM4ZjEyNzUzOTdkN2E4MDA1NjhiMGE2YTE1YzE2MDAyMmFkZjNhZTIwM2FmYTA3YzdjZWY0YWUxZWUzZmFjNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.OVXyzBu8snj2S8Pl9Ma688rFwDP2LSz5qEduAMBvRsI)
![PayPal Button](https://private-user-images.githubusercontent.com/9273272/333302956-c75a652c-26a3-4741-9ea1-630a8ec8982f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzEzMjEsIm5iZiI6MTczOTE3MTAyMSwicGF0aCI6Ii85MjczMjcyL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