{ "id": "139320", "key": "TIMOB-18040", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-04-25T09:07:43.000+0000", "created": "2014-11-10T16:42:57.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "TCSupport", "gravity", "notification", "toast" ], "versions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [ { "id": "42997", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "139808", "key": "TIDOC-1988", "fields": { "summary": "Android: Document Ti.UI.Notification.gravity ", "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": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-07-01T00:35:51.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": "I'd like to position an Android Toast ({{Ti.UI.Notification}} on the top half of the screen. I thought this wasn't possible, but then found that the first [gravity|http://developer.android.com/guide/topics/ui/notifiers/toasts.html#Positioning] argument for {{setGravity}} that I needed is actually [exposed|https://github.com/appcelerator/titanium_mobile/blob/58198c641d77e17d156431666e80bae732b5c130/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUINotification.java#L65-L69], just not documented.\r\n\r\nUsing the integer value of the Android documentation for [Gravity.TOP|http://developer.android.com/reference/android/view/Gravity.html#TOP] I was able to position the Toast on the top half of the screen:\r\n\r\n{code}\r\nTi.UI.createNotification({\r\n message: \"Please Stand By\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_LONG,\r\n gravity: 48 // Gravity.TOP\r\n}).show();\r\n{code}\r\n\r\nMy request is:\r\n\r\n* Document the `gravity` property\r\n* Expose the gravity constants ({{Ti.UI.Android.GRAVITY_TOP}} etc..)", "attachment": [], "flagged": false, "summary": "Android: Expose \"gravity\" constants in Ti.UI.Notification", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "master", "comment": { "comments": [ { "id": "383775", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Community PR: https://github.com/appcelerator/titanium_mobile/pull/6435\r\n\r\nDemo:\r\n{code:javascript}\r\nTi.UI.createNotification({\r\n message: \"Please Stand By\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_LONG,\r\n gravity: Ti.UI.Android.GRAVITY_TOP\r\n}).show();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-04-25T08:49:20.000+0000", "updated": "2016-04-26T07:31:34.000+0000" }, { "id": "389695", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the implementation.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.7.0.201606220541\r\nTi SDK : 5.4.0.v20160630074247\r\nTi CLI : 5.0.9\r\nAlloy : 1.9.0\r\nMAC El Capitan : 10.11.5\r\nAppc NPM : 4.2.7-2\r\nAppc CLI : 5.4.0-23\r\nNode: 4.4.4\r\nNexus 6 - Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-01T00:35:42.000+0000", "updated": "2016-07-01T00:35:42.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }