Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2844] Android: Ciick events not triggered if held to long.

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-18T13:04:12.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-10, Release 1.6.2
ComponentsAndroid
Labelsandroid, click, enterprise, feature, handler, release-1.6.2, release-1.7.0, reported-1.5.1, rplist
ReporterRick Blalock
AssigneeBill Dawson
Created2011-04-15T03:30:58.000+0000
Updated2011-04-18T13:04:12.000+0000

Description

When holding your finger slightly longer than usual the click event is not fired on buttons. I tested this around other native apps. There are some cases in a normal Android app where this would fire a separate event (such as opening a secondary window). However in other instances (like the brightness page under settings) holding down your finger on "cancel" will eventually run the click handler once the finger is lifted.

Customer's ticket: http://developer.appcelerator.com/helpdesk/view/66081">http://developer.appcelerator.com/helpdesk/view/66081

On-going q/a: http://developer.appcelerator.com/question/100321/android-clicks-not-triggering-event-handler-if-slightly-too-long#178771]"> http://developer.appcelerator.com/question/100321/android-clicks-no...,

Tested on Kitchen Sink with an Android 2.2 device using Ti. 1.6 and 1.5.1.

Comments

  1. Rich Baughman 2011-04-15

    I would just add that in any Settings menu item that has an option list popup when you click it, you can press and hold the menu item itself, or any of the option list items, or any Select/Cancel button as long as you want. They stay highlighted, and when you let go they perform the click function. In KS, this is not true for any button - if you pause for the slightest fraction of a second, the button click does not fire.

  2. Dawson Toth 2011-04-15

    We have enterprise attention for this, now.

    Sample Code

    The following code has a really big button and label. Touching the button updates the label with the number of seconds since the app launched. It should be useful for testing if the click event is firing.

       var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
       
       var label = Ti.UI.createLabel({
           text: 'Touch the Button!', textAlign: 'center',
           top: 0, right: 0, bottom: '50%', left: 0
       });
       win.add(label);
       
       var button = Ti.UI.createButton({
           title: 'Update Label',
           top: '50%', right: 0, bottom: 0, left: 0
       });
       win.add(button);
       
       var launch = new Date().getTime();
       button.addEventListener('click', function() {
           label.text = parseInt((new Date().getTime() - launch) / 100) / 10 + ' seconds since app launched.';
       });
       
       win.open();
       

    Tested On

    Titanium SDK version: 1.6.0 (02/23/11 12:34 9882e81)
    BROKEN on Samsung EPIC 4G running Android 2.2

    Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/75681">http://developer.appcelerator.com/helpdesk/view/75681

  3. Don Thorp 2011-04-15

    Bill, I think the problem may be in the Gesture handler. I'm not for some reason the OS isn't sending the click in this instance.

  4. Bill Dawson 2011-04-15

    (from [f6a4a833411636403e9bae9b03bce3a2dae68c5b]) Make sure click listener not firing if touchable has been set to false. [#2844] https://github.com/appcelerator/titanium_mobile/commit/f6a4a833411636403e9bae9b03bce3a2dae68c5b"> https://github.com/appcelerator/titanium_mobile/commit/f6a4a8334116...

  5. Bill Dawson 2011-04-15

    (from [88f6a53f3c831ede4a05b78a5ac79269709556a0]) Remove click event firing from the single tap handler since a click and a single tap are not the same thing. (Click can have a long press phase, whereas single tap must be quick to be fired.) [#2844] https://github.com/appcelerator/titanium_mobile/commit/88f6a53f3c831ede4a05b78a5ac79269709556a0"> https://github.com/appcelerator/titanium_mobile/commit/88f6a53f3c83...

  6. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.7.0 (03/14/11 11:01 f6a4a83) on
    Nexus S 2.3.2
    Emulator 2.1
    Android only issue, tried 1.6 on iOS.

  7. Bill Dawson 2011-04-15

    Added to stable branch 1_6_X

  8. Don Thorp 2011-04-18

    Setting affectedVersion. Not possible w/o reopening.
  9. Don Thorp 2011-04-18

    Re closing after updating fixed version

JSON Source