{ "id": "80036", "key": "TIMOB-5224", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-30T08:32:53.000+0000", "created": "2011-09-06T16:14:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "12664", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "76940", "key": "TIMOB-4508", "fields": { "summary": "iOS: Need the pinch gesture exposed for TIUIView event listeners", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-10-25T22:22:47.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "We need to have the event handler for pinch gestures available for TIUIView objects and their derivatives\r\n\r\nThis is needed for many projects we've been a apart of.\r\n\r\nWe recently implemented this in the soon to be available openGL module development project (ios only so far) and it seems to work for our needs there.\r\n\r\nHaving this available for all views and objects that are based on view objects would be very useful.\r\n\r\nHere are the code snippets from the IOS side:\r\n\r\nAdded this to the view initialization:\r\n\r\n UIPinchGestureRecognizer *pinchRecognizer;\r\n pinchRecognizer=[[UIPinchGestureRecognizer alloc] \r\n initWithTarget:self\r\n action:@selector(foundPinch:)];\r\n [controller.view addGestureRecognizer:pinchRecognizer];\r\n [pinchRecognizer release];\r\n\r\nhere's the callback:\r\n\r\n- (void)foundPinch:(UIPinchGestureRecognizer *)recognizer {\r\n NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(recognizer.scale), @\"scale\", NUMDOUBLE(recognizer.velocity), @\"velocity\", nil];\r\n [self.proxy fireEvent:@\"pinch\" withObject:event];\r\n}\r\n\r\n\r\nhere's how we use it now on the opengl view \r\n\r\nopengl.addEventListener('pinch', function {\r\n scale = e.scale;\r\n});\r\n\r\nh2. Test Case \r\n\r\n{code}\r\nvar baseHeight = 200;\r\nvar baseWidth = 200;\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff',\r\n\tfullscreen: false,\r\n\texitOnClose: true\r\n});\r\nvar view = Ti.UI.createView({\r\n\theight: baseHeight,\r\n\twidth: baseWidth,\r\n\tbackgroundColor: '#a00'\r\n});\r\nvar label = Ti.UI.createLabel({\r\n\ttext: baseWidth + ' x ' + baseHeight,\r\n\tcolor: '#fff',\r\n\tfont: {\r\n\t\tfontSize: 24,\r\n\t\tfontWeight: 'bold'\r\n\t}\r\n});\r\nview.add(label);\r\nwin.add(view);\r\n\r\nview.addEventListener('pinch', function(e) {\r\n\tview.height = baseHeight * e.scale;\r\n\tview.width = baseWidth * e.scale;\r\n\tlabel.text = Math.round(view.width) + ' x ' + Math.round(view.height);\r\n});\r\nview.addEventListener('touchstart', function(e) { \r\n\tbaseHeight = view.height;\r\n\tbaseWidth = view.width;\r\n});\r\n\r\nwin.open();\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Expose \"pinch\" events in Ti.UI.View ", "creator": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android", "comment": { "comments": [ { "id": "197545", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as Fixed.\r\n\r\nVerified via test case.\r\n\r\nSDK: 2.1.0.v20120606105255\r\nStudio: 2.1.0.201206051612\r\nAndroid: V8, Rhino\r\nDevices Tested: Nexus One 2.2.2, Xoom 4.0.3, Revolution 2.3.6", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-06T11:59:58.000+0000", "updated": "2012-06-06T11:59:58.000+0000" }, { "id": "201241", "author": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "body": "This works great for a single view in a window but I was unable to get imageviews to zoom in a scrollableview. Is this a bug or just a technical limitation of views inside scrollableviews? Is there possibly a hack to allow a imageview to zoom in a scollableview?", "updateAuthor": { "name": "aroyce", "key": "aroyce", "displayName": "Andrew Royce", "active": true, "timeZone": "America/New_York" }, "created": "2012-07-02T13:01:09.000+0000", "updated": "2012-07-02T13:01:09.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }