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

[TIMOB-24321] Android: Add anchorPoint to Ti.UI.View #10336

Merged
merged 2 commits into from Sep 24, 2018

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Sep 23, 2018

JIRA: https://jira.appcelerator.org/browse/AC-4738

Thanks to @HazemKhaled for the basic work! I've just transferred it to anchorPoint for parity.

example:

var win = Ti.UI.createWindow({
	backgroundColor: "white"
});
var view = Ti.UI.createView({
	width: 150,
	height: 300,
	backgroundColor: "red",
	borderRadius: 10,
	touchEnabled: false,
	anchorPoint: {
		x: 0,
		y: 0
	}
})

var rot = 0;

setInterval(function() {
	view.rotation = (rot += 1);
}, 100);

var btn = Ti.UI.createButton({
	title: "set center"
})

btn.addEventListener("click", function() {
	view.anchorPoint = {
		x: 0.5,
		y: 0.5
	}
})

win.add(btn);
win.add(view);
win.open();

@build
Copy link
Contributor

build commented Sep 23, 2018

Messages
📖

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

📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@HazemKhaled
Copy link
Contributor

Great work @m1ga 💯

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS

@garymathews garymathews changed the title Android: Add anchorPoint to Ti.UI.View [TIMOB-24321] Android: Add anchorPoint to Ti.UI.View Sep 24, 2018
@hansemannn hansemannn merged commit 15aea6c into tidev:master Sep 24, 2018
@m1ga m1ga deleted the anchorPoint branch March 29, 2019 23:08
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.

None yet

5 participants