-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Improve default Button shadow & size appearance #3251
Conversation
float shadowDy = useDefaultShadow ? 4 : _nativeButton.ShadowDy; | ||
AColor shadowColor = useDefaultShadow ? _backgroundDrawable.PressedBackgroundColor.ToAndroid() : _nativeButton.ShadowColor; | ||
float shadowDy = useDefaultShadow ? 1 : _nativeButton.ShadowDy; | ||
AColor shadowColor = useDefaultShadow ? Color.FromHex("#c4c4c4").ToAndroid() : _nativeButton.ShadowColor; |
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.
Do we have a reference for this color code?
@@ -36,6 +36,9 @@ float PaddingTop | |||
set { _paddingTop = value; } | |||
} | |||
|
|||
double BorderWidth => Math.Max(Button.IsSet(Button.BorderWidthProperty) ? Button.BorderWidth : .25, 0); | |||
Color BorderColor => Button.IsSet(Button.BorderColorProperty) && Button.BorderColor != Color.Default ? Button.BorderColor : Color.FromHex("#c5c5c5"); |
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.
Same here - where do these colors come from? Is there a guide or source code we can point to?
5e1925d
to
0fbf747
Compare
build --uitests |
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.
|
||
RectF rect = new RectF(0, 0, width, height); | ||
rect.Inset(inset + PaddingLeft, inset + PaddingTop); |
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.
@samhouts after some testing , adding this back and subtracting the inset above that we remove, fix the issue with the corner radius that I noticed in my review, at the same time it makes the border width look bigger basically looking as before
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.
More testing seems that adding what we had with inset still makes #2664 look the same. Maybe we should pull that in ? At the same time I like the border better without the inset :/
(With inset changes back in)
1436 (With inset changes back in)
1st button seems smaller
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.
I'm seeing the same thing as @rmarinho on this one
I've been playing with this for a little bit and here's where I am so far
https://gist.github.com/PureWeen/855e7acdffe2087553a75881f95d23f6
Basically I changed the insets a bit because I wasn't quite sure on the intent of the math in the PR
I inset the background just based on padding and shadow
And then I inset the Outline the same but then plus half the borderwidth which just shrinks it down so the outer edge of the stroke lines up with the background
The effect of this is that if you set a really wide stroke you'll still see a shadow
This is probably something that we want to do: #4185 |
Co-Authored-By: Shane Neuville <pureween@users.noreply.github.com>
I think this PR introduces more problems than it solves. Closing for now. |
Description of Change
When using the
DefaultPadding
andDefaultShadow
platform specific properties, Button size and shadow now more closely match the default Android size and shadow. Note that this is not intended to be a pixel perfect match.#2664 Before >> After
#1436 Before >> After
WARNING: This is a visual breaking change from 2.5+.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
PR Checklist