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): Add rotate event #11411

Closed
wants to merge 19 commits into from
Closed

feat(android): Add rotate event #11411

wants to merge 19 commits into from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Dec 28, 2019

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

Adding the rotate event to a view:

var win = Ti.UI.createWindow({
	backgroundColor: "#fff"
});
win.addEventListener("pinch", onPinch);
win.addEventListener("rotate", onRotate);

var ldi = Ti.Platform.displayCaps.logicalDensityFactor;
var v = Ti.UI.createView({
	width: 100,
	height: 100,
	backgroundColor: "#f00",
	touchEnabled: false
});

win.add(v);
win.open();


function onPinch(e) {
	v.scaleX = e.scale;
	v.scaleY = e.scale;
	v.left = e.focusX / ldi - 50;
	v.top = e.focusY / ldi - 50;
}

function onRotate(e) {
	console.log("rotate", e.rotate);
	v.rotation = e.rotate;
}

you can pinch and rotate the view with two fingers

screencapture-2022-03-27_17.02.17.mp4

Help from someone else please:

  • parity for iOS

@build
Copy link
Contributor

build commented Dec 28, 2019

Fails
🚫 Test reports missing for iPad, iPhone, MacOS. This indicates that a build failed or the test app crashed
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Warnings
⚠️

Commit b75cf1ff20013318b3b4451ae2b088ee44d9fb04 has a message "Update TiUIView.java" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️

Commit 3b1940ff7193d54efabbef947756d232e38e35d4 has a message "Update TiUIView.java" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️

Commit 85d443e164708b1383e8b21efff050765230236c has a message "fixes" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️ This PR has milestone set to 10.0.0, but the version defined in package.json is 10.2.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch
Messages
📖

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

📖

🚨 This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

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

Generated by 🚫 dangerJS against 0174b1b

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.

Thanks for the PR @m1ga! Minor changes requested. I'll make a ticket for parity with iOS too.

@ewanharris ewanharris modified the milestones: 9.0.0, 9.1.0 Feb 12, 2020
@sgtcoolguy sgtcoolguy added improvement hold for parity ✋ This PR should not be merged until an equivalent PR is ready for the other platform(s) labels Jul 31, 2020
@sgtcoolguy sgtcoolguy modified the milestones: 9.1.0, 9.3.0 Jul 31, 2020
@sgtcoolguy sgtcoolguy modified the milestones: 9.3.0, 10.0.0 Nov 20, 2020
@build build added the docs 📔 label Jan 4, 2022
@hansemannn hansemannn removed this from the 10.0.0 milestone Mar 21, 2022
@m1ga
Copy link
Contributor Author

m1ga commented Jul 18, 2023

closing in favor of #13882

@m1ga m1ga closed this Jul 18, 2023
@m1ga m1ga deleted the onrotate branch July 18, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android community 🔥 docs docs 📔 hold for parity ✋ This PR should not be merged until an equivalent PR is ready for the other platform(s) improvement needs tests 🚨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants