{ "id": "97662", "key": "TIMOB-10043", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-05T23:35:40.000+0000", "created": "2012-07-19T14:05:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "core", "module_platform", "parity", "qe-review", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "19006", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "97672", "key": "ALOY-117", "fields": { "summary": "Identify is a device is \"handheld\" or \"tablet\" on all supported platforms", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-05T23:35:40.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": "h2. description\r\n\r\nIn order to reliably determine the physical size of an Android device, it would be beneficial to use Android's own assessment of the device. To do so, we should expose the screen layout size of an Android device via a simple comparison on Android's {{Configuration.screenLayout}} property. This property and getter method should be added to {{Ti.Platform.displayCaps}} and return the various possible Android screen layout size, currently:\r\n\r\n* small\r\n* normal\r\n* large\r\n* xlarge\r\n\r\nIt should be noted that {{xlarge}} was actually added at API level 9, so its constant value with be entered manually.\r\n\r\nh2. test app\r\n\r\nJust pop this into a default titanium mobile project and test on android.\r\n\r\n{code:javascript}\r\nvar size = Ti.Platform.Android.physicalSizeCategory;\r\nvar str = '';\r\nswitch(size) {\r\n\tcase Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_SMALL:\r\n\t\tstr = 'small';\r\n\t\tbreak;\r\n\tcase Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_NORMAL:\r\n\t\tstr = 'normal';\r\n\t\tbreak;\r\n\tcase Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_LARGE:\r\n\t\tstr = 'large';\r\n\t\tbreak;\r\n\tcase Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_XLARGE:\r\n\t\tstr = 'xlarge';\r\n\t\tbreak;\r\n\tcase Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_SMALL:\r\n\t\tstr = 'undefined';\r\n\t\tbreak;\r\n}\r\n\r\nalert(\r\n\t'width: ' + Ti.Platform.displayCaps.platformWidth + '\\n' +\r\n\t'height: ' + Ti.Platform.displayCaps.platformHeight + '\\n' +\r\n\t'dpi: ' + Ti.Platform.displayCaps.dpi + '\\n' +\r\n\t'den: ' + Ti.Platform.displayCaps.density + '\\n' +\r\n\t'ldf: ' + Ti.Platform.displayCaps.logicalDensityFactor + '\\n' +\r\n\t'xdpi: ' + Ti.Platform.displayCaps.xdpi + '\\n' +\r\n\t'ydpi: ' + Ti.Platform.displayCaps.ydpi + '\\n' +\r\n\t'SIZE: ' + str\r\n ); \r\n\r\n{code}\r\n\r\nh2. concerns\r\n\r\nParity tickets may need to be raised for Mobileweb and iOS.", "attachment": [], "flagged": false, "summary": "Android: Add \"physicalSizeCategory\" to Ti.Platform.displayCaps", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 2.2\r\nAndroid 2.2+", "comment": { "comments": [ { "id": "208511", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR submitted: https://github.com/appcelerator/titanium_mobile/pull/2610\r\n\r\nWhile far from a comprehensive test, I ran this against the following devices and emulators, all of which returned the correct values:\r\n\r\n* Transformer Prime: xlarge\r\n* Galaxy Nexus: normal\r\n* Galaxy Tab (emulator): large", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-19T14:28:18.000+0000", "updated": "2012-07-19T14:39:30.000+0000" }, { "id": "208645", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The functionality is android-specific, much like the existing {{xdpi}} and {{ydpi}} properties. As far as I can tell from perusing the code, iOS and mobileweb implement neither of these properties and simply return {{undefined}} when they are accessed in Titanium at runtime. I was following those examples when implementing this property.\r\n\r\nI have no aversion to attaching this new property to an Android-specific namespace if you think that will help. Let me know how you'd like me to proceed and I can adjust the corresponding PR.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-20T04:38:26.000+0000", "updated": "2012-07-20T04:38:26.000+0000" }, { "id": "210280", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This has been made into an Android-only property, with corresponding constants and docs, in {{Ti.Platform.Android}}. The PR has been updated.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-27T14:45:53.000+0000", "updated": "2012-07-27T14:45:53.000+0000" }, { "id": "214929", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTested with Titanium SDK: 2.2.0.v20120816212512\r\nTested with Titanium  Studio: 2.1.1.201207271312\r\nDevice - Samsung GALAXY Note Android 2.3.6,Samung GALAXY Tab 620 Android 3.2\r\nMachine OS - MAC 10.8", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T23:06:18.000+0000", "updated": "2012-08-16T23:06:18.000+0000" }, { "id": "217777", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-05T23:35:01.000+0000", "updated": "2012-09-05T23:35:01.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }