{ "id": "172025", "key": "TIMOB-26274", "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": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-24T01:19:06.000+0000", "created": "2018-08-07T20:02:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "20183", "description": "", "name": "Release 7.4.0", "archived": false, "released": true, "releaseDate": "2018-09-17" }, { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" }, { "id": "20099", "name": "Release 7.2.0", "archived": false, "released": true, "releaseDate": "2018-06-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-24T01:19:10.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": "While trying to get a reproducible case for memory-issues, I found another issue where when clicking the hamburger menu of a drawer layout will hide it and does not make it come back. \r\n\r\nTest-Case:\r\n{code:js}\r\nvar window = Ti.UI.createWindow({ backgroundColor: 'white', theme: 'Theme.AppCompat.NoTitleBar', exitOnClose: false });\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tvar window2 = Ti.UI.createWindow({ title: 'Test' });\r\n\tvar left = Ti.UI.createView({ backgroundColor: 'red' });\r\n\tvar center = Ti.UI.createView({ backgroundColor: 'blue' });\r\n\r\n\tvar button2 = Ti.UI.createButton({ title: 'Close'});\r\n\tleft.add(button2);\r\n\r\n\tbutton2.addEventListener('click', function () {\r\n\t\tdrawer.closeLeft();\r\n\t\twindow.open();\r\n\t\twindow2.close();\r\n\t})\r\n\r\n\tvar drawer = Ti.UI.Android.createDrawerLayout({\r\n\t\tcenterView: center,\r\n\t\tleftView: left\r\n\t});\r\n\twindow2.add(drawer);\r\n\twindow2.open();\r\n\twindow.close();\r\n});\r\n\r\nwindow.add(btn);\r\nwindow.open();\r\n{code}\r\n\r\n*Work-Around:*\r\nThe solution is to set up the hamburger button on the ActionBar yourself like this...\r\n{code:java}\r\nwindow.addEventListener(\"open\", function(e) {\r\n\tvar actionBar = window.activity.actionBar;\r\n\tif (actionBar) {\r\n\t\tactionBar.displayHomeAsUp = true;\r\n\t\tactionBar.homeButtonEnabled = true;\r\n\t\tactionBar.onHomeIconItemSelected = function(e) {\r\n\t\t\t// Handle the hamburger button click here...\r\n\t\t};\r\n\t}\r\n});\r\n{code}\r\n\r\nWe document this here...\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.ActionBar\r\n", "attachment": [], "flagged": false, "summary": "Android: Drawer hamburger menu disappears on click", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "440587", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think the real issue here is that adding the native {{DrawerLayout}} to the window automatically adds the hamburger button to the {{ActionBar}} and it's mishandled from there. Perhaps the {{DrawerLayout}} should not automatically add the button since we don't know which drawer (left, center, or right) to slide-out out.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-08T17:14:13.000+0000", "updated": "2018-08-08T17:14:13.000+0000" }, { "id": "440616", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/10243", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-09T16:10:13.000+0000", "updated": "2018-08-09T16:10:13.000+0000" }, { "id": "440762", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "*Closing ticket.*\r\n\r\nNo longer disappears when clicked and is only shown when specified {{actionBar.displayHomeAsUp = true;}}\r\n\r\nThe fix is present in SDK:\r\n\r\n{noformat}\r\n7.4.0.v20180813131247\r\n{noformat}\r\n\r\n*ENV*\r\n\r\n{noformat}\r\nAppc NPM: 4.2.13\r\nAppc CLI: 7.0.4\r\nTi CLI: 5.1.1\r\nNode: 8.9.4\r\nNPM: 6.3.0\r\n{noformat}\r\n\r\n*Test case*\r\n{noformat}\r\nvar window = Ti.UI.createWindow({ backgroundColor: 'white', theme: 'Theme.AppCompat.NoTitleBar', exitOnClose: false });\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tvar window2 = Ti.UI.createWindow({ title: 'Test' });\r\n\tvar left = Ti.UI.createView({ backgroundColor: 'red' });\r\n\tvar center = Ti.UI.createView({ backgroundColor: 'blue' });\r\n\r\n\tvar button2 = Ti.UI.createButton({ title: 'Close'});\r\n\tleft.add(button2);\r\n\r\n\tbutton2.addEventListener('click', function () {\r\n\t\tdrawer.closeLeft();\r\n\t\twindow.open();\r\n\t\twindow2.close();\r\n\t})\r\n\r\n\tvar drawer = Ti.UI.Android.createDrawerLayout({\r\n\t\tcenterView: center,\r\n\t\tleftView: left\r\n\t});\r\n\r\n // hamburger menu should only show when this is uncommented\r\n\t/*window2.addEventListener('open', function(){\r\n var activity = window2.getActivity(),\r\n actionBar = activity.getActionBar();\r\n\r\n if (actionBar) {\r\n actionBar.displayHomeAsUp = false;\r\n actionBar.onHomeIconItemSelected = function() {\r\n drawer.toggleLeft();\r\n };\r\n }\r\n });*/\r\n\r\n\twindow2.add(drawer);\r\n\twindow2.open();\r\n\twindow.close();\r\n});\r\n\r\nwindow.add(Ti.UI.createTableView({\r\n\tdata: [{\r\n\t\ttitle: 'Test'\r\n\t}],\r\n\tfooterView: btn\r\n}));\r\n\r\nwindow.open();\r\n{noformat}\r\n", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2018-08-14T15:26:38.000+0000", "updated": "2018-08-14T15:26:38.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }