{ "id": "62407", "key": "TIMOB-1775", "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": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-08-02T22:06:32.000+0000", "created": "2011-04-15T03:01:56.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "apidoc", "center", "feature", "missing", "patch", "properties", "ui", "ui.view", "view" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-02T22:06: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": "{html}
Docs for Ti.UI.View and its fellow view types lists a center\nproperty:
\n\nhttps://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI...
\n\ncenter object a dictionary with properties x and y to indicate the center of the views position relative to the parent view
\n
\nThis property is very useful for positioning things under, over,\nor next to other views, however it appears to be unimplemented on\nAndroid.
\n\n/*\n * This code demonstrates the missing center property on Android...\n * on iPhone shows: \"160, 230\"\n * on Android shows: \"wtf? null\"\n */\n\nvar window = Titanium.UI.createWindow({\n});\nvar button = Titanium.UI.createButton({\n title: \"Where am I?\",\n width: 200,\n height: 50\n});\nbutton.addEventListener('click', function() {\n var center = button.center;\n var msg;\n Ti.API.info('center: ' + center);\n if (center) {\n Ti.API.info('center.x: ' + center.x);\n Ti.API.info('center.y: ' + center.y);\n msg = center.x + ', ' + center.y;\n } else {\n msg = 'wtf? ' + center;\n }\n button.title = msg;\n});\nwindow.add(button);\nwindow.open();
\n
\nChanging it to check an actual 'View' object makes no\ndifference; View, Button, and Label have all been tested, and\nthere's no sign of a 'center' property implementation in the\ntitanium_mobile/android source tree.
I've implemented a getter, it seems to work for me:
\nhttp://github.com/brion/titanium_mobile/commits/android-center
\n\nhttp://github.com/brion/titanium_mobile/commit/f0c7f7d64f0d58ded647...
Assigning to Don for review per IRC.
(from [5c491f17f7d9592942ae24af18ac4a494ccfee4b])\n[#1775 state:fixed-in-qa] Implement getter for\nView.center property on Android \nhttp://github.com/appcelerator/titanium_mobile/commit/5c491f17f7d95...
1.6 G1, 2.2 simulator. iOS 4.1 and 3.2.2. 1.4.1.ec5d6d