{ "id": "92792", "key": "TIMOB-9371", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-06-11T11:34:00.000+0000", "created": "2012-06-04T17:13:17.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api", "parity" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-06-11T12:43:37.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": "h3. Problem\r\n\r\nPlease run the sample code below:\r\n\r\n{noformat}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#333'\r\n});\r\n\r\nvar menu = Ti.UI.createView({\r\n\tbackgroundColor:'blue',\r\n\ttop:Ti.Platform.displayCaps.platformHeight-50,\r\n\tbottom:0\r\n});\r\n\r\nmenu.addEventListener('touchmove', function(evt) {\r\n var point = menu.convertPointToView({ x: evt.x, y: evt.y }, win);\t\r\n \t\r\n \tmenu.top = point.y;\r\n \t\r\n});\r\n\r\nmenu.addEventListener('touchend', function(e){\r\n\t if(menu.top <((Ti.Platform.displayCaps.platformHeight/2)+100) && menu.top >((Ti.Platform.displayCaps.platformHeight/2))){\r\n \t \t\tmenu.top = Ti.Platform.displayCaps.platformHeight/2;\r\n \t} else if (menu.top >(Ti.Platform.displayCaps.platformHeight/2)+100){\r\n \t\tmenu.top = Ti.Platform.displayCaps.platformHeight-50;\r\n \t} else if (menu.top <((Ti.Platform.displayCaps.platformHeight/2))){\r\n \t\tmenu.top = 100;\r\n \t}\r\n})\r\n\r\nwin.add(menu);\r\n \r\nwin.open();\r\n\r\n{noformat}\r\n\r\nIn iOS, you see the blue draggable view alright but in Android, depending on the screen size the view is not visible. I tested with QVGA (where it works) and HVGA(where it does not work) avd screens. Please see the attached screenshot too.\r\n\r\n", "attachment": [ { "id": "28156", "filename": "Screen Shot 2012-06-04 at 5.09.14 PM.png", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-06-04T17:13:17.000+0000", "size": 191484, "mimeType": "image/png" }, { "id": "28157", "filename": "Screen Shot 2012-06-04 at 5.12.13 PM.png", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-06-04T17:13:17.000+0000", "size": 76873, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Ti.Platform.displayCaps.platformHeight and platformWidth do not work properly on different Android screen resolutions", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK: 2.0.1.GA2", "comment": { "comments": [ { "id": "198022", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This isn't a bug on Android. platformHeight and Width return the measurements of the screen (including notification bar and title bar), while \"top\" and \"bottom\" properties are relative to the parent view. The parent view's height will always be smaller than the platformHeight because of the app's title bar and/or the notification bar. In iOS, platformHeight and Width returns the screen measurements with NavBar included. Thus the sample code above will not work correctly in iOS. It will report a height of 30 dip, not 50 dip.\r\n\r\nWith that said, it's not a good idea to use platformHeight and Width to determine the height of views. Instead, the same behavior can be achieved by setting bottom to 0 and height to some dip value.\r\n{code}\r\nvar menu = Ti.UI.createView({\r\n backgroundColor:'blue',\r\n height: \"50dip\",\r\n bottom:0\r\n});\r\n{code}\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-11T11:32:21.000+0000", "updated": "2012-06-11T11:33:01.000+0000" }, { "id": "198023", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing bug as invalid", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-11T11:33:43.000+0000", "updated": "2012-06-11T11:33:43.000+0000" }, { "id": "198041", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Closing this ticket as per the above comment.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-06-11T12:43:37.000+0000", "updated": "2012-06-11T12:43:37.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }