Skip to content
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

feat(android): support flexible border radius in card view #13281

Merged

Conversation

hansemannn
Copy link
Collaborator

@hansemannn hansemannn commented Feb 26, 2022

Fixes #13280

Example:

const window = Ti.UI.createWindow({ layout: 'vertical' });

window.add(Ti.UI.Android.createCardView({
	top: 20,
	width: 100,
	height: 100,
	backgroundColor: '#ff0',
	borderRadius: [ 0, 20, 0, 20 ]
}));

window.add(Ti.UI.Android.createCardView({
	top: 20,
	width: 100,
	height: 100,
	backgroundColor: '#ff0',
	borderRadius: '20 0 20 0'
}));

window.add(Ti.UI.Android.createCardView({
	top: 20,
	width: 100,
	height: 100,
	backgroundColor: '#ff0',
	borderRadius: 20
}));

window.add(Ti.UI.Android.createCardView({
	top: 20,
	width: 100,
	height: 100,
	backgroundColor: '#ff0',
	borderRadius: '20'
}));

setTimeout(() => {
	for (const children of window.children) {
		children.borderRadius = 50;
	}
	setTimeout(() => {
		for (const children of window.children) {
			children.borderRadius = '50 50 0 0';
		}
		setTimeout(() => {
			for (const children of window.children) {
				children.borderRadius = [ 0, 0, 50, 50 ];
			}
			setTimeout(() => {
				for (const children of window.children) {
					children.borderRadius = '0';
				}
			}, 1000);
		}, 1000);
	}, 1000);
}, 2000);

window.open();

@build
Copy link
Contributor

build commented Feb 26, 2022

Warnings
⚠️ There is no linked JIRA ticket in the PR body. Please include the URL of the relevant JIRA ticket. If you need to, you may file a ticket on JIRA
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 19700 tests are passing.
(There are 1157 skipped tests not included in that total)

📖 🎉 Another contribution from our awesome community member, hansemannn! Thanks again for helping us make Titanium SDK better. 👍
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS against 3c25fb8

@m1ga
Copy link
Contributor

m1ga commented Mar 21, 2022

PR works fine @hansemannn

Tested 10.1.1.GA and 10.2.0 with this PR on my Pixel 4 (Android 12) 👍

@hansemannn hansemannn merged commit a1c8edf into tidev:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: flexible borderRadius for CardView
3 participants