{ "id": "175374", "key": "TIMOB-28048", "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": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "resolution": null, "resolutiondate": null, "created": "2020-07-25T01:09:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "refreshcontrol", "tableview" ], "versions": [], "issuelinks": [ { "id": "58576", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "171574", "key": "TIMOB-25991", "fields": { "summary": "Android: RefreshControl in ListView only works when dragging content", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-11-20T00:24:57.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": "*Problem:*\r\nWhen creating a TableView with a RefreshControl you can only drag the view down when you drag&drop the content. If you TableView is empty you don't have any handle to drag.\r\n\r\n*Code*\r\n{code:java}\r\nfunction appendRowTo(tableView) {\r\n\tif (!tableView.refreshCount) {\r\n\t\ttableView.refreshCount = 1;\r\n\t} else {\r\n\t\ttableView.refreshCount++;\r\n\t}\r\n\ttableView.appendRow(Ti.UI.createTableViewRow({\r\n\t\ttitle: `Refresh ${tableView.refreshCount}`\r\n\t}));\r\n}\r\n\r\nconst window = Ti.UI.createWindow({ fullscreen: true });\r\nconst refreshControl = Ti.UI.createRefreshControl({\r\n\ttitle: Ti.UI.createAttributedString({ text: 'Refreshing' })\r\n});\r\nrefreshControl.addEventListener('refreshstart', e => {\r\n\tTi.API.info('@@@ \\'refreshstart\\' event received.');\r\n\tsetTimeout(function() {\r\n\t\tif (tableView.refreshControl) {\r\n\t\t\tappendRowTo(tableView);\r\n\t\t\trefreshControl.endRefreshing();\r\n\t\t}\r\n\t}, 2000);\r\n});\r\nrefreshControl.addEventListener('refreshend', e => {\r\n\tTi.API.info('@@@ \\'refreshend\\' event received.');\r\n\tif (refreshControl.tintColor === 'red') {\r\n\t\trefreshControl.tintColor = 'green';\r\n\t} else if (refreshControl.tintColor === 'green') {\r\n\t\trefreshControl.tintColor = 'blue';\r\n\t} else {\r\n\t\trefreshControl.tintColor = 'red';\r\n\t}\r\n\trefreshControl.title = Ti.UI.createAttributedString({ text: refreshControl.tintColor });\r\n});\r\n\r\nconst tableView = Ti.UI.createTableView({\r\n\trefreshControl: refreshControl,\r\n\tdata: [Ti.UI.createTableViewSection({ headerTitle: 'TableView' })],\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n\theaderView: Ti.UI.createLabel({\r\n\t\ttext: 'Table Header',\r\n\t\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\tcolor: 'white',\r\n\t\tbackgroundColor: 'blue',\r\n\t\twidth: Ti.UI.FILL,\r\n\t}),\r\n\tfooterView: Ti.UI.createLabel({\r\n\t\ttext: 'Table Footer',\r\n\t\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\tcolor: 'white',\r\n\t\tbackgroundColor: 'blue',\r\n\t\twidth: Ti.UI.FILL,\r\n\t}),\r\n});\r\ntableView.appendRow(Ti.UI.createTableViewRow({ title: '' }));\r\n\r\nwindow.add(tableView);\r\nwindow.open();\r\n{code}\r\n\r\nDragging below the TableView won't show the RefreshControl it will only work when you start dragging on the row.\r\n\r\n*What to expect*\r\nThe whole TableView space (in the example Ti.UI.FILL) should work as a drag area. Otherwise you can't use it with an empty TableView.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: RefreshControl in TableView only works when dragging content", "creator": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "456230", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/11556", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-25T01:14:42.000+0000", "updated": "2020-07-25T01:14:42.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }