Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10042] Android: Animation: Views moved by animation no longer respond to touches (touch area is original location, not new location)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-20T13:59:06.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sSprint 2012-15 Core, Release 2.1.1, Release 3.0.0
ComponentsAndroid
Labelscore, module_animation, qe-testadded, regression
ReporterBill Dawson
AssigneeBill Dawson
Created2012-07-19T13:17:59.000+0000
Updated2013-05-07T00:07:40.000+0000

Description

If you animate a view to a new location, it's touch coordinates stay back at the old location. Example is this simple app.js:
var win = Ti.UI.createWindow({fullscreen: false, backgroundColor:"#444"});
var btn = Ti.UI.createButton({
	title: "Click to move",
	height: 48, top: 16, left: 16, width: "auto"
});
win.add(btn);

btn.addEventListener("click", function() {
	var newLeft = Math.floor(Math.random() * 200);
	var newTop = Math.floor(Math.random() * 200);
	btn.animate({
		left: newLeft,
		top: newTop,
		duration: 500
	});
});
win.open();
Run that app, and click the button. Actual Behavior: When you click it, the button will move somewhere random. Touch the button again, and it won't click. But touch back to the area of the window where the button _was before the animation_, and the button will move again. Expected Behavior: The button's click event listener should fire when you click the button no matter where it is.

Attachments

FileDateSize
animate.zip2012-07-20T11:23:51.000+00003135764

Comments

  1. Bill Dawson 2012-07-20

    Testing Notes

    * Please use attached animation test application because you'll need to test for regressions of older fixed tickets. Unzip animate.zip (attached) and use that app. * Test on 2.2/2.3 device (one or the other, both not needed IMO -- important thing is one pre-honeycomb device), a Honeycomb device and a post-Honeycomb (ICS or JB) device. So three devices total. * When you run the test app, the test for this item will be on top (TIMOB-10042). Run that test first. * In the TIMOB-10042 test, when you click the button it will move. When testing the fail case, the button will not be clickable in its new location. When testing the fixed branch, it should remain clickable no matter where it runs to. * Run the other tests as well to check for regressions. Each test has a label containing instructions.
  2. Satyam Sekhri 2012-07-24

    View after animation, responds to touch at new location and not the older/original location. Verified On: Titanium Studio: 2.1.1.201207171343 Titanium SDK: 2.1.1.v20120723131610 Android Device: LG P970 (v2.2), Samsung Tab (v3.2), Galaxy Nexus (v4.0.2)
  3. Bill Dawson 2013-05-07

    This may be more trouble than it's worth. cf. TIMOB-6852. It's a well-understood fact in the native Android development world that the touch target does not move with translate animations pre-Honeycomb.

JSON Source