{ "id": "170365", "key": "TIMOB-25556", "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": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-11-23T21:25:23.000+0000", "created": "2017-11-17T15:15:56.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "drawerlayout" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-23T21:25:23.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": "*Description*\r\nThe current DrawerLayout.drawerLockMode supports only:\r\n\r\n* LOCK_MODE_LOCKED_CLOSED\r\n* LOCK_MODE_LOCKED_OPEN\r\n* LOCK_MODE_UNDEFINED\r\n* LOCK_MODE_UNLOCKED \r\n\r\nfor both views (left/right) at the same time.\r\nExtending it so it will you the second parameter \"Gravity\":\r\nhttps://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html#setDrawerLockMode(int,%20int)\r\nwould allow users to set the lock mode individually for each view.\r\n\r\n*Proposal:*\r\nChanging the int parameter to a dictionary of:\r\n* drawerLockMode : Number (see above)\r\n* drawerGravity: Number (LEFT, RIGHT)\r\n\r\n\r\n*Source code*\r\n[Property at Github|https://github.com/appcelerator/titanium_mobile/blob/111153d8600857e6d2e752cdef60dc217dbc15a9/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIDrawerLayout.java#L411]\r\nwould be a place to start", "attachment": [], "flagged": false, "summary": "Android: Extend drawerLockMode to set Gravity", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "430917", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I will try to make a PR with the parameters as described in the propsal", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-17T15:16:44.000+0000", "updated": "2017-11-17T15:16:44.000+0000" }, { "id": "431248", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9627\r\n\r\n*Example*\r\n{code}\r\nvar win = Ti.UI.createWindow(),\r\n\tleftView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#333\",\r\n\t\tlayout: \"vertical\"\r\n\t}),\r\n\tcenterView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#fff\"\r\n\t}),\r\n\trightView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#333\"\r\n\t}),\r\n\tdrawer = Ti.UI.Android.createDrawerLayout({\r\n\t\tleftView: leftView,\r\n\t\tcenterView: centerView,\r\n\t\trightView: rightView\r\n\t}),\r\n\tmenu = Ti.UI.createView({\r\n\t\tlayout: \"vertical\"\r\n\t}),\r\n\tbtn1 = Ti.UI.createButton({\r\n\t\ttitle: 'Open Left'\r\n\t}),\r\n\tbtn2 = Ti.UI.createButton({\r\n\t\ttitle: 'Open Right'\r\n\t}),\r\n\tbtn3 = Ti.UI.createButton({\r\n\t\ttitle: 'Lock all'\r\n\t}),\r\n\tbtn4 = Ti.UI.createButton({\r\n\t\ttitle: 'Lock left'\r\n\t}),\r\n\tbtn5 = Ti.UI.createButton({\r\n\t\ttitle: 'Lock right'\r\n\t}),\r\n\tbtn6 = Ti.UI.createButton({\r\n\t\ttitle: 'unLock all'\r\n\t});\r\n\r\nfor (var i = 0; i < 10; ++i) {\r\n\tvar lbl1 = Ti.UI.createLabel({\r\n\t\tcolor: \"#fff\",\r\n\t\ttext: \"Item\",\r\n\t\ttop: 10,\r\n\t\tbottom: 10,\r\n\t\theight: Ti.UI.SIZE\r\n\t});\r\n\tleftView.add(lbl1);\r\n}\r\n\r\nbtn2.addEventListener('click', function() {\r\n\tif (drawer.getDrawerLockMode().lockMode != Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED) {\r\n\t\tdrawer.toggleRight();\r\n\t} else {\r\n\t\t// drawer is locked - check gravity\r\n\t\tif (drawer.getDrawerLockMode().gravity != Titanium.UI.Android.DrawerLayout.GRAVITY_RIGHT &&\r\n\t\t\tdrawer.getDrawerLockMode().gravity != Titanium.UI.Android.DrawerLayout.GRAVITY_BOTH) {\r\n\t\t\t// right is not locked\r\n\t\t\tdrawer.toggleRight();\r\n\t\t}\r\n\t}\r\n});\r\nbtn1.addEventListener('click', function() {\r\n\tif (drawer.getDrawerLockMode().lockMode != Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED) {\r\n\t\tdrawer.toggleLeft();\r\n\t} else {\r\n\t\t// drawer is locked - check gravity\r\n\t\tif (drawer.getDrawerLockMode().gravity != Titanium.UI.Android.DrawerLayout.GRAVITY_LEFT &&\r\n\t\t\tdrawer.getDrawerLockMode().gravity != Titanium.UI.Android.DrawerLayout.GRAVITY_BOTH) {\r\n\t\t\t// left is not locked\r\n\t\t\tdrawer.toggleLeft();\r\n\t\t}\r\n\t}\r\n});\r\nbtn3.addEventListener('click', function() {\r\n\tdrawer.setDrawerLockMode(Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\r\n\tconsole.log(drawer.getDrawerLockMode());\r\n});\r\nbtn4.addEventListener('click', function() {\r\n\tdrawer.setDrawerLockMode({\r\n\t\tlockMode: Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED,\r\n\t\tgravity: Titanium.UI.Android.DrawerLayout.GRAVITY_LEFT\r\n\t});\r\n\tconsole.log(drawer.getDrawerLockMode());\r\n});\r\nbtn5.addEventListener('click', function() {\r\n\tdrawer.setDrawerLockMode({\r\n\t\tlockMode: Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED,\r\n\t\tgravity: Titanium.UI.Android.DrawerLayout.GRAVITY_RIGHT\r\n\t});\r\n\tconsole.log(drawer.getDrawerLockMode());\r\n});\r\nbtn6.addEventListener('click', function() {\r\n\tdrawer.setDrawerLockMode(Titanium.UI.Android.DrawerLayout.LOCK_MODE_UNLOCKED);\r\n\tconsole.log(drawer.getDrawerLockMode());\r\n});\r\n\r\ncenterView.add(menu);\r\nmenu.add(btn1);\r\nmenu.add(btn2);\r\nmenu.add(btn3);\r\nmenu.add(btn4);\r\nmenu.add(btn5);\r\nmenu.add(btn6);\r\n\r\nwin.addEventListener('open', function() {\r\n\tvar activity = win.getActivity(),\r\n\t\tactionbar = activity.getActionBar();\r\n\r\n\tif (actionbar) {\r\n\t\tactionbar.displayHomeAsUp = true;\r\n\t\tactionbar.onHomeIconItemSelected = function() {\r\n\t\t\tdrawer.toggleLeft();\r\n\t\t};\r\n\t}\r\n});\r\n\r\nwin.add(drawer);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-25T17:08:03.000+0000", "updated": "2017-11-25T17:08:03.000+0000" }, { "id": "431249", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "A question about the documentation parameters. It is still possible to use the set() method the old way with an integer instead of a hashmap like this\r\n\r\n* Both views / current way:\r\n{{drawer.setDrawerLockMode(Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED);}}\r\n* Custom side:\r\n{code}drawer.setDrawerLockMode({\r\n\t\tlockMode: Titanium.UI.Android.DrawerLayout.LOCK_MODE_LOCKED_CLOSED,\r\n\t\tgravity: Titanium.UI.Android.DrawerLayout.GRAVITY_LEFT\r\n\t});\r\n{code}\r\n\r\nHow to write this in the documentation?", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-25T17:16:02.000+0000", "updated": "2017-11-25T17:16:02.000+0000" }, { "id": "431250", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Thanks for the ticket and the PR. I will forward this to our engineering team to move forward. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-11-25T20:29:46.000+0000", "updated": "2017-11-25T20:29:46.000+0000" }, { "id": "450185", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~amukherjee] This missed the 8.1.0 timeframe and is an enhancement, not a bug fix. Given that 8.2.0 is iOS 13, this probably should be changed to fix version 8.3.0.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-07-31T15:29:30.000+0000", "updated": "2019-07-31T15:29:30.000+0000" }, { "id": "451276", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/10970", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-10T21:30:29.000+0000", "updated": "2019-09-10T21:30:29.000+0000" }, { "id": "451601", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "Hi.\r\nbq. master: https://github.com/appcelerator/titanium_mobile/pull/10970\r\nI think this a bad API, it is neither like other Titanium nor like Android:\r\n- Ti-developers know nothing about \"gravity\", drawers are set with \"{{leftView}}\" and \"{{rightView}}\" properties.\r\n- Using a \"gravity\" property on DrawerLayout itself to setup lock mode can be confusing to Android developers.\r\n\r\nIn the original [Ti.Drawer|https://github.com/manumaticx/Ti.DrawerLayout] module I made similar [API change|https://github.com/manumaticx/Ti.DrawerLayout/commit/deed60f8bedd1628e6bd779db2ded5bf52c5e2e9] over two years ago.\r\nOnly a couple of new properties.\r\n\r\n", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2019-09-24T11:27:40.000+0000", "updated": "2019-09-24T11:27:40.000+0000" }, { "id": "451923", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/11271", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2019-10-09T14:49:05.000+0000", "updated": "2019-10-09T14:49:05.000+0000" }, { "id": "457472", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nThe individual drawer lock mode defined using leftDrawerLockMode and rightDrawerLockMode working fine.\r\n_Note: The lock mode defined on an individual view (using leftDrawerLockMode or rightDrawerLockMode property) would prevail over the defined general lock mode (using drawerLockMode)._", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-06T21:40:29.000+0000", "updated": "2020-11-06T21:40:29.000+0000" }, { "id": "457473", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Waiting on Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-06T21:56:56.000+0000", "updated": "2020-11-06T21:56:56.000+0000" }, { "id": "457485", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.3.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-11-09T15:00:23.000+0000", "updated": "2020-11-09T15:00:23.000+0000" }, { "id": "457692", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nMac OS: 10.15.4\r\nSDK: 9.3.0.v20201123121926\r\nAppc CLI: 8.1.1\r\nJDK: 11.0.6\r\nNode: 12.16.1\r\nStudio: 6.0.0.202005141803\r\nDevice: Pixel 3 XL(v11.0) emulator", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-23T21:25:23.000+0000", "updated": "2020-11-23T21:25:23.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }