Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6304] Android: Button click event not working for transformation, due to handler acting on original rather than transformed location

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-07-03T15:10:52.000+0000
Affected Version/sRelease 1.7.3, Release 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi
ReporterDavid Riggleman
AssigneeIngo Muschenetz
Created2011-10-25T21:03:30.000+0000
Updated2017-03-20T22:10:19.000+0000

Description

The problem is that when creating a transformation associated with a button, the event handler does not appear to work correctly. Apparently, the reason is because the event listener is being handled at the original location rather than the transformed location (see http://developer.appcelerator.com/question/127368/transform-problems-in-android#comment-101881). Below is a test case that causes the problem.
var win = Titanium.UI.createWindow({backgroundColor: 'white'});
win.open();
  
var viewPlace = Ti.UI.createButton({
    title: 'click to rotate',
    width: 200
});
  
viewPlace.addEventListener("click", function(e) {
    alert("clicked");
    viewPlace.transform = Ti.UI.create2DMatrix().rotate(90);
});
  
win.add(viewPlace);
win.open();

Comments

  1. Don Thorp 2011-11-24

    native Android controls don't support this feature. Won't be able to fix until they do.
  2. Tony Lukasavage 2011-11-24

    The controls actually transform and change position, but their touch events still respond to their original locations, not the new location. So the controls transforming, but not handling events properly, is the expected behavior?
  3. Bitfabrikken - Dan Wulff Kronholm 2013-05-10

    Still not fixed in 3.1.0.. Will this ever be fixed/looked at?
  4. Bill Dawson 2013-07-02

    FYI, this is not supported (in Android) in pre-Honeycomb. It is supported in Honeycomb and later, and Titanium will support it for Honeycomb and later (there is a pull request for it already.)
  5. Ingo Muschenetz 2013-07-03

    Resolving as duplicate of linked issue. Please follow along there.

JSON Source