{ "id": "137279", "key": "TIMOB-17809", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2020-08-18T01:03:15.000+0000", "created": "2014-09-26T19:38:51.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2020-08-18T01:03:15.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": [], "description": "App is using a custom theme that defines the following:\r\n\r\n{code:xml}\r\n\r\n\r\n \r\n\r\n{code}\r\n\r\n\r\nSubsequently, we have an in-house alloy widget that acts as a menu bar. It opens a separate window which should also have the title and action bar hidden based on the above theme.\r\n\r\nHowever, this is not the case.\r\n\r\nWhen the window opens, the action bar is present. We tried using:\r\n\r\n{code:javascript}\r\nfunction hideActionbar() {\r\n $.win.activity.actionBar.hide();\r\n}\r\n{code}\r\n\r\nafter the window opens, however this is not a great user experience. For a split second, the action bar is visible and the UI elements shift after it has hidden.\r\n", "attachment": [], "flagged": false, "summary": "Android Theme is not used by widget when widget opens a new window", "creator": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "environment": "sdk - 3.4.0.v20140916181713\r\nalloy - 1.5.0-rc2\r\n\r\nandroid", "comment": { "comments": [ { "id": "325995", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "HI,\r\n\r\nCan you please try to use a Titanium predefined themes. \r\n{code}\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-09-28T01:31:54.000+0000", "updated": "2014-09-28T01:31:54.000+0000" }, { "id": "325996", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "Unfortunately, switching the theme to the Titanium one has no effect.", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-28T01:37:30.000+0000", "updated": "2014-09-28T01:37:30.000+0000" }, { "id": "325997", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nDid this only happen the window is opened by widget, the normal window works well?", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-09-28T01:42:04.000+0000", "updated": "2014-09-28T01:42:04.000+0000" }, { "id": "325998", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "Yes. All other windows are fine. When the widget opens a new window, the new window shows the activity bar when it shouldn't. The widget opens a new window on a click event. It's a dead simple setup.", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-28T01:44:49.000+0000", "updated": "2014-09-28T01:44:49.000+0000" }, { "id": "325999", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Can you please provide a simple test case about the widget that present your problem, that will be real helpful.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-09-28T01:47:36.000+0000", "updated": "2014-09-28T01:47:36.000+0000" }, { "id": "326000", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "I simply don't have the time at the moment to create a blank project. However, here is some stuff I have pulled out of our existing code base. It should be enough to piece together something for you to work with and reproduce this issue. It's very straightforward.\r\n\r\nJust make a widget that opens a window and you should be able to reproduce it.\r\n\r\n1. Create alloy project with android theme as stated above.\r\n\r\n2. Create a widget with the following:\r\n\r\n{code:xml}\r\n\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\nWidget.tss\r\n{code}\r\n\"#menu\": {\r\n width: Ti.UI.SIZE,\r\n height: Ti.UI.SIZE\r\n},\r\n\"#menuIcon\": {\r\n image: \"/images/com.mywidget.dotMenu/menu-options-wide-white.png\"\r\n}\r\n{code}\r\n\r\n\r\n{code:javascript}\r\n// widget.js\r\nvar args = arguments[0] || {},\r\n _this = this,\r\n rowsArr = [],\r\n menuView = null;\r\n\r\n\r\n// == Public Functions == //\r\nexports.toggle = function(event) {\r\n _toggle(event);\r\n};\r\nfunction _toggle(event) {\r\n event.cancelBubble = true;\r\n\r\n if (origImg) {\r\n $.menuIcon.setImage(origImg);\r\n }\r\n\r\n if (!menuView) {\r\n menuView = Widget.createController(\"menu\", {rows: rowsArr, parent: _this}).getView();\r\n menuView.open();\r\n } else {\r\n if (menuView) {\r\n menuView.close();\r\n menuView = null;\r\n }\r\n }\r\n}\r\n{code}\r\n\r\n\r\n\r\nWidget.js displays an icon which opens a menu when clicking.\r\n\r\n{code:xml}\r\n\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\nmenu.tss\r\n{code}\r\n\"#win\": {\r\n // Need to fill all screen to catch off-menu clicks to close menu\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: \"transparent\",\r\n opacity: 1\r\n},\r\n\"#menuTable\": {\r\n top: \"40dp\",\r\n right: \"0dp\",\r\n width: \"200dp\", \r\n height: Ti.UI.SIZE,\r\n backgroundColor: \"#F2F2F2\",\r\n color: \"#5b5b5b\",\r\n borderColor: '#bfbfbf',\r\n borderWidth: 1,\r\n zIndex: 9000\r\n},\r\n\"#menuTable[platform=ios]\": {\r\n top: \"50dp\"\r\n}\r\n{code}\r\n\r\n\r\n{code:javascript}\r\n // this simply has onclick listeners for menu items in the tableview. nothing special here.\r\n{code}\r\n\r\n\r\n\r\nInclude the widget by the following alloy xml:\r\n\r\n{code:xml}\r\n\r\n \r\n\r\n{code}\r\n\r\n", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-28T01:59:48.000+0000", "updated": "2014-09-28T02:00:44.000+0000" }, { "id": "326032", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "As Widgets have their own views, controllers, models, styles and assets and are laid out the same as the app directory in the Alloy project. so Widgets have their own themes. Please try to set noActionBar Themes to widget as well. Here is the reference: [http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_Widgets-section-35621514_AlloyWidgets-UsingWidgets], please check the themes section.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-09-29T03:16:21.000+0000", "updated": "2014-09-29T03:16:21.000+0000" }, { "id": "326083", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "Yes. That's correct, however, we're not using Alloy themes to set no action bar. \r\n\r\nWe're using a platform specific android file.\r\n\r\nAs stated above a file like the following:\r\n\r\n{code:xml}\r\n\r\n\r\n \r\n\r\n{code}\r\n\r\nis used. This file is located at /platform/android/res/values/themes.xml.\r\n\r\nPlease note that this issue is NOT present on iOS. This is only an android issue. The changes defined by themes.xml should apply to the entire app. They are applied, but not to the widget when the widget opens up a separate window. Unfortunately, this has nothing to do with Alloy themes.", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-29T14:06:25.000+0000", "updated": "2014-09-29T14:07:07.000+0000" }, { "id": "326165", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "Hi Shuo,\r\n\r\nWe tracked this down. It happened in one other place in our application other than the widget. As it turns out, having the Window element with a background set to transparent creates this issue. The action bar reappears and none of the styles from the themes.xml file are obeyed. Having the application obey the android themes.xml file is important to us since we apply styles to buttons and other elements.\r\n\r\nAny suggestions?\r\n\r\nEDIT: I should mention that a colleague of mine asked me to try setting the background to black and add a really low opacity value to make it transparent. This works for him in a previous titanium version. Unfortunately, that also triggers the action bar to show.", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-29T19:51:47.000+0000", "updated": "2014-09-29T20:05:19.000+0000" }, { "id": "326181", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "As a workaround, we have changed our android theme to the following:\r\n\r\n{code:xml}\r\n\r\n\r\n\r\n \r\n\r\n{code}\r\n\r\nThis creates a starting point for window elements that is similar to ios with a transparent default. Unfortunately, this is just a workaround. Setting a background of transparent or changing the opacity of a Window element should not affect its properties as stated above. ", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-09-29T20:39:48.000+0000", "updated": "2014-09-29T20:40:12.000+0000" }, { "id": "326238", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "I am glad you find the workaround, I will forward this ticket to our engineer team to take care of it.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-09-30T00:22:31.000+0000", "updated": "2014-09-30T00:22:31.000+0000" }, { "id": "331523", "author": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "body": "HI There. What's the latest on this?\r\n\r\nAs it turns out, the workaround I mentioned above is not the greatest. In some cases, setting the theme properties mentioned in the workaround actually makes all windows on the stack transparent such that when a new window is opened, the entire app \"disappears\" except for the new window. This also occurs on datepickers. i.e. the background windows all disappear when the picker is launched.", "updateAuthor": { "name": "astjohn", "key": "astjohn", "displayName": "Adam", "active": true, "timeZone": "America/Havana" }, "created": "2014-11-11T04:20:15.000+0000", "updated": "2014-11-11T04:20:15.000+0000" }, { "id": "456492", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This will work if you set the theme like this...\r\n{code:xml}\r\n\r\n{code}\r\n\r\nThe key thing is you need to set the \"windowActionBar\" to {{false}}.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-18T01:02:51.000+0000", "updated": "2020-08-18T01:02:51.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }