{ "id": "171471", "key": "TIMOB-25945", "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": "20972", "description": "", "name": "Release 8.3.1", "archived": false, "released": true, "releaseDate": "2020-01-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-01-06T15:54:31.000+0000", "created": "2018-04-06T20:44:13.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "engSchedule", "regression" ], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" } ], "issuelinks": [ { "id": "58457", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175204", "key": "TIMOB-27991", "fields": { "summary": "Ti.UI.View: Titanium.UI.View Acceptance TIMOB-25945 Android only", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2020-06-30T11:10:17.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": "Hi, \r\n\r\nIn our application, we have a requirement where the view should have a shadow effect. For iOS, we are using viewShadowRadius, viewShadowColor and viewShadowOffset properties for getting the shadow effect behavior. For Android, we are using the *elevation* property. \r\nWhen the view gets changed dynamically(i.e., if we add any view to existing view which has the elevation), the elevation for the existing view is disappeared. \r\nWe tried to add the elevation property in 'post layout' event callback but it is not working. \r\n\r\n*Steps to reproduce:* \r\n1. Create a sample classic app \r\n2. Place the attached app.js code in the app.js file \r\n3. Run the app on the android device \r\n4. Click on \"change the second view\" label and observe the shadow for the second view. \r\n\r\n*Test Code:*\r\n app.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#EAEAEA',\r\n\tlayout : 'vertical'\r\n});\r\nvar secondWinLbl = Ti.UI.createLabel({\r\n\ttop : 30,\r\n\ttext : 'change the second view',\r\n\tcolor : 'black'\r\n});\r\nwin.add(secondWinLbl);\r\nfunction getView() {\r\n\t//Create a container view\r\n\tvar container = Ti.UI.createView({\r\n\t\t\tlayout : 'vertical',\r\n\t\t\twidth : '95%',\r\n\t\t\theight : 50, //Ti.UI.SIZE,\r\n\t\t\ttop : 10,\r\n\t\t\tborderRadius : 5,\r\n\t\t\tbackgroundColor : 'white',\r\n\t\t\tviewShadowRadius : 3,\r\n\t\t\tviewShadowColor : '#8AA0AE',\r\n\t\t\tviewShadowOffset : {\r\n\t\t\t\tx : 0,\r\n\t\t\t\ty : 4\r\n\t\t\t},\r\n\t\t\televation : 10\r\n\t\t});\r\n\tcontainer.add(Ti.UI.createLabel({\r\n\t\ttext : \"Here is some content\",\r\n\t\ttextAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\tcolor : \"#000\"\r\n\t}));\r\n\tcontainer.add(Ti.UI.createView({\r\n\t\theight : 1,\r\n\t\tborderWidth : 1,\r\n\t\ttop : 5,\r\n\t\tborderColor : 'red',\r\n\t\tid : 'titleline'\r\n\t}));\r\n\tcontainer.addEventListener('postlayout', function(e) {\r\n\t\tTi.API.info('in post layout');\r\n\t\te.source.applyProperties({\r\n\t\t\televation : 10\r\n\t\t});\r\n\t});\r\n\treturn container;\r\n}\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\ttop : 20,\r\n\tlayout : 'vertical',\r\n\theight : Ti.UI.FILL,\r\n\twidth : Ti.UI.FILL\r\n});\r\nscrollView.add(getView());\r\nvar v2 = getView();\r\nscrollView.add(v2);\r\nscrollView.add(getView());\r\nwin.add(scrollView);\r\nwin.open();\r\nsecondWinLbl.addEventListener('click', function() {\r\n\tv2.height = Ti.UI.SIZE;\r\n\tv2.add(Ti.UI.createView({\r\n\t\theight : 50,\r\n\t\ttop : 5,\r\n\t\twidth : '100%'\r\n\t}));\r\n});\r\n{code}\r\n*Test Environment:*\r\n7.0.1.GA Ti SDK and Appcelerator Command-Line Interface, version 7.0.0 \r\n7.1.0.GA Ti SDK and Appcelerator Command-Line Interface, version 7.0.2 also \r\nThanks", "attachment": [ { "id": "65032", "filename": "demo.mp4", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-04-06T20:42:19.000+0000", "size": 2030174, "mimeType": "video/mp4" } ], "flagged": false, "summary": "Android: Elevation disappear on change of view dynamically", "creator": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Android", "comment": { "comments": [ { "id": "436665", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This looks like a bug on Google's end where it's not redrawing the elevation's shadow when the view resizes.\r\n\r\nThe view's elevation drop-shadow is always 1 frame behind. For example, if you rotate the app to landscape, notice that the drop-shadow is still using the previous portrait width. If you rotate back to portrait, the drop-shadow now uses landscape width and is drawn offscreen. It's always 1 frame behind.\r\n\r\nA work-around will have to be found.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-09T20:15:02.000+0000", "updated": "2018-04-09T20:15:02.000+0000" }, { "id": "436782", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've tested the code and was able to reproduce.\r\n\r\nRemoving the {{borderRadius}} property fixes the problem for me as a workaround. I've not been able to work around the issue by disabling/enabling the borderRadius temporary or wrapping the view again. \r\n\r\nBest workaround for now seems to be to add an extra view right after (with a tiny delay) with a small height (I used 1, 0.1 was too small to trigger a re-render)\r\n\r\nAltered code that doesn't show the issue\r\n\r\n{code:js}\r\nsecondWinLbl.addEventListener('click', function() {\r\n v2.height = Ti.UI.SIZE;\r\n v2.add(Ti.UI.createView({\r\n height : 50,\r\n top : 4,\r\n width : '100%'\r\n }));\r\n setTimeout(function(){\r\n v2.add(Ti.UI.createView({\r\n height : 1,\r\n top : 0,\r\n width : '100%'\r\n }));\r\n },10);\r\n});\r\n{code}", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-11T14:08:08.000+0000", "updated": "2018-04-11T14:08:08.000+0000" }, { "id": "436805", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~topener] is right. If I comment out the \"borderRadius\" property from the test code [~mrahman] gave us, then it works-around the issue.\r\n\r\nOur \"borderRadius\" uses Google's Java {{Canvas.clipPath()}} feature, which has been proven to be notoriously buggy on Google's end. Google typically displays UI with rounded corners via a 9-patch background image instead, like how it works with buttons. But unfortunately this is an Android only feature.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-11T19:35:26.000+0000", "updated": "2018-04-11T19:35:26.000+0000" }, { "id": "436835", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~jquick], Thanks for the information. We have provided this solution to the customer and waiting for his reply.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-04-12T16:29:57.000+0000", "updated": "2018-04-12T16:29:57.000+0000" }, { "id": "451529", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "Investigating the issue, I found that changing the container to CardView works around the issue. I will keep looking for a solution for the default View class..", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-09-20T15:11:49.000+0000", "updated": "2019-09-20T15:11:49.000+0000" }, { "id": "452046", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looks like the outline is not being invalidated when the child views are changed. We can do something like this:\r\n\r\n*TiBorderWrapperView.java*\r\n{code:java}\r\n@Override\r\npublic void onDescendantInvalidated(View child, View target) {\r\n\t\t\r\n\t// Also invalidate outline to recalculate drop shadow.\r\n\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\r\n\t\tinvalidateOutline();\r\n\t}\r\n\tsuper.onDescendantInvalidated(child, target);\r\n}\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-10-14T21:37:59.000+0000", "updated": "2019-10-14T21:37:59.000+0000" }, { "id": "452060", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "Thanks for checking it out!\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/11280\r\n\r\n", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-10-15T14:08:18.000+0000", "updated": "2019-10-15T14:08:18.000+0000" }, { "id": "453166", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-12T14:43:59.000+0000", "updated": "2019-12-12T14:43:59.000+0000" }, { "id": "453199", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.0.0", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-12-16T18:45:00.000+0000", "updated": "2019-12-16T18:45:00.000+0000" }, { "id": "453440", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version {{9.0.0.v20200103081513}}. \r\n\r\nTest and other information can be found at:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/11280", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-06T15:54:26.000+0000", "updated": "2020-01-06T15:54:26.000+0000" }, { "id": "453526", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR (8_3_X): https://github.com/appcelerator/titanium_mobile/pull/11424", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2020-01-09T15:35:55.000+0000", "updated": "2020-01-09T15:35:55.000+0000" }, { "id": "453530", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed for 8_3_X. Waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T16:26:48.000+0000", "updated": "2020-01-09T16:26:48.000+0000" }, { "id": "453534", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to 8_3_X for 8.3.1", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-01-09T16:41:22.000+0000", "updated": "2020-01-09T16:41:22.000+0000" }, { "id": "453630", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix in SDK version 8.3.1.v20200110021712\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T11:17:03.000+0000", "updated": "2020-01-10T11:17:03.000+0000" }, { "id": "454444", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Removing from fixVersion 9.0.0 as this shipped in 8.3.1.GA", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-02-26T10:57:08.000+0000", "updated": "2020-02-26T10:57:08.000+0000" } ], "maxResults": 21, "total": 21, "startAt": 0 } } }