{ "id": "63609", "key": "TIMOB-2977", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-07T18:05:52.000+0000", "created": "2011-04-15T03:34:02.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "ios", "reported-1.5.1", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-07T18:05:52.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
Tested in simulator by user: iOS 4.2, Ti SDK 1.5.1 & 1.6.X\n(continuous)
\nTested on device by rickblalock: iOS 4.2, 1.6.X (continuous 27 Jan\n2011)
User reported issue in \nthis Q&A post. He explains:
\nTested in simulator:
\n\nvar win = Ti.UI.currentWindow; \nwin.backgroundColor = '#fff';\n \nTi.Gesture.addEventListener('shake',function(e)\n{\n alert(e.source+\" \"+e.timestamp+\" \"+e.type);\n});\n\nvar serSearch = Titanium.UI.createSearchBar({\n barColor:'#444', \n showCancel:false,\n height:60,\n top:0,\n left:0,\n keyboardType:0\n});\n \nserSearch.addEventListener(\"return\", function(e)\n{\n serSearch.blur();\n});\n\nwin.add(serSearch);
\n
\nblainH stated:
\nThe shake gesture is trapped at the root, when it's the\nfirstResponder.
\nWhile text entry is up, it's not the first responder.
\nSo I can see why the bug's doing what it's doing.
\nCan fix, but not for 1.6
\nActually, possibly not possible to fix. I'd have to look into\nit.
I have been using this for solved my problem :
\n\nvar timestampAccTmp = 0;\nvar timeResolution = 200;\nTi.Accelerometer.addEventListener('update',function(e)\n{\n timestampAcc = e.timestamp;\n diffTime = timestampAcc - timestampAccTmp;\n //alert(e.x+\" \"+e.y+\" \"+e.z+\" \"+timestampAcc+\" \"+timestampAccTmp+\" \"+diffTime);\n \n \n if(diffTime > timeResolution)\n {\n xpos.text = \"XX :\"+e.x;\n ypos.text = \"YX :\"+e.y;\n zpos.text = \"ZX :\"+e.z;\n violence = 1;\n shake = false;\n \n xtop = Math.abs(e.x);\n ytop = Math.abs(e.y);\n ztop = Math.abs(e.z);\n \n Titanium.API.debug(xtop+\" \"+ytop+\" \"+ztop);\n \n if ( xtop> violence * 1)\n {\n shake = true;\n }\n if (ytop > violence * 2)\n {\n shake = true;\n }\n if (ztop > violence * 3)\n {\n shake = true;\n }\n if (shake) \n {\n alert(\"shake detected \"+xtop+\" \"+ytop+\" \"+ztop);\n } \n timestampAccTmp = timestampAcc;\n }\n \n \n});
\n
\nthanks