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
[TIMOB-25374] Android: borderColor not visible on Android tiSDK 6.2.2 #9510
Conversation
Change docs.
@@ -1427,14 +1427,18 @@ private void initializeBorder(KrollDict d, Integer bgColor) | |||
borderView.setColor(TiConvert.toColor(d, TiC.PROPERTY_BORDER_COLOR)); | |||
} | |||
|
|||
//Have a default border width of 1 | |||
Object borderWidth = "1"; |
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've confirmed that Titanium for iOS defaults the borderWidth
to "1dp" (Apple's framework takes UI measurements in points/dips by default). This can be seen in the [TiUIView setBorderColor]
method here...
https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIView.m#L483
So, I recommend that you change "1" to "1dp" here to match iOS' behavior.
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.
@jquick-axway I set it as a String with value '1' to use the ti.ui.defaultunit
that is set in tiapp.xml. I think iOS does the same here:
https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiDimension.m#L103
apidoc/Titanium/UI/View.yml
Outdated
@@ -1223,7 +1223,7 @@ properties: | |||
- name: borderWidth | |||
summary: Border width of the view. | |||
type: Number | |||
default: 0 | |||
default: 1 |
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.
Not sure here. It is 0 by default, but 1 if any related border is set. So if no border-related properties are set, I think it does not set 1 on iOS (cc @jquick-axway).
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.
@hansemannn Fair enough. Maybe adding as a description that we set default width to 1 if any border related property is set?
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 thought it only gets set to 1
when borderColor
is set? It is not set to 1
when borderRadius
is set on either platforms.
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.
That is correct, sorry for the confusion. Quite simple implementation on iOS:
- (void)setBorderColor_:(id)color
{
TiColor *ticolor = [TiUtils colorValue:color];
self.layer.borderWidth = MAX(self.layer.borderWidth, 1);
self.layer.borderColor = [ticolor _color].CGColor;
}
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.
CR: PASS
Tests:
Generated by 🚫 dangerJS |
…into TIMOB-25374
FR Passed. If no Studio Ver: 4.10.0.201709271713 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25374
Description:
Set default border width of 1 unit. Change in documentation.
#9507 needs to be merged first for this change to have a point.
Test case: