Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16449] Android: When touchEnabled and enabled properties are set to false the event listener added to the view stops working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-11T20:40:02.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 05, 2014 Sprint 05 API, Release 3.2.3, Release 3.3.0
ComponentsAndroid
Labelsqe-testadded, supportTeam
ReporterEduardo Gomez
AssigneeHieu Pham
Created2014-02-12T00:39:17.000+0000
Updated2014-03-19T00:40:37.000+0000

Description

Issue description

To enable and disable the buttons developer use the touchEnabled and enabled properties of the Titanium View's. Many of the buttons created this way start off in a disabled state so touchEnabled and enabled are both set to false. Clicking on the button in this state does nothing which is expected. When ready we set touchEnabled and enabled to true to enable touch events on the view and to fire the attached event listeners such as a touchstart event. In the 3.1.3.GA SDK this works perfectly however on the 3.2.0.GA SDK it appears that once those 2 properties are set to false the event listener added to the view stops working.

Test Case Steps:

Launch Bug_Testing_TC sample with the 3.1.3.GA on an android device.

Tap the Pink Rectangle -> Nothing happens, that is expected since the view is disabled.

Tap on the Blue Square -> Notice an alert pops up indicating that touchEnabled and enabled are set to true now for the pink square.

Click OK

Now Tap on the Pink Rectangle Again -> Notice that there is an alert that says PINK VIEW CLICKED!! that is expected since the view is now in an enabled and touchenabled state. Also notice that both of those states are now set to false so the view is again disabled.

Click OK

Tap on the Pink Rectangle Again -> Notice nothing happens since it is disabled. That is how we expect it to work.

Change the TiSDk to 3.2.0.GA

Launch Bug_Testing on an android device.

Tap the Pink Rectangle -> Nothing happens, that is expected since the view is disabled.

Tap on the Blue Square -> Notice an alert pops up indicating that touchEnabled and enabled are set to true now for the pink square.

Click OK

Now Tap on the Pink Rectangle Again -> Notice that Nothing happens

Repeat 10-12, notice that the pink rectangles touchstart event is not firing, it should be firing since touchEnabled and enabled are both set to true.

Tested on

This was reproduced on the Samsung Note 10.1 2014 MN: SM-P600 running Android 4.3 and Galaxy Nexus 4.1.1. It could not be reproduced this on a Saumsung Note Phone MN: SGH-I717 running Android 2.3.6.

Attachments

FileDateSize
Bug_Testing_TC.zip2014-03-03T16:37:01.000+00003177754

Comments

  1. Hieu Pham 2014-03-10

    master PR: https://github.com/appcelerator/titanium_mobile/pull/5446
  2. Samuel Dowse 2014-03-19

    Verified fixed on: Mac OSX 10.9.2 Appcelerator Studio, build: 3.2.3.201403171239 Titanium SDK, build: 3.2.3.v20140318131613 CLI: 3.2.1 Alloy: 1.3.1 Android Device: Nexus 4 (4.4) Android Emulator: 2.3.3, 4.3 Clicking the blue view followed by the pink view results in the following: Blue view throws an alert setting the pink view values to true. Pink view throws an alert setting the pink view values to false. Switched between the two views a handful of times and seemed to work consistently. Closing

JSON Source