{ "id": "172523", "key": "TIMOB-26503", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "2018-12-03T09:53:56.000+0000", "created": "2018-10-31T02:25:59.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "breaking-change", "parity" ], "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" }, "outwardIssue": { "id": "171242", "key": "TIMOB-25839", "fields": { "summary": "TiAPI: 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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56957", "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": "56958", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "170527", "key": "TIMOB-25582", "fields": { "summary": "Windows: Support for dp in ti.ui.defaultunit", "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 } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-12-03T12:10:11.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "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\ttouchView.center = { x: event.x, y: event.y };\r\n}\r\n\r\nvar window = Ti.UI.createWindow(\r\n{\r\n\tlayout: \"vertical\",\r\n\tfullscreen: true,\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\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": "Windows: Touch event coordinate units do not match between platforms", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1088, "state": "closed", "name": "2018 Sprint 22", "startDate": "2018-10-21T23:20:52.653Z", "endDate": "2018-11-04T23:20:00.000Z", "completeDate": "2018-11-04T23:29:59.423Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "443158", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/1301", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-11-01T01:46:36.000+0000", "updated": "2018-11-01T01:46:36.000+0000" }, { "id": "443924", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, awaiting CR.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-27T13:02:51.000+0000", "updated": "2018-11-27T13:02:51.000+0000" }, { "id": "444151", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket. Verified feature in SDK version 8.0.0.v20181130132038.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile_windows/pull/1301", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-12-03T12:09:57.000+0000", "updated": "2018-12-03T12:09:57.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }