[TIMOB-26453] Android: default value of borderWidth of view is not respected, if borderRadius is set (but no borderColor)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-29T19:10:42.000+0000 |
Affected Version/s | Release 7.0.0 |
Fix Version/s | Release 8.0.0 |
Components | Android |
Labels | android, defect, parity, regression |
Reporter | Ma Wenli |
Assignee | Yordan Banev |
Created | 2018-10-11T07:48:40.000+0000 |
Updated | 2018-11-29T19:11:10.000+0000 |
Description
According to the doc (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-borderWidth), default value of
borderWidth
of view should be 0 as long as borderColor
is not set. However, looks like this default value is not respected on Android, if borderRadius
of the view is defined.
Sample code to reproduce (paste the following code to a new mobile app project and run it on Android):
var win = Titanium.UI.createWindow({
height: Titanium.UI.FILL,
width: Titanium.UI.FILL,
layout: 'vertical',
backgroundColor: '#FFFFFF'
});
var view1 = Titanium.UI.createView({
top: 20,
height: 100,
width: 280,
backgroundColor: '#000000'
// No borderRadius
});
view1.add(Titanium.UI.createLabel({
color: '#FF0000',
text: 'Click here to test!'
}));
view1.addEventListener('click', function() {
view1.setBackgroundColor('#00FFFF');
});
var view2 = Titanium.UI.createView({
top: 20,
height: 100,
width: 280,
backgroundColor: '#000000',
borderRadius: 5
});
view2.add(Titanium.UI.createLabel({
color: '#FF0000',
text: 'Click here to test!'
}));
view2.addEventListener('click', function() {
view2.setBackgroundColor('#00FFFF');
});
win.add(view1);
win.add(view2);
win.open();
After launching the sample app, click the two buttons (views) on the screen one by one and their background colour will change. Then it can be clearly observed that the actual border width of the second view is not 0 (the default value specified in doc), since we can see black border around it.
By the way, on iOS the actual behaviour matches well with the doc. There is no black border around any view after the background colour gets changed.
That's a regression in 7.0.0.GA when a default width for border was added. Introduced by me with this PR: https://github.com/appcelerator/titanium_mobile/pull/9510 PR: https://github.com/appcelerator/titanium_mobile/pull/10402
FR passed. Waiting for CR to merge