{ "id": "174810", "key": "TIMOB-27807", "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": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": null, "resolutiondate": null, "created": "2020-03-12T01:49:55.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "2020-Q4", "android", "breaking-change", "drag", "parity", "touch", "unit" ], "versions": [], "issuelinks": [ { "id": "58260", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "121894", "key": "TIMOB-15621", "fields": { "summary": "Android: convertPointToView gives different results with SDK 3.1.3 compared to 3.0.2", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "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": "58262", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "149220", "key": "TIMOB-19237", "fields": { "summary": "Android: convertPointToView inside a ListView", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58263", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "174342", "key": "TIMOB-27530", "fields": { "summary": "Android: UI glitches out when using 'applyProperties' with Scroll View Touch 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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58261", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "141306", "key": "TIDOC-2050", "fields": { "summary": "view.convertPointToView is measured in platform-specific units", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-12-11T13:04:38.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": "*Summary:*\r\nTitanium's {{View.convertPointToView()}} method is hardcoded to return pixels on Android. The returned coordinates should be using the \"ti.ui.defaultunit\" assigned to the \"tiapp.xml\" instead, which defaults to \"dp\".\r\n\r\niOS returns \"dp\", not pixels. So, this is a parity issue.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below on Android.\r\n# Attempt to drag one of the squares onscreen.\r\n# Notice the square disappears.\r\n# Uncomment the {{Ti.Android}} code block below. _(Converts pixels to dp.)_\r\n# Rebuild for Android.\r\n# Notice that dragging a square now works.\r\n# Build and run on iOS.\r\n# Notice that dragging a square now works.\r\n\r\n{code:javascript}\r\nfunction createDragSquare(top, left, color) {\r\n\tvar view = Ti.UI.createView({\r\n\t\ttouchEnabled: true,\r\n\t\tbackgroundColor: color,\r\n\t\tcenter: { x: left + 50, y: top + 50 },\r\n\t\twidth: 100,\r\n\t\theight: 100,\r\n\t});\r\n\tview.addEventListener(\"touchmove\", function(event) {\r\n\t\tvar parentPoint = view.convertPointToView({ x: event.x, y: event.y }, window);\r\n//\t\tif (Ti.Android) {\r\n//\t\t\tparentPoint.x = Ti.UI.convertUnits(parentPoint.x + \"px\", \"dip\");\r\n//\t\t\tparentPoint.y = Ti.UI.convertUnits(parentPoint.y + \"px\", \"dip\");\r\n//\t\t}\r\n\t\tTi.API.info(\"@@@ touch point: (\" + parentPoint.x + \", \" + parentPoint.y + \")\");\r\n\t\tview.center = parentPoint;\r\n\t\tevent.cancelBubble = true;\r\n\t});\r\n\treturn view;\r\n}\r\n\r\nvar window = Ti.UI.createWindow({ backgroundColor: \"white\" });\r\nwindow.add(createDragSquare(40, 40, \"red\"));\r\nwindow.add(createDragSquare(120, 120, \"green\"));\r\nwindow.add(createDragSquare(200, 200, \"blue\"));\r\nwindow.open();\r\n{code}\r\n\r\n*Work-Around:*\r\nConvert the {{convertPointToView()}} method's returned results from pixels to dp only on Android as shown below.\r\n{code:javascript}\r\nvar parentPoint = view.convertPointToView({ x: event.x, y: event.y }, window);\r\nif (Ti.Android) {\r\n\tparentPoint.x = Ti.UI.convertUnits(parentPoint.x + \"px\", \"dip\");\r\n\tparentPoint.y = Ti.UI.convertUnits(parentPoint.y + \"px\", \"dip\");\r\n}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: convertPointToView() returns pixels instead of default units", "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, "comment": { "comments": [ { "id": "457813", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12320", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-05T01:11:23.000+0000", "updated": "2020-12-05T01:11:23.000+0000" }, { "id": "457876", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-11T13:04:34.000+0000", "updated": "2020-12-11T13:04:34.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }