{ "id": "171242", "key": "TIMOB-25839", "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": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-01-11T02:28:58.000+0000", "created": "2018-03-06T03:44:25.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "breaking-change", "defaultunit", "ios", "parity", "touch" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [ { "id": "56956", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "172523", "key": "TIMOB-26503", "fields": { "summary": "Windows: Touch event coordinate units do not match between platforms", "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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "57053", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172710", "key": "TIMOB-26635", "fields": { "summary": "Android: singleTap event for TableView does not contain proper data", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56347", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "121953", "key": "TIMOB-15649", "fields": { "summary": "Android: x & y positions of \"touchmove\" event are incorrect and erratic", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57001", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "172618", "key": "TIMOB-26563", "fields": { "summary": "TiAPI: 2DMatrix translate() coordinate units do not match between platforms", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57000", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "110099", "key": "TIMOB-12842", "fields": { "summary": "2D image transforms are inconsistent between iOS and Android", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-01-11T02:29:03.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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nThe (x,y) units provided by View event's \"touchstart\", \"touchmove\", \"touchend\", and \"touchcancel\" do not match between Android and iOS. Both platforms ignore the \"ti.ui.defaultunit\" property setting in \"tiapp.xml\".\r\n\r\nOn Android, the touch coordinates are always in \"px\" (ie: pixels).\r\nOn iOS, the touch coordinates are always in \"dip\" (aka: \"dp\").\r\n\r\n*Steps to Reproduce:*\r\n# Build and run the below code on Android.\r\n# Drag your finger in the gray view.\r\n# Notice that the blue square does *not* correctly following your finger.\r\n# Build and run on iOS.\r\n# Drag your finger in the gray view.\r\n# Notice that the blue square *correctly* follows your finger.\r\n# Change \"tiapp.xml\" property \"ti.ui.defaultunit\" to \"px\".\r\n# Build and run on iOS.\r\n# Drag your finger in the gray view.\r\n# Notice that the blue square does *not* correctly following your finger.\r\n# Build and run on Android.\r\n# Drag your finger in the gray view.\r\n# Notice that the blue square *correctly* follows your finger.\r\n\r\n{code:javascript}\r\nfunction onTouch(event) {\r\n\tif (event.source == containerView) {\r\n\t\ttouchView.center = { x: event.x, y: event.y };\r\n\t}\r\n}\r\n\r\nvar window = Ti.UI.createWindow(\r\n{\r\n\tlayout: \"vertical\",\r\n\tfullscreen: true,\r\n\ttheme: \"Theme.AppCompat.NoTitleBar\",\r\n});\r\nwindow.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"Touch Drag Test\",\r\n\ttop: \"20dp\",\r\n}));\r\nvar containerView = Ti.UI.createView(\r\n{\r\n\ttouchEnabled: true,\r\n\tbackgroundColor: \"gray\",\r\n\ttop: \"10dp\",\r\n\tbottom: \"20dp\",\r\n\twidth: \"90%\",\r\n});\r\nvar touchView = Ti.UI.createView(\r\n{\r\n\ttouchEnabled: false,\r\n\tbackgroundColor: \"#008800\",\r\n\twidth: \"100dp\",\r\n\theight: \"100dp\",\r\n});\r\ncontainerView.add(touchView);\r\ncontainerView.addEventListener(\"touchstart\", onTouch);\r\ncontainerView.addEventListener(\"touchmove\", onTouch);\r\ncontainerView.addEventListener(\"touchend\", onTouch);\r\ncontainerView.addEventListener(\"touchcancel\", onTouch);\r\ncontainerView.addEventListener(\"click\", onTouch);\r\ncontainerView.addEventListener(\"dblclick\", onTouch);\r\ncontainerView.addEventListener(\"doubletap\", onTouch);\r\nwindow.add(containerView);\r\nwindow.open();\r\n{code}\r\n\r\n*Work-Around:*\r\nThe following will work-around this issue on both Android and iOS...\r\n\r\n{code:javascript}\r\n// Fetch the default unit property set in \"tiapp.xml\".\r\nvar defaultUnit = Ti.App.Properties.getString(\"ti.ui.defaultunit\", \"dip\");\r\nif (defaultUnit === \"dp\") {\r\n\tdefaultUnit = \"dip\";\r\n} else if (defaultUnit === \"system\") {\r\n\tdefaultUnit = (Ti.Platform.name === \"android\") ? \"px\" : \"dip\";\r\n}\r\n\r\n// Do the below when a touch event has been received.\r\nfunction onTouch(event) {\r\n\tif (Ti.Platform.name === \"android\") {\r\n\t\tevent.x = Ti.UI.convertUnits(event.x + \"px\", defaultUnit);\r\n\t\tevent.y = Ti.UI.convertUnits(event.y + \"px\", defaultUnit);\r\n\t} else if ((Ti.Platform.name === \"iOS\") || (Ti.Platform.name === \"iPhone OS\")) {\r\n\t\tevent.x = Ti.UI.convertUnits(event.x + \"dip\", defaultUnit);\r\n\t\tevent.y = Ti.UI.convertUnits(event.y + \"dip\", defaultUnit);\r\n\t}\r\n\ttouchView.center = { x: event.x, y: event.y };\r\n}\r\n{code}\r\n\r\n*Ideal Solution:*\r\nConvert native touch coordinates to use \"ti.ui.defaultunit\" on both Android and iOS. This way views can easily be dragged since their \"x\", \"y\", and \"center\" properties already respect the \"ti.ui.defaultunit\" property.\r\nNote that this would be a breaking change.\r\n", "attachment": [], "flagged": false, "summary": "TiAPI: Touch event coordinate units do not match between platforms", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1106, "state": "closed", "name": "2019 Sprint 1", "startDate": "2018-12-31T19:39:58.070Z", "endDate": "2019-01-11T19:39:00.000Z", "completeDate": "2019-01-14T17:17:47.552Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437370", "author": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi have a similar issue using {code}Ti.UI.create2DMatrix().translate(0, 100){code}\r\n\r\nOn Android the value {{100}} is evaluated as {{100px}}, on iOS it is correctly evaluated as {{100dp}}.", "updateAuthor": { "name": "Andrea.Vitale", "key": "andrea.vitale", "displayName": "Andrea Vitale", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-04T13:50:03.000+0000", "updated": "2018-05-04T13:50:03.000+0000" }, { "id": "443165", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10414", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-01T03:08:11.000+0000", "updated": "2018-11-01T03:08:11.000+0000" }, { "id": "443619", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~Andrea.Vitale], I've written up a separate ticket for the {{2DMatrix.translate()}} coordinate issue.\r\nPlease see: [TIMOB-26563]\r\n\r\nThanks for bringing this issue to our attention.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-15T02:45:29.000+0000", "updated": "2018-11-15T02:45:29.000+0000" }, { "id": "444096", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Fix verified in SDK Version {{8.0.0.v20181129161342.}}\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/10414", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-30T12:38:19.000+0000", "updated": "2018-11-30T12:38:19.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }