{ "id": "175438", "key": "TIMOB-28082", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-03-05T15:57:37.000+0000", "created": "2020-08-13T23:35:17.000+0000", "epic": { "id": 175923, "key": "TIMOB-28298", "name": "Android: Material widget support", "summary": "Android: Material widget support", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "Low", "id": "4" }, "labels": [ "2020-Q4", "CardView", "android", "breaking-change", "material-theme", "theme" ], "versions": [], "issuelinks": [ { "id": "58628", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "174621", "key": "TIMOB-27714", "fields": { "summary": "Android: Add \"Material Components\" theme support", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-03-05T15:57:37.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\nOur [Ti.UI.Android.CardView|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android.CardView] is currently using the Java [androidx.cardview.widget.CardView|https://developer.android.com/reference/androidx/cardview/widget/CardView] class. It should be updated to use the newer [com.google.android.material.card.MaterialCardView|https://developer.android.com/reference/com/google/android/material/card/MaterialCardView] class. The newer class supports the material theme styles.\r\n\r\n*Outlined Card:*\r\nWe should also add \"outlined\" CardView support without a drop-shadow. This can be done be setting the {{elevation}} property to {{0}} and setting the {{borderColor}} and {{borderWidth}} properties as shown below.\r\n\r\n{code:javascript}\r\nconst window = Ti.UI.createWindow();\r\nconst cardView = Ti.UI.Android.createCardView({\r\n\televation: 0,\r\n\tborderColor: 'gray',\r\n\tborderWidth: 1,\r\n\tlayout: 'vertical',\r\n\tpadding: '16dp',\r\n\tleft: '10dp',\r\n\tright: '10dp',\r\n});\r\ncardView.add(Ti.UI.createLabel({\r\n\ttext: 'This is a card view.\\nThis is the 2nd line of text.',\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,\r\n\ttouchEnabled: false,\r\n\twidth: Ti.UI.FILL\r\n}));\r\nwindow.add(cardView);\r\nwindow.open();\r\n{code}\r\n\r\n !CardView-Outline-Light.png|thumbnail! !CardView-Outline-Dark.png|thumbnail! \r\n\r\n*To-Do:*\r\nWe must replace the Java class used here...\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java\r\n\r\n*Breaking-Change:*\r\nThe app must use a \"Theme.MaterialComponents\" based theme or else an exception will occur. So, app's using a custom theme based from \"Theme.AppCompat\" or similar will crash. This is normal and the exception will state that the theme will need to change.\r\n", "attachment": [ { "id": "67803", "filename": "CardView-Outline-Dark.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-23T02:21:19.000+0000", "size": 416826, "mimeType": "image/png" }, { "id": "67804", "filename": "CardView-Outline-Light.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-23T02:21:20.000+0000", "size": 417339, "mimeType": "image/png" }, { "id": "67802", "filename": "CardViewOutlineTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-23T02:20:40.000+0000", "size": 547, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Update \"CardView\" to support material theme", "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": "457938", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12353", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-19T10:02:33.000+0000", "updated": "2020-12-19T10:02:33.000+0000" }, { "id": "458332", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-03T21:50:08.000+0000", "updated": "2021-03-03T21:50:08.000+0000" }, { "id": "458351", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master and 10_0_X for 10.0.0 release target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-03-05T15:57:33.000+0000", "updated": "2021-03-05T15:57:33.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }