{ "id": "124223", "key": "ALOY-911", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" }, { "id": "15887", "description": "2014 Sprint 03", "name": "2014 Sprint 03", "archived": true, "released": true, "releaseDate": "2014-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-02-05T18:40:35.000+0000", "created": "2013-12-27T10:33:20.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "3.2.0", "alloy", "android", "qe-testadded", "touchEnabled", "xml" ], "versions": [], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-05-08T02:54:32.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "This code crashes on Android (not iOS):\r\n\r\n \r\n//\r\n\r\n\r\nFrom console:\r\n\r\nCaused by: java.lang.ClassCastException: java.lang.String\r\n\r\nHowever, touchEnabled works properly when set in tss styling. So current work- around is to create a class in app.tss that can be called to set the touchEnabled property.\r\n", "attachment": [], "flagged": false, "summary": "touchEnabled property in Alloy xml crashes on Android with Titanium SDK 3.2.0.GA", "creator": { "name": "matt_m", "key": "matt_m", "displayName": "Matt Moskal", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "matt_m", "key": "matt_m", "displayName": "Matt Moskal", "active": true, "timeZone": "America/New_York" }, "environment": "android\r\ntargetSdkVersion=\"16\"\r\nTitanium SDK 3.2.0.GA", "comment": { "comments": [ { "id": "286249", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Changing this to an \"improvement\" rather than a \"bug\". XML attributes contain strings, pure and simple. The reason this works on iOS is that iOS does a type conversion from string to boolean. Android does not, and fails with the string exception. This could actually be fixed at the platform-level to have Android perform type conversions, but I'll instead modify it in Alloy to make things easier. \r\n\r\nLong story short, if you want to assign a non-string property to a view in Alloy, the safest, cross-platform way to do so is with the actual types in TSS, not trying to coerce types in the XML attributes, which are always strings.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-30T14:27:20.000+0000", "updated": "2013-12-30T14:27:20.000+0000" }, { "id": "286254", "author": { "name": "matt_m", "key": "matt_m", "displayName": "Matt Moskal", "active": true, "timeZone": "America/New_York" }, "body": "Yes, I agree , but ....\r\n\r\n1) I have not come across any other true/false attributes that could not be set in XML for Android.\r\n\r\n2) Prior to 3.2.0, touchEnabled could be set in XML for Android. \r\n\r\nIt took me quite a while to isolate the issue that apps were crashing because of this change in behavior - made harder to isolate/find because other true/false attributes were being set for the very same View in XML, and those other attributes worked fine. In fact the only reason I found this was because I ran across a thread that mentioned a past issue of touchEnabled causing app crashes when set in TSS (not XML). \r\n\r\nNot sure the right answer. But because true/false attributes are so common and so many, it seems rather cumbersome to set every one in TSS when needed. Is there not some way to have \"true\" and \"false\" strings in XML interpreted as boolean values?", "updateAuthor": { "name": "matt_m", "key": "matt_m", "displayName": "Matt Moskal", "active": true, "timeZone": "America/New_York" }, "created": "2013-12-30T14:56:38.000+0000", "updated": "2013-12-30T14:56:38.000+0000" }, { "id": "286276", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~matt_m] No, there is no true non-string values in XML attributes. The attributes in XML, by definition, are strings. That said, in certain situations Alloy can workaround this by explicitly coercing string values to different types. Whether or not other properties in Android handle this coercion automatically or not has nothing to do with Alloy's XML. It has to do with whether or not these are handled by Titanium in its Android code.\n\nAs I mentioned before, if you want the true root of this problem handled, log a ticket that doesn't show this as an Alloy-specific issue. Instead, show that this same situation occurs when you attempt to use a string for a boolean value in traditional titanium. Chances are you will get a response along the lines of \"The API states that it is boolean, so that's what it expects.\" But you can at least make a case for a resolution at the platform level if you think it is compelling. In lieu of that, I can make tweaks in Alloy to try and make it handle it automatically. ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-30T18:55:43.000+0000", "updated": "2013-12-30T18:55:43.000+0000" }, { "id": "290432", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR: https://github.com/appcelerator/alloy/pull/316\n\ntest app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-911\n\nFunctional test: \n\n1. Run the app for Android\n2. The app does not crash. The red View is not clickable.\n3. Check the generated code and the touchEnabled property should equal the boolean false rather than the string 'false'\n4. You can modify the XML to set and rebuild the app; view will be clickable and generated code has boolean true value", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-30T17:27:00.000+0000", "updated": "2014-01-30T17:27:00.000+0000" }, { "id": "291221", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Reopening", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-02-04T21:26:02.000+0000", "updated": "2014-02-04T21:26:02.000+0000" }, { "id": "291450", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/alloy/pull/326\r\ntest app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-911\r\n\r\nFunctional test should involve running the test app on android. It should look roughly like the screenshot (depending on emulator or device). Additionally, the rows should fire the click event, but the red footer at the bottom should not.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T18:40:35.000+0000", "updated": "2014-02-05T18:40:35.000+0000" }, { "id": "303962", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified working as expected. \r\n\r\nTiSDK 3.3.0.v20140507141712\r\nAlloy 1.4.0-dev\r\nAppcelerator Studio 3.3.0.201405011408\r\nCLI 3.3.0-dev\r\n\r\nClosing. ", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-08T02:54:19.000+0000", "updated": "2014-05-08T02:54:19.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }