{ "id": "172401", "key": "TIMOB-26442", "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-10-25T14:06:44.000+0000", "created": "2018-10-06T00:09:41.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "toolbar" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-25T19:39:19.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": "*Summary:*\r\nIf {{Toolbar}} property \"extendBackground\" is set {{true}} and the top status bar is transparent and the bottom navigation bar is transparent, then the {{Toolbar}} will end up being taller than expected. The {{Toolbar}}'s top padding will be set to the status bar's height and the {{Toolbar}}'s bottom padding will be set to the navigation bar's height.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android 4.4 or higher.\r\n# Notice the {{Toolbar}} has too much bottom padding.\r\n\r\n{code:javascript}\r\nvar FLAG_TRANSLUCENT_STATUS = 67108864;\r\nvar FLAG_TRANSLUCENT_NAVIGATION = 134217728;\r\nvar window = Ti.UI.createWindow({\r\n\ttheme: \"Theme.AppCompat.NoTitleBar\",\r\n\twindowFlags: FLAG_TRANSLUCENT_STATUS | FLAG_TRANSLUCENT_NAVIGATION,\r\n//\twindowFlags: FLAG_TRANSLUCENT_NAVIGATION,\r\n//\twindowFlags: FLAG_TRANSLUCENT_STATUS,\r\n});\r\nwindow.add(Ti.UI.createView({\r\n\tbackgroundColor: \"gray\",\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n}));\r\nvar toolbar = Ti.UI.createToolbar({\r\n\ttitle: \"My Toolbar\",\r\n\ttitleTextColor: \"white\",\r\n\tbackgroundColor: \"blue\",\r\n\textendBackground: true,\r\n\ttop: 0,\r\n\twidth: Ti.UI.FILL,\r\n});\r\nwindow.activity.supportToolbar = toolbar;\r\nwindow.add(toolbar);\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nThe {{Toolbar}}'s bottom padding is set to the height of the translucent navigation bar, as can be seen in attached screenshot \"NavBarTransparent.png\".\r\n !NavBarTransparent.png|thumbnail! \r\n\r\n*Expected Result:*\r\nIn this case, the {{Toolbar}}'s bottom padding is not desired. It's expected to look like attached screenshot \"NavBarOpaque.png\", where if the bottom navigation bar is opaque, no bottom padding is added to the {{Toolbar}}.\r\n !NavBarOpaque.png|thumbnail! \r\n\r\n*Notes:*\r\n* This is likely an issue on Google's end since they handling the padding internally.\r\n* This is a low priority issue since most apps (such as Google's apps) don't make both top and bottom system bars transparent at the same time.\r\n* Work-around is to not make the bottom navigation bar translucent... or leave the \"extendBackground\" property {{false}} and color the status bar via a theme.\r\n* Ideally, we would also want to support displaying a {{Toolbar}} at the bottom of the screen too. In which case, \"extendBackground\" should extend down beneath a transparent navigation bar. _(Would we need a new property indicating which direction we want to extend towards?)_\r\n\r\n*Recommended Solution:*\r\nOverride the Java {{Toolbar}} class' {{fitSystemWindows(Rect)}} method and strip-off the top or bottom inset before passing the rect over to {{super.fitSystemWindows(Rect)}}. This will work because Google's base {{View}} implementation blindly adds the insets as padding to the view.", "attachment": [ { "id": "65686", "filename": "NavBarOpaque.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-05T23:55:51.000+0000", "size": 35584, "mimeType": "image/png" }, { "id": "65687", "filename": "NavBarTransparent.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-05T23:55:51.000+0000", "size": 36041, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Toolbar with \"extendBackground\" true is too tall if both status bar and navigation bar is transparent", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "442369", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FYI: [~ybanev]\r\n\r\nI think this is a low priority issue, but I happened to find it while testing top and bottom notch support on Android P. When I finish adding \"safeAreaRect\" property support via [TIMOB-26427], the app developers will be able to position the {{Toolbar}} any way they see fit too without using \"extendBackground\".", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-06T00:15:28.000+0000", "updated": "2018-10-06T00:15:37.000+0000" }, { "id": "442584", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue needs to be solved in 7.5.0 since it can happen when using the {{Ti.UI.Window}} \"extendSafeArea\" property for Android P notch/inset support.\r\n\r\nI have a solution now. Will submit a PR next week.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-13T00:38:33.000+0000", "updated": "2018-10-13T00:38:33.000+0000" }, { "id": "442734", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10383", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-18T03:30:52.000+0000", "updated": "2018-10-18T03:30:52.000+0000" }, { "id": "442945", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "*FR Passed*\r\n\r\nWaiting on Jenkins to merge", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2018-10-25T14:06:36.000+0000", "updated": "2018-10-25T14:06:36.000+0000" }, { "id": "442959", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on SDK 7.5.0.v20181025085349.Working fine. Closing.\r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 8.12.0\r\n npm Version = 6.4.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nStudio\t\t\t=5.1.2.201810080801\r\nTitanium SDK\r\n SDK Version = 7.5.0.v20181025085349\r\nDevice = Samsung s5 Android 6,pixel android 9 \r\nEmulator\t\t = Samsung galaxy s6 android 6,nexus 4.4\r\n{code}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-25T19:39:14.000+0000", "updated": "2018-10-25T19:39:14.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }