{ "id": "113436", "key": "TIMOB-13686", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "111847", "key": "TIMOB-13245", "fields": { "summary": "Android: Implement ListView Phase 2", "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": "Critical", "id": "1" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "15699", "description": "2013 Sprint 21", "name": "2013 Sprint 21", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "15700", "description": "2013 Sprint 21 API", "name": "2013 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-10-17T21:38:52.000+0000", "created": "2013-04-26T17:16:29.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "47559", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "113356", "key": "TIMOB-13693", "fields": { "summary": "TiAPI: ListView: add setSeparatorColor", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T22:26:20.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": "Implementing the remaining ListView v2 features (excluding search and pull to refresh):\r\n1. ListView header/footerView\r\n2. ListSection header/footerView\r\n4. ListView properties: separatorColor\r\n5. ListItem properties: selectedBackgroundColor, selectedBackgroundImage, backgroundImage, backgroundGradient\r\n\r\nTesting steps:\r\n1. Test code for ListView header/footerView and separatorColor:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'blue', fullscreen: false});\r\n\r\nvar view1 = Ti.UI.createView({height: 100, backgroundColor: \"green\"});\r\nvar button = Ti.UI.createButton({title: \"click me\"});\r\nview1.add(button);\r\nbutton.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button1\");\r\n}); \r\n\r\nview1.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked headerView\");\r\n});\r\n\r\nvar view2 = Ti.UI.createView({height: 100, backgroundColor: \"blue\"});\r\nvar button2 = Ti.UI.createButton({title: \"click me\"});\r\nview2.add(button2);\r\nbutton2.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button2\");\r\n}); \r\n\r\nview2.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked footerView\");\r\n});\r\n\r\nvar section1 = Ti.UI.createListSection();\r\nvar list = Ti.UI.createListView({separatorColor: 'blue', headerView: view1, footerView: view2, backgroundColor: 'white', sections:[section1]});\r\nvar item = {properties: {title: \"hi\", backgroundColor: \"yellow\", backgroundSelectedColor: \"blue\", accessoryType: 1, image: \"appicon.png\", color: \"blue\", font: {fontSize: \"20sp\"} }};\r\naddItems(0, 20, item, section1);\r\nitem.properties.image = \"KS_nav_ui.png\";\r\nwin.add(list);\r\n \r\n \r\nwin.open();\r\n \r\nfunction addItems(index, count, item, section) {\r\n\tfor (var i = index; i < index + count; i++) {\r\n item.properties.title = \"Label \" + i;\r\n \tsection.appendItems([item]);\r\n }\r\n}\r\n\r\n{code}\r\n\r\n1. Run code, you should see headerView, footerView and blue separator lines.\r\n\r\nTest case for section header/footerView and listView header/footerView:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'yellow', fullscreen: false});\r\n \r\nvar view1 = Ti.UI.createView({height: '200dp', backgroundColor: \"green\"});\r\nvar button = Ti.UI.createButton({title: \"change height to 100dp\"});\r\nview1.add(button);\r\nbutton.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button1\");\r\n view1.height = '100dp';\r\n }); \r\n\r\nview1.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked headerView\");\r\n});\r\n \r\nvar view2 = Ti.UI.createView({height: '200dp', backgroundColor: \"red\"});\r\nvar button2 = Ti.UI.createButton({title: \"change height to 100dp\"});\r\nview2.add(button2);\r\nbutton2.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button2\");\r\n view2.height = '100dp';\r\n}); \r\n\r\nvar view3 = Ti.UI.createView({height: '100dp', backgroundColor: \"blue\"});\r\nvar button3 = Ti.UI.createButton({title: \"change height to 200dp\"});\r\nview3.add(button3);\r\nbutton3.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button3\");\r\n view3.height = '200dp';\r\n}); \r\n\r\nvar view4 = Ti.UI.createView({height: '100dp', backgroundColor: \"purple\"});\r\nvar button4 = Ti.UI.createButton({title: \"change height to 200dp\"});\r\nview4.add(button4);\r\nbutton4.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button4\");\r\n view4.height = '200dp';\r\n}); \r\nwin.open();\r\n\r\nvar section1 = Ti.UI.createListSection({headerView: view1, footerView: view2});\r\nvar list = Ti.UI.createListView({headerView: view3, footerView: view4, separatorColor: 'blue', backgroundColor: 'white', sections:[section1]});\r\nvar item = {properties: {title: \"hi\", backgroundColor: \"yellow\", backgroundSelectedColor: \"blue\", accessoryType: 1, image: \"appicon.png\", color: \"blue\", font: {fontSize: \"20sp\"} }};\r\naddItems(0, 20, item, section1);\r\nitem.properties.image = \"KS_nav_ui.png\";\r\n\r\nwin.add(list);\r\n\r\nfunction addItems(index, count, item, section) {\r\n for (var i = index; i < index + count; i++) {\r\n item.properties.title = \"Label \" + i;\r\n section.appendItems([item]);\r\n }\r\n}\r\n{code}\r\n1. Run code, make sure button's functionality is correct. Observe log for clicks.\r\n\r\n\r\nTest case for selectedBackgroundImage, selectedBackgroundColor, and backgroundGradient, backgroundImage\r\n{code}\r\nvar myTemplate1 = {\r\n properties: {\r\n backgroundColor: 'blue',\r\n height: '100sp'\r\n },\r\n childTemplates: [\r\n {\r\n type: 'Ti.UI.Label',\r\n bindId:'cellLabel',\r\n properties: {\r\n font: {fontSize: '12dp'},\r\n text: \"Hello\"\r\n }\r\n }]\r\n};\r\n\r\nvar section = Ti.UI.createListSection({headerTitle: \"Header 1\"});\r\nvar data = [];\r\n\r\nfor (var i = 0; i < 4; i++) {\r\n var item = {\r\n properties: {selectedBackgroundColor: \"green\"},\r\n \tcellLabel: {text: \"selectedBackgroundColor: green\"}\r\n };\r\n if (i == 1) {\r\n item.properties = {selectedBackgroundImage: \"appicon.png\"};\r\n \titem.cellLabel.text = \"selectedBackgroundImage: appicon\";\r\n } else if (i == 2) {\r\n item.properties = {\r\n \tbackgroundGradient: {\r\n \t\ttype: 'linear',\r\n \t\tstartPoint: { x: '0%', y: '50%' },\r\n \t\tendPoint: { x: '100%', y: '50%' },\r\n \t\tcolors: [ { color: 'red', offset: 0.0}, { color: 'blue', offset: 0.25 }, { color: 'red', offset: 1.0 } ],\r\n \t\t}\r\n \t};\r\n \titem.cellLabel.text = \"backgroundGradient\";\r\n } else if (i==3) {\r\n \titem.properties = {backgroundImage: \"KS_nav_ui.png\", selectedBackgroundImage: \"appicon.png\"};\r\n \titem.cellLabel.text = \"backgroundImage: KS_nav_ui, selectedBackgroundImage: appicon\";\r\n }\r\n data.push(item);\r\n}\r\n\r\nsection.setItems(data);\r\n\r\nvar listView = Ti.UI.createListView({defaultItemTemplate: 'myTemp', templates: {myTemp: myTemplate1}, backgroundColor: \"white\", sections: [section]});\r\n\r\nvar win = Ti.UI.createWindow();\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Implement remaining ListView v2 features (excluding search)", "creator": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "270761", "author": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "body": "What is the status of this? We really need all the listview features done. it is such a performance boost.", "updateAuthor": { "name": "dhaligas", "key": "dhaligas", "displayName": "Darren Haligas", "active": true, "timeZone": "America/Chicago" }, "created": "2013-09-11T16:13:57.000+0000", "updated": "2013-09-11T16:13:57.000+0000" }, { "id": "273259", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR #1: https://github.com/appcelerator/titanium_mobile/pull/4747 ", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-27T21:33:04.000+0000", "updated": "2013-09-27T21:33:04.000+0000" }, { "id": "273282", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Modified test code for step 1:\n{code}\nvar win = Ti.UI.createWindow({backgroundColor: 'blue', fullscreen: false});\nvar section1 = Ti.UI.createListSection();\n \nvar view1 = Ti.UI.createView({height: 100, backgroundColor: \"green\"});\nvar button = Ti.UI.createButton({title: \"turn on canScroll\"});\nview1.add(button);\nbutton.addEventListener('click', function(e) {\n Ti.API.log(\"you clicked on button1\");\n list.setCanScroll(true);\n}); \n \nview1.addEventListener('click', function(e) {\n Ti.API.log(\"you clicked headerView\");\n});\n \nvar view2 = Ti.UI.createView({height: 100, backgroundColor: \"blue\"});\nvar button2 = Ti.UI.createButton({title: \"turn off canScroll\"});\nview2.add(button2);\nbutton2.addEventListener('click', function(e) {\n Ti.API.log(\"you clicked on button2\");\n list.canScroll = false;\n}); \n \nview2.addEventListener('click', function(e) {\n Ti.API.log(\"you clicked footerView\");\n});\n \n \nvar list = Ti.UI.createListView({canScroll: false, separatorColor: 'blue', headerView: view1, footerView: view2, backgroundColor: 'white', sections:[section1]});\nvar item = {properties: {title: \"hi\", backgroundColor: \"yellow\", backgroundSelectedColor: \"blue\", accessoryType: 1, image: \"appicon.png\", color: \"blue\", font: {fontSize: \"20sp\"} }};\naddItems(0, 20, item, section1);\nitem.properties.image = \"KS_nav_ui.png\";\nwin.add(list);\n\nlist.addEventListener('itemclick', function(e){ \n alert(\n \"ItemId: \" + e.itemId + \"\\n\" +\n \"BindId: \" + e.bindId + \"\\n\" +\n \"Section Index: \" + e.sectionIndex + \", Item Index: \" + e.itemIndex\n ); \n});\n \n \nwin.open();\n \nfunction addItems(index, count, item, section) {\n for (var i = index; i < index + count; i++) {\n item.properties.title = \"Label \" + i;\n section.appendItems([item]);\n }\n}\n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-27T23:30:37.000+0000", "updated": "2013-09-27T23:30:37.000+0000" }, { "id": "273701", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case for changing the headerView property of the listview section:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'yellow', fullscreen: false});\r\n\r\nvar view0 = Ti.UI.createView({height: \"50dp\", backgroundColor: \"white\"});\r\n \r\nvar view1 = Ti.UI.createView({height: '200dp', backgroundColor: \"green\"});\r\nvar button = Ti.UI.createButton({title: \"change me\"});\r\nview1.add(button);\r\nbutton.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button1\");\r\n section1.headerView = view0;\r\n }); \r\n \r\nview1.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked headerView\");\r\n});\r\n \r\nvar view2 = Ti.UI.createView({height: '200dp', backgroundColor: \"red\"});\r\nvar button2 = Ti.UI.createButton({title: \"change height to 100dp\"});\r\nview2.add(button2);\r\nbutton2.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button2\");\r\n view2.height = '100dp';\r\n}); \r\n \r\nvar view3 = Ti.UI.createView({height: '100dp', backgroundColor: \"blue\"});\r\nvar button3 = Ti.UI.createButton({title: \"change height to 200dp\"});\r\nview3.add(button3);\r\nbutton3.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button3\");\r\n view3.height = '200dp';\r\n}); \r\n \r\nvar view4 = Ti.UI.createView({height: '100dp', backgroundColor: \"purple\"});\r\nvar button4 = Ti.UI.createButton({title: \"change height to 200dp\"});\r\nview4.add(button4);\r\nbutton4.addEventListener('click', function(e) {\r\n Ti.API.log(\"you clicked on button4\");\r\n view4.height = '200dp';\r\n}); \r\nwin.open();\r\n \r\nvar section1 = Ti.UI.createListSection({headerView: view1, footerView: view2});\r\nvar list = Ti.UI.createListView({headerView: view3, footerView: view4, separatorColor: 'blue', backgroundColor: 'white', sections:[section1]});\r\nvar item = {properties: {title: \"hi\", backgroundColor: \"yellow\", backgroundSelectedColor: \"blue\", accessoryType: 1, image: \"appicon.png\", color: \"blue\", font: {fontSize: \"20sp\"} }};\r\naddItems(0, 20, item, section1);\r\n\r\n \r\nwin.add(list);\r\n \r\nfunction addItems(index, count, item, section) {\r\n for (var i = index; i < index + count; i++) {\r\n item.properties.title = \"Label \" + i;\r\n section.appendItems([item]);\r\n }\r\n}\r\n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T23:54:27.000+0000", "updated": "2013-10-02T23:57:14.000+0000" }, { "id": "275369", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR for selectedBackgroundColor/Image: https://github.com/appcelerator/titanium_mobile/pull/4783", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-17T00:24:15.000+0000", "updated": "2013-10-17T00:24:15.000+0000" }, { "id": "413347", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T22:26:20.000+0000", "updated": "2017-03-16T22:26:20.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }