{ "id": "125760", "key": "AC-2051", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-02-03T17:34:11.000+0000", "created": "2014-02-03T10:28:49.000+0000", "labels": [ "alloy", "android", "builtins", "measurement", "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:00.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." }, { "id": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." } ], "description": "Using the function pxToDP on Titanium.Platform.displayCaps.platformWidth, on an Android Galaxy Nexus should return 360 (in dp).\r\nInstead it's returning 720, that is the original pixel value.\r\nI used the same module on previous Alloy versions and it worked.", "attachment": [], "flagged": false, "summary": "alloy/measurement pxToDP returns the same value on Android", "creator": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Alloy 1.3.0, Titanium 3.2.0, on Mac OS Mavericks", "comment": { "comments": [ { "id": "290862", "author": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can't reproduce.\nI've just tested this on my Nexus 5 with this code (same environment):\n{code:javascript}\nvar measurement = require('alloy/measurement');\nTi.API.info('dpWidth: ' + measurement.pxToDP(Ti.Platform.displayCaps.platformWidth));\n{code}\nIt returned 360 as expected.", "updateAuthor": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-02-03T12:07:44.000+0000", "updated": "2014-02-03T12:07:44.000+0000" }, { "id": "290869", "author": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "body": "You're right, your code returns the expected result even to me (i made a new test project to test it).\nHowever, the usage inside my project returns the wrong result, and i'm not doing much more.\nI'll try to isolate the bug and be more detailed.", "updateAuthor": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-02-03T14:58:29.000+0000", "updated": "2014-02-03T14:58:29.000+0000" }, { "id": "290874", "author": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "body": "Nope, can't manage to understand what's happening.\nThe same code that's working on the test project doesn't work when copied on my real project index.js.\nAdditional info: i recently switched from Titanium 3.1.3 to Titanium 3.2.0, and it worked before.\nI don't know if this switch can somehow interfere with paths or other things.", "updateAuthor": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-02-03T15:41:35.000+0000", "updated": "2014-02-03T15:41:35.000+0000" }, { "id": "290875", "author": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "body": "Last comment:\ni copied my WHOLE project inside the test project folder.\nI compiled and then it worked, so i guess my project was somehow in a \"dirty\" state.\n\nSorry for the false issue!\nThanks for your help!", "updateAuthor": { "name": "themanuz", "key": "themanuz", "displayName": "Emanuele Salamone", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-02-03T15:48:08.000+0000", "updated": "2014-02-03T15:48:08.000+0000" }, { "id": "290887", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing on the basis of last comment by the reporter.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-03T17:34:11.000+0000", "updated": "2014-02-03T17:34:11.000+0000" }, { "id": "298064", "author": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've just had the same problem (a 3.1 project migrated to 3.2) and I found a nicer solution :\nRemove the \"Resources\" directory, and recompile it, it solves the problem for me. ", "updateAuthor": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-03-20T15:10:30.000+0000", "updated": "2014-03-20T15:10:30.000+0000" }, { "id": "298065", "author": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've just had the same problem (a 3.1 project migrated to 3.2) and I found a nicer solution :\nRemove the \"Resources\" directory, and recompile it, it solves the problem for me (Clean project doesn't solve it!)", "updateAuthor": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-03-20T15:14:16.000+0000", "updated": "2014-03-20T15:14:16.000+0000" }, { "id": "356888", "author": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just faced this issue too! Strange thing. Suggested solution solved it for me too", "updateAuthor": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-03T11:52:55.000+0000", "updated": "2015-07-03T11:52:55.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }