[TIMOB-19798] CardView: contentPadding(X) and cardCornerRadius should use default unit
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-12-01T07:59:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.1.2 |
Components | Android |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Ashraf Abu |
Created | 2015-10-26T16:01:16.000+0000 |
Updated | 2015-12-02T19:56:52.000+0000 |
Description
The following sample and attached screenshot demonstrate that the 5
contentPadding
properties and cardCornerRadius
do not use the default unit but are a Number used with px
.
It should use the default unit like all views.
var win = Ti.UI.createWindow({
layout: 'vertical'
});
var card = Ti.UI.Android.createCardView({
top: 20,
left: 20,
right: 20,
contentPadding: 20,
cardCornerRadius: 20
});
card.add(Ti.UI.createLabel({
text: 'PADDING AND TEXT NOT AS EXPECTED',
color: '#000'
}));
win.add(card);
var card = Ti.UI.Android.createCardView({
top: 20,
left: 20,
right: 20,
contentPaddingBottom: 20,
contentPaddingLeft: 20,
contentPaddingRight: 20,
contentPaddingTop: 20,
cardCornerRadius: 20
});
card.add(Ti.UI.createLabel({
text: 'PADDING AND TEXT NOT AS EXPECTED',
color: '#000'
}));
win.add(card);
var view = Ti.UI.createView({
top: 20,
left: 20,
right: 20,
height: Ti.UI.SIZE,
borderRadius: 20,
backgroundColor: 'white'
});
view.add(Ti.UI.createLabel({
top: 20,
right: 20,
bottom: 20,
left: 20,
height: Ti.UI.SIZE,
text: 'PADDING & RADIUS AS EXPECTED',
color: '#000'
}));
win.add(view);
win.open();
Attachments
File | Date | Size |
---|---|---|
android_20151026-164754.png | 2015-10-26T16:01:03.000+0000 | 66074 |
PR verified and approved.
Master PR Merged Additional Master PR for merge conflict: https://github.com/appcelerator/titanium_mobile/pull/7520 Merged.
5_1_X Backport PR: https://github.com/appcelerator/titanium_mobile/pull/7519
Backport merged.
Verified the fix. contentPadding & cardcornerRadius properties use default unit. Verified using the code in the description. Closing. Environment: Appc Studio : 4.4.0.201511241829 Ti SDK : 5.1.2.v20151202061227 Ti CLI : 5.0.5 Alloy : 1.7.26 MAC Yosemite : 10.10.5 Appc NPM : 4.2.2 Appc CLI : 5.1.0 Node: v0.12.27 Nexus 6P - Android 6.0