{ "id": "135340", "key": "TIMOB-17561", "fields": { "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": [], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2017-09-12T12:59:36.000+0000", "created": "2014-08-26T17:59:25.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "supportTeam" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [ { "id": "40254", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "125617", "key": "TIMOB-16344", "fields": { "summary": "Android: When adding swipe event to a tabGroup, the inside tableview's inside won't scroll nice. ", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2018-08-06T17:34:52.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": "h4. Problem Description\r\nI found that attaching a 'swipe' event handler to a tab group with the goal of allowing swiping left and right to change tabs is having the unintended side effect of preventing the native scroll behavior on a table view contained in the tab group on Android.\r\nNormally when you swipe down (fling) on a table view, there's some inertia and the table view keeps scrolling for a little bit. When there is a 'swipe' event handler on a tab group and you swipe down on a table view, as soon as you lift your finger off the screen the table view motion stops. There is no inertia. The scrolling stops as soon as the finger is lifted, making it hard to scroll through a long list.\r\niOS doesn't seem affected. The swipe handler works and native scroll works as expected.\r\n\r\nh4. Test Case\r\n{code}\r\n// create table view 1\r\nvar win1 = Ti.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n \r\nvar rows1 = [];\r\nfor(var i = 0; i < 50; i++) {\r\n rows1.push({ title: 'Row 1:' + i});\r\n}\r\n \r\nvar table1 = Titanium.UI.createTableView({\r\n data: rows1,\r\n width: 'auto',\r\n height: 'auto'\r\n});\r\n \r\nwin1.add(table1);\r\n \r\n// create table view 2\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n \r\nvar rows2 = [];\r\nfor(var i = 0; i < 50; i++) {\r\n rows2.push({ title: 'Row 2:' + i});\r\n}\r\n \r\nvar table2 = Titanium.UI.createTableView({\r\n data: rows2,\r\n width: 'auto',\r\n height: 'auto'\r\n});\r\n \r\nwin2.add(table2);\r\n \r\n// create tabgroup and tabs\r\nvar tabGroup = Ti.UI.createTabGroup();\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n \r\n// Event handler to change tab on left/right swipe\r\n// This is where the problem comes in.\r\n// Comment out the 'swipe' listener and normal table view scroll behavior will be back\r\ntabGroup.addEventListener('swipe', function(e) {\r\n var activeTabIndex = tabGroup.tabs.indexOf(tabGroup.activeTab);\r\n \r\n if(e.direction === 'right' && activeTabIndex > 0) {\r\n tabGroup.setActiveTab(activeTabIndex - 1);\r\n } else if(e.direction === 'left' && activeTabIndex < tabGroup.tabs.length - 1) {\r\n tabGroup.setActiveTab(activeTabIndex + 1);\r\n }\r\n // Is there something missing in this event handler to have native behavior when the swipe\r\n // direction is not left or right?\r\n});\r\n \r\n// open tab group\r\ntabGroup.open();\r\n{code}\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Classic Titanium)\r\n2. Paste the test case to app.js\r\n3. Run the sample into a device (Nexus 4)\r\n4. Scroll down and let the tableview roll (it usually continue to scroll until momentum is lost)\r\n5. The scroll will stop right away you stop. \r\n\r\nh4. Extra info\r\n\r\nQ&A: \r\n\r\nhttp://developer.appcelerator.com/question/161747/swipe-event-handler-prevents-native-table-view-scroll-behavior-on-android", "attachment": [], "flagged": false, "summary": "Android: When adding swipe event to a tabGroup, the inside tableview's inside won't scroll nice (parity issue)", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "Mobile SDK 3.3.0\r\nAndroid OS Version: 4.4\r\nDevice: Google Nexus 4", "closedSprints": [ { "id": 126, "state": "closed", "name": "2018 Sprint 05 SDK", "startDate": "2018-02-25T19:38:08.926Z", "endDate": "2018-03-11T18:38:00.000Z", "completeDate": "2018-03-11T22:06:01.520Z", "originBoardId": 100 } ], "comment": { "comments": [ { "id": "337958", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/6538\r\n\r\nFor test case, use the test case listed previously.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-01-06T07:47:19.000+0000", "updated": "2015-01-06T07:47:19.000+0000" }, { "id": "427794", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Resolving as {{Done}} since the Android TabGroup nowadays is capable to swipe out of the box.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-12T12:59:36.000+0000", "updated": "2017-09-12T12:59:36.000+0000" }, { "id": "439870", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closed as completed. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:34:52.000+0000", "updated": "2018-08-06T17:34:52.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }