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

[Android] fix border style without borderRadius #6789

Closed
wants to merge 1 commit into from

Conversation

skv-headless
Copy link
Contributor

closes #6721 closes #3159
before(without borderRadius)
bug

after
fix

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @spicyj, @mkonicek and @vjeux to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Apr 3, 2016
@skv-headless skv-headless changed the title fix border style without borderRadius [Android] fix border style without borderRadius Apr 3, 2016
@chirag04
Copy link
Contributor

chirag04 commented Apr 3, 2016

will also fix #3159.

I haven't tested this change tho.

@@ -95,7 +95,7 @@

@Override
public void draw(Canvas canvas) {
if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null || mBorderStyle != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check for "solid" too?

@skv-headless
Copy link
Contributor Author

@ide please don't merge. In that solution there is problem with changing border style. I need more time to explore code.

@facebook-github-bot
Copy link
Contributor

@skv-headless updated the pull request.

@skv-headless
Copy link
Contributor Author

@ide done. But variable names are not obvious. And I'm not sure about difference between drawRoundedBackgroundWithBorders and drawRectangularBackgroundWithBorders

@skv-headless
Copy link
Contributor Author

@ide Do I need to explain something?

@@ -322,6 +327,7 @@ private int getFullBorderColor() {
}

private void drawRectangularBackgroundWithBorders(Canvas canvas) {
updatePathEffectForBorderStyle();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this call go above line 341?

@mkonicek
Copy link
Contributor

mkonicek commented Apr 7, 2016

@kmagiera What do you think?

@skv-headless skv-headless force-pushed the fix-border-style branch 2 times, most recently from 8f3d0fd to 2d9bab6 Compare April 11, 2016 09:20
@facebook-github-bot
Copy link
Contributor

@skv-headless updated the pull request.

@skv-headless
Copy link
Contributor Author

Do I need to do something else? My changes are pretty straightforward.

@mkonicek
Copy link
Contributor

@skv-headless This is waiting for a review by @kmagiera who I believe has context on this part of the codebase. If he doesn't get back to you in a few days please ping me.

@facebook-github-bot
Copy link
Contributor

@skv-headless updated the pull request.

@satya164
Copy link
Contributor

ping @mkonicek

@@ -46,7 +46,6 @@ var ViewBorderStyleExample = React.createClass({
<View>
<View style={{
borderWidth: 1,
borderRadius: 5,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the border radius from the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To show that this patch is working.

@mkonicek
Copy link
Contributor

Thanks for the fix! Looks good, just some small nits.

@facebook-github-bot
Copy link
Contributor

@skv-headless updated the pull request.

boolean roundedBorders = mBorderCornerRadii != null ||
(!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0);

if ((mBorderStyle == null || mBorderStyle == BorderStyle.SOLID) && !roundedBorders) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this condition because I'm not sure how to call (mBorderStyle == null || mBorderStyle == BorderStyle.SOLID) this condition

@skv-headless
Copy link
Contributor Author

@mkonicek I've updated PR. Sorry for delay I was really busy 😫

@facebook-github-bot
Copy link
Contributor

@skv-headless updated the pull request.

call drawRoundedBackgroundWithBorders if borderStyle set
@ghost
Copy link

ghost commented Apr 26, 2016

@skv-headless do you have any updates for this pull request? It's been a while so we wanted to check in and see if you've looked at the requested changes.

@skv-headless
Copy link
Contributor Author

@mkonicek ping

@mkonicek
Copy link
Contributor

No problem @skv-headless, sorry on the delay on my side too :)

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: needs-revision labels Apr 29, 2016
@ghost
Copy link

ghost commented Apr 29, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghost ghost closed this in 58876d5 Apr 29, 2016
@bestander
Copy link
Contributor

@mkonicek @skv-headless this change broke ObjC tests.
Please consider Travis build status https://travis-ci.org/facebook/react-native/builds/125507502

Considering that it is a long weekend ahead of us we don't want to have a red trunk I'll do a revert.
Please try one more time with Obj-C tests fixed :)

@bestander
Copy link
Contributor

see #7303

@janicduplessis
Copy link
Contributor

Is it documented anywhere how to update the snapshot tests? I know @grabbou had to do it a few days ago maybe he can help.

@bestander
Copy link
Contributor

I think it is not documented but it is relatively straight forward.
You just need to run the failing test with XCode.
Every snapshot test has a setting "generate" or something.
Setting it to true would generate and replace the old snapshot with the new
one.
If you can't figure it out I'll help out next week :)

On Sat, Apr 30, 2016 at 1:10 AM, Janic Duplessis notifications@github.com
wrote:

Is it documented anywhere how to update the snapshot tests? I know
@grabbou https://github.com/grabbou had to do it a few days ago maybe
he can help.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#6789 (comment)

@grabbou
Copy link
Contributor

grabbou commented Apr 30, 2016

@janicduplessis thanks for the reminder, I am on that ;)

ptmt pushed a commit to ptmt/react-native that referenced this pull request May 9, 2016
Summary:
closes facebook#6721 closes facebook#3159
before(without borderRadius)
![bug](https://cloud.githubusercontent.com/assets/1488195/14235087/fcf79f8a-f9eb-11e5-9d44-7ab1d131be24.jpg)

after
![fix](https://cloud.githubusercontent.com/assets/1488195/14235067/8cf128b4-f9eb-11e5-8170-ad3a146d6104.jpg)
Closes facebook#6789

Differential Revision: D3240657

Pulled By: mkonicek

fb-gh-sync-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
fbshipit-source-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
zebulgar pushed a commit to nightingale/react-native that referenced this pull request Jun 18, 2016
Summary:
closes facebook#6721 closes facebook#3159
before(without borderRadius)
![bug](https://cloud.githubusercontent.com/assets/1488195/14235087/fcf79f8a-f9eb-11e5-9d44-7ab1d131be24.jpg)

after
![fix](https://cloud.githubusercontent.com/assets/1488195/14235067/8cf128b4-f9eb-11e5-8170-ad3a146d6104.jpg)
Closes facebook#6789

Differential Revision: D3240657

Pulled By: mkonicek

fb-gh-sync-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
fbshipit-source-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
samerce pushed a commit to iodine/react-native that referenced this pull request Aug 23, 2016
Summary:
closes facebook#6721 closes facebook#3159
before(without borderRadius)
![bug](https://cloud.githubusercontent.com/assets/1488195/14235087/fcf79f8a-f9eb-11e5-9d44-7ab1d131be24.jpg)

after
![fix](https://cloud.githubusercontent.com/assets/1488195/14235067/8cf128b4-f9eb-11e5-8170-ad3a146d6104.jpg)
Closes facebook#6789

Differential Revision: D3240657

Pulled By: mkonicek

fb-gh-sync-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
fbshipit-source-id: 4eb8f72d7278d880297fb73653ef530719af3d5b
react-one pushed a commit to react-one/react-native that referenced this pull request Sep 24, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
9 participants