{ "id": "152342", "key": "TIMOB-19796", "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": "17072", "name": "Release 5.1.2", "archived": false, "released": true, "releaseDate": "2016-01-12" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-12-01T02:30:49.000+0000", "created": "2015-10-26T15:04:02.000+0000", "epic": { "id": 134539, "key": "TIMOB-17487", "name": "Android: Support Android-L Functionality", "summary": "Android: Support Android 5.0 Functionality", "color": { "key": "color_7" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [ { "id": "49890", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "152371", "key": "TIMOB-19801", "fields": { "summary": "Android: CardView causes crash when cardCornerRadius AND backgroundColor are set", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "49891", "type": { "id": "10120", "name": "Gantt: finish-start", "inward": "has to be done after", "outward": "has to be done before" }, "outwardIssue": { "id": "152575", "key": "TIMOB-19843", "fields": { "summary": "Android: CardView's cardMaxElevation should (marked as) be creation-only", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "49893", "type": { "id": "10120", "name": "Gantt: finish-start", "inward": "has to be done after", "outward": "has to be done before" }, "outwardIssue": { "id": "152372", "key": "TIMOB-19802", "fields": { "summary": "Android: CardView should use standard property names", "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": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "49892", "type": { "id": "10120", "name": "Gantt: finish-start", "inward": "has to be done after", "outward": "has to be done before" }, "outwardIssue": { "id": "152573", "key": "TIMOB-19842", "fields": { "summary": "Android: CardView cardPreventCornerOverlap and cardUseCompatPadding should not start with card", "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": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2015-12-02T20:14:39.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 new {{Ti.UI.CardView}} is [documented|https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.Android.CardView-property-layout] to support the {{layout}} property - as one would expect - but it does not behave as expected.\r\n\r\nThe following sample code and attached screenshot demonstrates that none of the {{layout}} values work and that whatever mechanism is used by default is not composite since the labels are aligned top left instead of the expected centre. The first card has a view to wrap the labels to show what I'd expect for the other vertical-card to be like. However, there as well is shows that thew view is not filling up the parent as it normally does.\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nfunction createCard(layout, wrap) {\r\n\r\n\tvar card = Ti.UI.Android.createCardView({\r\n\t\ttop: 20,\r\n\t\twidth: Ti.UI.FILL,\r\n\t\theight: 160,\r\n\r\n\t\tlayout: layout\r\n\t});\r\n\r\n\tvar view;\r\n\r\n\tif (wrap) {\r\n\r\n\t\tview = Ti.UI.createView({\r\n\t\t\tlayout: layout\r\n\t\t});\r\n\r\n\t\tcard.add(view);\r\n\r\n\t} else {\r\n\t\tview = card;\r\n\t}\r\n\r\n\tview.add(Ti.UI.createLabel({\r\n\t\twidth: 50,\r\n\t\theight: 100,\r\n\t\tbackgroundColor: 'green',\r\n\t\ttext: (wrap ? 'reference' : layout) + ' in green'\r\n\t}));\r\n\r\n\tview.add(Ti.UI.createLabel({\r\n\t\ttop: 10,\r\n\t\twidth: 100,\r\n\t\theight: 50,\r\n\t\tbackgroundColor: 'red',\r\n\t\ttext: (wrap ? 'reference' : layout) + ' in red'\r\n\t}));\r\n\r\n\treturn card;\r\n}\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\tlayout: 'vertical'\r\n});\r\n\r\nscrollView.add(createCard('vertical', true));\r\nscrollView.add(createCard('composite'));\r\nscrollView.add(createCard('vertical'));\r\nscrollView.add(createCard('horizontal'));\r\n\r\nwin.add(scrollView);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "57134", "filename": "android_20151026-160006.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-10-26T15:03:53.000+0000", "size": 57728, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: CardView Layout property not working as expected", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.0.v20151019145227", "closedSprints": [ { "id": 529, "state": "closed", "name": "2015 Sprint 24 SDK", "startDate": "2015-11-21T01:30:12.670Z", "endDate": "2015-12-05T01:30:00.000Z", "completeDate": "2015-12-07T03:57:17.094Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "367810", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] I see you did the CardView implementation. I have some other issues I ran into with the 5.1.0 sample app as well. Shall I assign them to you directly?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-10-26T15:27:29.000+0000", "updated": "2015-10-26T15:27:29.000+0000" }, { "id": "367908", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~fokkezb] Go ahead and assign it to me.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-10-27T01:59:41.000+0000", "updated": "2015-10-27T01:59:41.000+0000" }, { "id": "368622", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] I'm working on the 5.1.0 sample app but layout inside card views is very hard to work with atm since it doesn't work as in regular views. Any ideas how to fix this yet?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-02T12:34:00.000+0000", "updated": "2015-11-02T12:34:00.000+0000" }, { "id": "368754", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "I'm currently working on this. \r\n[~fokkezb] Does putting a view inside the cardview and working with that view instead help as a workaround for now?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-03T03:41:35.000+0000", "updated": "2015-11-03T03:41:35.000+0000" }, { "id": "368781", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~msamah] no, a View in a CardView is not a sufficient workaround because there is no way to make the View take up all of the content size of the card; not by setting {{width}} to {{100%}} or {{Ti.UI.FILL}} (which is the default of course) nor by setting {{left}} and {{right}} to {{0}}.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-03T07:29:14.000+0000", "updated": "2015-11-03T07:29:14.000+0000" }, { "id": "368782", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Just play with https://github.com/appcelerator-developer-relations/appc-sample-ti510 and you'll see.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-03T07:29:47.000+0000", "updated": "2015-11-03T07:29:47.000+0000" }, { "id": "369076", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "If we can make the view take up all space and have the expected layout behaviour for its children then we have 2 options:\r\n\r\n# Add this wrapping view ourselves and forwarding relevant properties set on the card view (backgroundColor, layout..) to the wrapping view. \r\n# Remove the {{add/remove/..}} methods and instead have a {{contentView}} property so it is clear it needs a single view - just like we do for [PopOver|https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.iPad.Popover-property-contentView]\r\n\r\nI'd say nr 2.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-05T09:30:07.000+0000", "updated": "2015-11-05T09:30:07.000+0000" }, { "id": "370665", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Master PR: https://github.com/appcelerator/titanium_mobile/pull/7466\r\nTest code in PR.\r\n\r\n[~fokkezb] Feel free to test this out. I'm using the option 1 suggested by you. The cardview will handle the view that is added to it. In this case, TiCompositeLayout is added as a child which is transparent to the user.\r\n\r\n5.1.X PR will be added later once this is okay.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-18T07:15:54.000+0000", "updated": "2015-11-18T07:17:44.000+0000" }, { "id": "370685", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Verified fixed!", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-18T12:37:01.000+0000", "updated": "2015-11-18T12:37:01.000+0000" }, { "id": "371724", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR reviewed and merged.\r\n\r\nWill make 5_1_X backport.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-01T02:01:07.000+0000", "updated": "2015-12-01T02:01:07.000+0000" }, { "id": "371726", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "5_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/7515", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-01T02:12:05.000+0000", "updated": "2015-12-01T02:12:05.000+0000" }, { "id": "371729", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Backport 5_1_X merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-01T02:30:43.000+0000", "updated": "2015-12-01T02:30:43.000+0000" }, { "id": "371954", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nUsed the code in the description.\r\nThe cardView layout property works as expected.\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.4.0.201511241829\r\nTi SDK : 5.1.2.v20151202061227\r\nTi CLI : 5.0.5\r\nAlloy : 1.7.26\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.2\r\nAppc CLI : 5.1.0\r\nNode: v0.12.27\r\nNexus 6P - Android 6.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-12-02T20:14:25.000+0000", "updated": "2015-12-02T20:14:25.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }