{ "id": "171466", "key": "TIMOB-25939", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-04-18T00:25:37.000+0000", "created": "2018-04-05T21:53:34.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ScrollView", "android", "refreshcontrol" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-21T21:35:14.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\nWhen a horizontal {{ScrollView}} has been assigned a {{RefreshControl}}, it is difficult to scroll it horizontally. While scrolling it horizontally, if you slightly drag your finger up/down, the {{RefreshControl}} will then cancel horizontal scrolling and then steal/intercept all touch events.\r\n\r\n*Steps to Reproduce:*\r\n# Build and run the below code on Android.\r\n# Start dragging the {{ScrollView}} horizontally.\r\n# As you drag it horizontally, drag down without lifting your finger from the screen.\r\n# Notice that the {{RefreshControl}} progress circle is being pulled down by your finger.\r\n# As you drag down, attempt to drag horizontally without lifting your finger from the screen.\r\n# Notice that you can no longer scroll the {{ScrollView}} horizontally anymore.\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow(\r\n{\r\n\tfullscreen: true,\r\n\tlayout: \"vertical\",\r\n\tbackgroundColor: \"white\",\r\n});\r\nvar refreshControl = Ti.UI.createRefreshControl(\r\n{\r\n\ttitle: Ti.UI.createAttributedString({ text: \"Refreshing\" }),\r\n\ttintColor: \"red\",\r\n});\r\nrefreshControl.addEventListener(\"refreshstart\", function(e) {\r\n\tTi.API.info(\"@@@ 'refreshstart' event received.\");\r\n\tsetTimeout(function() {\r\n\t\tif (!scrollView.refreshCount) {\r\n\t\t\tscrollView.refreshCount = 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tscrollView.refreshCount++;\r\n\t\t}\r\n\t\tscrollView.add(Ti.UI.createLabel(\r\n\t\t{\r\n\t\t\ttext: \"Refresh \" + scrollView.refreshCount.toString(),\r\n\t\t\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\t\tcolor: \"white\",\r\n\t\t\tbackgroundColor: \"gray\",\r\n\t\t\tleft: \"5dp\",\r\n\t\t}));\r\n\t\trefreshControl.endRefreshing();\r\n\t}, 2000);\r\n});\r\nvar scrollView = Ti.UI.createScrollView(\r\n{\r\n\trefreshControl: refreshControl,\r\n\tlayout: \"horizontal\",\r\n\tscrollType: \"horizontal\",\r\n\tshowVerticalScrollIndicator: false,\r\n\tshowHorizontalScrollIndicator: true,\r\n\twidth: Ti.UI.FILL,\r\n\theight: \"90%\",\r\n});\r\nscrollView.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"Pull\\nDown\\nto\\nRefresh\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tcolor: \"white\",\r\n\tbackgroundColor: \"black\",\r\n\theight: Ti.UI.FILL,\r\n}));\r\nfor (var index = 1; index <= 10; index++) {\r\n\tscrollView.add(Ti.UI.createLabel(\r\n\t{\r\n\t\ttext: \"Label \" + index.toString(),\r\n\t\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\tcolor: \"white\",\r\n\t\tbackgroundColor: \"gray\",\r\n\t\tleft: \"5dp\",\r\n\t}));\r\n}\r\nwindow.add(scrollView);\r\nwindow.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"Horizontal ScrollView\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tcolor: \"white\",\r\n\tbackgroundColor: \"blue\",\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n*Expected Result:*\r\nOnce you start scrolling horizontally, you should not be able to pull down the {{RefreshControl}} progress circle. It should only allow horizontally scrolling. And if you start dragging vertically, it should only pull down the {{RefreshControl}} and not allow horizontal scrolling of the {{ScrollView}}. It should only be one or the other since it's too difficult for a person to drag perfectly horizontally or vertically.\r\n\r\n*Cause:*\r\nThis happens because Google's Java {{HorizontalScrollView}} class does not support nested scrolling. Google's {{SwipeRefreshLayout}} ignores a {{requestDisallowInterceptTouchEvent()}} method calls from child views that do not support nested scrolling, which causes it to intercept all touch events once you drag vertically.\r\n[SwipeRefreshLayout.java#L735|https://github.com/aosp-mirror/platform_frameworks_support/blob/master/core-ui/src/main/java/android/support/v4/widget/SwipeRefreshLayout.java#L735]\r\n\r\n*Note:*\r\nThis is not an issue with a vertical {{ScrollView}} using a {{RefreshControl}}. This is only an issue with a horizontal {{ScrollView}}.", "attachment": [], "flagged": false, "summary": "Android: Improve horizontal ScrollView scrolling that is set up with a RefreshControl", "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, "closedSprints": [ { "id": 1018, "state": "closed", "name": "2018 Sprint 07 SDK", "startDate": "2018-03-25T21:59:36.637Z", "endDate": "2018-04-08T21:59:00.000Z", "completeDate": "2018-04-08T17:55:14.467Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "436558", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9985", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-06T00:58:56.000+0000", "updated": "2018-04-06T00:58:56.000+0000" }, { "id": "436957", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-18T00:25:21.000+0000", "updated": "2018-04-18T00:25:21.000+0000" }, { "id": "438605", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.3.0.v20180618182516.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-21T21:35:08.000+0000", "updated": "2018-06-21T21:35:08.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }