-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(android): box shadow and border radius white border resolution #10125
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
fix(android): box shadow and border radius white border resolution #10125
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit dc3e10c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@rigor789 I had misunderstood you, I thought it was just the passing of the color, now the layer will not be added if it already has a background |
@NathanWalker @rigor789 can we review this pr? |
|
||
// add our layers | ||
this.addLayer(shadowLayer); | ||
this.addLayer(overlayLayer); | ||
if(!((BorderDrawable) this.wrappedLayer).hasBackgroundColor()){ |
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.
This might be unsafe, this.wrappedLayer
might not always be a BorderDrawable, so casting to it can lead to exceptions. A safer approach would be to check the type of wrappedLayer
.
@rigor789 @NathanWalker I have updated the PR with the type check |
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.
Looks good to me, just left some small nits about the method naming. 👍
...ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java
Outdated
Show resolved
Hide resolved
...ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java
Outdated
Show resolved
Hide resolved
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.
This PR is invalid at this point but if fixed we could include with 8.5 still.
ns-android-box-shadow-pr-invalid.mov
Simplified the logic to hide the overlay layer when the wrapped drawable has a background color, image or gradient. The above issue was caused by changing the order of the |
Refactored to not create the layer as originally intended - but preserving the order of layers now correctly. |
@rigor789 oh sorry, I thought the order wouldn't matter and put it in an order that I thought was more readable |
When you have a dark screen and you apply box-shadow and border radius you see a rather strange white border. Applying this change solves it. I haven't seen any difference on a clear screen, so I think it doesn't break anything
Old:

Fix:
