Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19803] Android: CardView should not have both borderRadius and cardCornerRadius

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusClosed
ResolutionDuplicate
Resolution Date2015-11-19T09:04:42.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.1.2
ComponentsAndroid
Labelsn/a
ReporterFokke Zandbergen
AssigneeAshraf Abu
Created2015-10-27T12:12:36.000+0000
Updated2015-12-02T22:56:33.000+0000

Description

The CardView is documented to have both borderRadius and cardCornerRadius. Both also work, be it with different result because cardCornerRadius does not use the default unit (TIMOB-19798). Unless there is a valid reason to have both (which should then be clearly documented) I suggest that we only have borderRadius for consistency within the SDK.
var win = Ti.UI.createWindow({
	layout: 'vertical'
});

var card1 = Ti.UI.Android.createCardView({
	top: 20,
	left: 20,
	right: 20,
	contentPadding: 20,

	cardCornerRadius: 20
});

card1.add(Ti.UI.createLabel({
	text: 'cardCornerRadius',
	color: '#000'
}));

win.add(card1);

var card2 = Ti.UI.Android.createCardView({
	top: 20,
	left: 20,
	right: 20,
	contentPadding: 20,

	borderRadius: 20
});

card2.add(Ti.UI.createLabel({
	text: 'borderRadius',
	color: '#000'
}));

win.add(card2);

var card3 = Ti.UI.Android.createCardView({
	top: 20,
	left: 20,
	right: 20,
	contentPadding: 20,

	borderRadius: 20,
	cardCornerRadius: 20
});

card3.add(Ti.UI.createLabel({
	text: 'cardCornerRadius + borderRadius',
	color: '#000'
}));

win.add(card3);

win.open();

Attachments

FileDateSize
android_20151027-130738.png2015-10-27T12:12:20.000+000061083

Comments

  1. Fokke Zandbergen 2015-11-02

    That valid reason to use cardCornerRadius might be that we now follow the [original API](https://developer.android.com/reference/android/support/v7/widget/CardView.html) exactly. I think that might be better indeed, but then we should make sure that borderRadius is not there in the API reference or document the difference (use cases).
  2. Ashraf Abu 2015-11-19

  3. Lokesh Choudhary 2015-12-02

    Closing as this is addressed through TIMOB-19802

JSON Source