Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19798] CardView: contentPadding(X) and cardCornerRadius should use default unit

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-12-01T07:59:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.2
ComponentsAndroid
Labelsn/a
ReporterFokke Zandbergen
AssigneeAshraf Abu
Created2015-10-26T16:01:16.000+0000
Updated2015-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

FileDateSize
android_20151026-164754.png2015-10-26T16:01:03.000+000066074

Comments

  1. Ashraf Abu 2015-11-30

  2. Srikanth Sombhatla 2015-12-01

    PR verified and approved.
  3. Ashraf Abu 2015-12-01

    Master PR Merged Additional Master PR for merge conflict: https://github.com/appcelerator/titanium_mobile/pull/7520 Merged.
  4. Ashraf Abu 2015-12-01

    5_1_X Backport PR: https://github.com/appcelerator/titanium_mobile/pull/7519
  5. Ashraf Abu 2015-12-01

    Backport merged.
  6. Lokesh Choudhary 2015-12-02

    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

JSON Source