{ "id": "168595", "key": "TIMOB-24898", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-07-11T13:43:57.000+0000", "created": "2017-06-24T04:59:02.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-07T07:00:31.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": "The below code loosely simulates how I implemented an overlay tutorial in my app using backgroundColor transparency, set via hex triplets. mainview and label represent app content. containerview is an overlay containing tutorial information, and masking view represents a view that 'darkens' the content until it needs to be highlighted. In the example below, it toggles the highlighting by setting the maskingview backgroundColor alpha to either 0 or 90% when you click the view. \r\n\r\nExpected result is the alpha of the maskingview backgroundColor changes and the mainview content is visible or masked. Works on both Android and iOS using SDK 5.4.0.GA. Works on iOS using SDK 6.1.0.GA, but not Android. Commenting out setting borderRadius on the maskingview (issue is both at create or runtime) solves the problem on Android.\r\n\r\nSteps to reproduce: uncomment the borderRadius setter below, build with 5.4.0.GA on Android. Expected result: clicking on view fades or shows the underlying \"Hello\". Rebuild with 6.1.0.GA on Android, clicking on view complete hides the underlying view. Comment out borderRadius setter under 6.1.0.GA, works as expected again.\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'black'\r\n});\r\n \r\nvar mainview = Ti.UI.createView({\r\n\tbackgroundColor: \"#202020\",\r\n\twidth: 200, height: 200\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"Hello\",\r\n\twidth: 50,\theight: 30,\tcolor: \"white\"\r\n});\r\n\r\nmainview.add(label);\r\n\r\nvar containerview = Ti.UI.createView({\r\n\tbackgroundColor: \"#00202020\",\r\n\twidth: 300, height: 300\r\n});\r\n\r\nvar maskingview = Ti.UI.createView({\r\n\twidth: 200, height: 200, \r\n\t//borderRadius: 6, \r\n\tborderWidth: 1, \r\n\tborderColor: \"#ff0000\",\r\n\tbackgroundColor: \"#e6202020\"\r\n});\r\n\r\ncontainerview.add(maskingview);\r\nwin.add(mainview);\r\nwin.add(containerview);\r\n \r\nmaskingview.addEventListener('click', function(e) {\r\n\tmaskingview.backgroundColor = (maskingview.backgroundColor == \"#e6202020\" ? \"#00202020\" : \"#e6202020\");\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: setting view.borderRadius causes backgroundColor alpha to be ignored", "creator": { "name": "beermat", "key": "beermat", "displayName": "Ian Wall", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "beermat", "key": "beermat", "displayName": "Ian Wall", "active": true, "timeZone": "America/Chicago" }, "environment": null, "closedSprints": [ { "id": 917, "state": "closed", "name": "2017 Sprint 13 SDK", "startDate": "2017-06-18T16:14:35.902Z", "endDate": "2017-07-02T16:14:00.000Z", "completeDate": "2017-07-06T23:53:22.101Z", "originBoardId": 114 }, { "id": 920, "state": "closed", "name": "2017 Sprint 14 SDK", "startDate": "2017-07-02T16:29:41.455Z", "endDate": "2017-07-16T16:29:00.000Z", "completeDate": "2017-07-17T14:39:47.328Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "423131", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9179", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-29T10:43:04.000+0000", "updated": "2017-06-29T10:43:04.000+0000" }, { "id": "423610", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-06T18:42:38.000+0000", "updated": "2017-07-06T18:42:38.000+0000" }, { "id": "423898", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Jenkins tests are failing due to {{backgroundColor: null}}\r\n\r\nReopening to push fix.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-11T11:39:03.000+0000", "updated": "2017-07-11T11:39:03.000+0000" }, { "id": "423899", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9214", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-11T11:45:18.000+0000", "updated": "2017-07-11T11:45:18.000+0000" }, { "id": "423922", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Changes are seen in SDK 6.2.0.v20170711090338. Closing ticket.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-11T17:19:16.000+0000", "updated": "2017-07-11T17:19:16.000+0000" }, { "id": "427531", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "There is a little bug in 6.2.0.RC when you don't set a {{backgroundColor}} and apply a {{borderRadius}} it will disable HW acceleration. But if you set the background color to {{\"transparent\"}} it will keep the acceleration (like it was in 6.1.2.GA)\r\n\r\n*Code* (sorry it's an alloy project)\r\n\r\nJS\r\n{code:javascript}\r\nvar d = [];\r\nfor (var i = 0; i < 20; ++i) {\r\n\td.push({\r\n\t\tviewPlayer: {\r\n\t\t\twidth: \"50%\"\r\n\t\t}\r\n\t});\r\n}\r\n$.list_events.sections[0].setItems(d);\r\n$.index.open();\r\n{code}\r\n\r\nTSS\r\n{code}\r\n\".view_event\" : {left: 5,right: 5,top: 5,backgroundColor: \"#AAA\",height: 90,bottom: 5,borderRadius: 4,borderColor: \"#DDD\",borderWidth: 1}\r\n\"#list_events\" : {height: Ti.UI.FILL,width: Ti.UI.FILL}\r\n\".viewPlayer\":{height: Ti.UI.FILL,left:0,backgroundColor: \"#f00\"}\r\n\r\n\".view_player\": {\r\n\tleft:10,right:10,height: 15,\r\n\t/*backgroundColor: \"transparent\",*/\r\n\tborderRadius: 4,borderColor: \"#999\",\r\n}\r\n{code}\r\n\r\nXML\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nIn 6.2.0.RC the movement of the ListView is not smooth (in 6.1.2.GA it is). When you uncomment the line {{backgroundColor:\"transparent\"}} it will be smooth in 6.2.0.RC. ", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-02T10:35:28.000+0000", "updated": "2017-09-02T10:35:28.000+0000" }, { "id": "427541", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael] What's interesting is it's actually the opposite. When {{backgroundColor}} is not set and {{borderRadius}} is set whilst you are running Android 6.0+. HW-acceleration will be enabled. Setting {{backgroundColor: 'transparent'}} with the {{borderRadius}} set will disable HW-acceleration (which allows transparency to work).\r\n\r\nSo you are seeing a smoother ListView with HW-acceleration disabled. Android can be temperamental when it comes to HW-acceleration and in your case you are seeing improvements with it disabled.\r\n\r\nYou could try disabling HW-acceleration in your manifest ([read more|https://developer.android.com/guide/topics/graphics/hardware-accel.html])\r\n{code:XML}\r\n\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-04T14:26:43.000+0000", "updated": "2017-09-04T14:26:43.000+0000" }, { "id": "427544", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've put some log in TiUiView (before every disableHWAcceleration() call\r\n\r\n*output for transparent backgroundColor (smooth scrolling):*\r\n\r\n{code}\r\n[INFO] BGColor: (main) [7,167] 0\r\n[INFO] BGColor: (main) [160,160] -5592406\r\n[INFO] BGColor: (main) [0,160] disable HWAccel because of bgColor \r\n[INFO] TiUIView: (main) [0,160] disableHWAcceleration()\r\n{code}\r\n\r\n*output for no backgroundColor (laggy scrolling)*\r\n{code}\r\n[INFO] BGColor: (main) [4,180] null\r\n[INFO] BGColor: (main) [10,190] -5592406\r\n[INFO] BGColor: (main) [1,191] disable HWAccel because of bgColor\r\n[INFO] TiUIView: (main) [0,191] disableHWAcceleration()\r\n{code}\r\n\r\nSo you are right, it is disabling HW acceleration in both cases.\r\n\r\nBut adding \r\n{code:xml}\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n{code}\r\ndoesn't make any difference.\r\n\r\nSo it looks like there is something else that is responsible for lowering the performance. In 6.1.2.GA it is smooth in both cases. I'm currently checking {{TiBackgroundDrawable}}\r\n", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-04T16:41:51.000+0000", "updated": "2017-09-04T16:41:51.000+0000" }, { "id": "427546", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~gmathews] There is an endless {{draw()}} loop in {{TiBackgroundDrawable}}!\r\n\r\nA log in {{draw()}} is called once per ListView item when I set the backgroundColor to transparent. When I don't set it it is called constantly! So its not the HW acceleration that is causing the problem it is a constant redraw! But I'm not sure what is calling {{draw()}} all the time :)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-04T16:57:42.000+0000", "updated": "2017-09-04T16:57:42.000+0000" }, { "id": "427548", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael] Uh oh!! Thanks for finding that, I'll take a look!", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-04T17:00:50.000+0000", "updated": "2017-09-04T17:00:50.000+0000" }, { "id": "427683", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-07T14:08:38.000+0000", "updated": "2017-09-07T14:08:38.000+0000" }, { "id": "427687", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Nice, thank you [~gmathews]!", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-07T15:42:17.000+0000", "updated": "2017-09-07T15:42:17.000+0000" }, { "id": "430150", "author": { "name": "dyan02", "key": "dyan02", "displayName": "ardy wongso", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is it me or it happen again on 6.3.0\r\n\r\nfor eg: \r\nvar avatarView = Ti.UI.createImageView({\r\n\t\theight:'40',width:'40',\r\n\t\tborderRadius:20,\r\n\t\ttouchEnabled:false,\r\n\t\tdefaultImage:'/icon/ic_blueUser.png',\r\n\t\tbackgroundColor:'#fff',\r\n\t});\r\n\r\nwhen i add above code to view, in 6.1.2 is shows BOX image, in 6.2.2 it shows CIRCLE image, in 6.3.0 it shows CIRCLE image, i think something is wrong with handling border radius.\r\n\r\nbut when i turn off hardware acceleration (android:hardwareAccelerated = \"false\") in 6.1.2, 6.2.2 and 6.3.0 it shows circle\r\n\r\nit happen on s4 mini 4.4.2, but in other android phone it works fine.\r\n\r\nsorry if this not related to main bug.", "updateAuthor": { "name": "dyan02", "key": "dyan02", "displayName": "ardy wongso", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-06T09:15:21.000+0000", "updated": "2017-11-06T09:15:21.000+0000" }, { "id": "440536", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, \r\n\r\nThis (or something similar) seems to have come up again\r\n\r\nTitanium SDK 7.2.0 \r\nReal Device: Lenovo A328 - Android 4.4.2\r\nSimulator: Genymotion Google Nexus 5 - 4.4.4 - API 19 - 1080x1920\r\n\r\nSteps to reproduce:\r\n1. Build a new clean alloy app\r\n2. Add the following code to index.js\r\n3. Notice the top of the child view gets cut off.\r\n4. To fix - remove borderRadius value and build again and the view will no longer be cut off\r\n\r\n{code:java}\r\n// create alertView container\r\nvar alertView = Ti.UI.createView({\r\n\t backgroundColor:'white',\r\n\t opacity: 0.90,\r\n\t borderRadius: 5,\r\n\t width: \"85%\",\r\n\t height: '200dp',\r\n\t layout: 'vertical',\r\n});\r\n\r\n// create alertTitleView\r\nvar alertTitleView = Ti.UI.createView({\r\n width: Ti.UI.FILL,\r\n height: Ti.UI.SIZE,\r\n});\r\n\r\n// create alertTitleLabel\r\nvar alertTitleLabel = Ti.UI.createLabel({\r\n text: \"This is a long test title This is a long test title This is a long test title This is a long test title\",\r\n color: 'black',\r\n textAlign: 'center',\r\n touchEnabled: false,\t\r\n top: \"15dp\",\r\n left: 5,\r\n right: 5,\r\n font: {\r\n\t\t\tfontSize: '20dp',\r\n\t\t}\r\n});\r\n\r\nalertTitleView.add(alertTitleLabel);\r\nalertView.add(alertTitleView);\r\n\r\n$.main.backgroundColor = \"black\";\r\n\r\n$.main.add(alertView);\r\n\t \r\n$.main.open();\r\n{code}\r\n", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-07T07:00:31.000+0000", "updated": "2018-08-07T07:00:31.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }