{ "id": "125617", "key": "TIMOB-16344", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-01-31T19:21:22.000+0000", "created": "2014-01-30T01:39:13.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "supportTeam" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "40254", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "135340", "key": "TIMOB-17561", "fields": { "summary": "Android: When adding swipe event to a tabGroup, the inside tableview's inside won't scroll nice (parity issue)", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-23T22:42:18.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. ", "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.2.0\r\nAndroid OS Version: 4.4\r\nDevice: Google Nexus 4", "comment": { "comments": [ { "id": "290476", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The swipe event is eating the scroll event. This is expected behavior with the current Android architecture. Swipe event is not recommended to use along with a scrollable widget.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-30T19:32:52.000+0000", "updated": "2014-01-30T19:32:52.000+0000" }, { "id": "290674", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as won't fix. Please create a new feature request.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-31T19:21:14.000+0000", "updated": "2014-01-31T19:21:14.000+0000" }, { "id": "415485", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as Won't Fix with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T22:42:18.000+0000", "updated": "2017-03-23T22:42:18.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }