{ "id": "100321", "key": "TIMOB-11820", "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": "15093", "description": "2013 Sprint 03 Core", "name": "2013 Sprint 03 Core", "archived": true, "released": true, "releaseDate": "2013-02-11" }, { "id": "14813", "description": "2013 Sprint 03", "name": "2013 Sprint 03", "archived": true, "released": true, "releaseDate": "2013-02-11" }, { "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-14T23:35:03.000+0000", "created": "2012-09-01T02:36:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "module_scrollableview", "qe-testadded" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" } ], "issuelinks": [ { "id": "23061", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "92678", "key": "TIMOB-9341", "fields": { "summary": "Android: Support Scroll View canCancelEvents", "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": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "23060", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "95041", "key": "TIMOB-9955", "fields": { "summary": "Android: ScrollView with a wrap view becomes unscrollable on android Ti 2.1", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-02-11T09:45:45.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": "h1. Description of the problem\r\n\r\nWhen a ScrollableView is added inside a ScrollView, all of the scroll events will be captured by the ScrollView. This makes the ScrollableView difficult to scroll.\r\n\r\nh1. Steps to reproduce\r\n\r\nUse the following code to reproduce the problem: trying to scroll through the ScrollableView screens does not work as it should.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar scroll = Ti.UI.createScrollView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: 'orange',\r\n contentHeight: '2000',\r\n contentWidth: 'auto',\r\n layout: 'vertical'\r\n});\r\n\r\n\r\nvar v1 = Ti.UI.createView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: 'blue'\r\n});\r\n\r\nvar v2 = Ti.UI.createView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: 'green'\r\n});\r\n\r\nvar v3 = Ti.UI.createView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: 'red'\r\n});\r\n\r\n\r\nvar v4 = Ti.UI.createView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: 'purple'\r\n});\r\n\r\nvar scrollable = Ti.UI.createScrollableView({\r\n height: 300,\r\n width: 400,\r\n backgroundColor: 'pink',\r\n views: [v1,v2,v3,v4]\r\n});\r\n\r\nscroll.add(scrollable);\r\n\r\nwin.add(scroll);\r\n{code} \r\n", "attachment": [], "flagged": false, "summary": "Android: ScrollableView in ScrollView is not working", "creator": { "name": "denniswong34", "key": "denniswong34", "displayName": "wong ka ming", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "denniswong34", "key": "denniswong34", "displayName": "wong ka ming", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Android Google API 4.03, Titanium 2.1.2", "comment": { "comments": [ { "id": "227888", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{quote}\ncanCancelEvents : Boolean\nDetermines whether this scroll view can cancel subview touches in order to scroll instead.\n\nSet to false to ensure that subview touches always take effect.\n\nDefault: true\n{quote}", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-19T18:11:17.000+0000", "updated": "2012-11-19T18:11:17.000+0000" }, { "id": "227996", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "@Max: this doesn't really work in this case. Although setting canCancelEvents to false makes the ScrollableView working perfectly, the ScrollView behind it stops to react to any touch event - as they are prevented by the property. In particular, if I touch an \"empty\" space of the ScrollView, everything goes well, but if I touch any other view (a button, a label, a transparent container etc.), the scroll isn't captured.\n\nBelow an updated sample code that shows what I mean:\n\n{code}\nvar win = Ti.UI.createWindow();\nwin.open();\n\nvar scroll = Ti.UI.createScrollView({\n height: Ti.UI.FILL,\n width: Ti.UI.FILL,\n backgroundColor: 'orange',\n contentHeight: '2000',\n contentWidth: 'auto',\n layout: 'vertical',\n canCancelEvents: false\n});\n\n\nvar v1 = Ti.UI.createView({\n height: Ti.UI.FILL,\n width: Ti.UI.FILL,\n backgroundColor: 'blue'\n});\n\nvar v2 = Ti.UI.createView({\n height: Ti.UI.FILL,\n width: Ti.UI.FILL,\n backgroundColor: 'green'\n});\n\nvar v3 = Ti.UI.createView({\n height: Ti.UI.FILL,\n width: Ti.UI.FILL,\n backgroundColor: 'red'\n});\n\n\nvar v4 = Ti.UI.createView({\n height: Ti.UI.FILL,\n width: Ti.UI.FILL,\n backgroundColor: 'purple'\n});\n\nvar scrollable = Ti.UI.createScrollableView({\n height: 300,\n width: 400,\n backgroundColor: 'pink',\n views: [v1,v2,v3,v4]\n});\n\nvar bottomView = Ti.UI.createView({\n backgroundColor: 'white',\n top: 50,\n left: 0,\n right: 0,\n height: 600\n});\n\nscroll.add(scrollable);\nscroll.add(bottomView);\n\nwin.add(scroll);\n{code}\n\nI do have the ScrollableView on top (blue background), which just works seamlessly, but I cannot scroll down unless I touch the very little orange line between the ScrollableView and another View below it (left 50px on purpose in this example).", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-20T13:29:46.000+0000", "updated": "2012-11-20T13:29:46.000+0000" }, { "id": "228000", "author": { "name": "m.mader", "key": "m.mader", "displayName": "M Mader", "active": true, "timeZone": "Europe/Berlin" }, "body": "The same applies for MapView inside ScrollView and can be fixed by extending the native Android class for this view and adding this code:\r\n\r\n{code}\r\n@Override\r\npublic boolean onTouchEvent(MotionEvent ev) {\r\n int action = ev.getAction();\r\n switch (action) {\r\n case MotionEvent.ACTION_DOWN:\r\n // Disallow ScrollView to intercept touch events.\r\n this.getParent().requestDisallowInterceptTouchEvent(true);\r\n break;\r\n\r\n case MotionEvent.ACTION_UP:\r\n // Allow ScrollView to intercept touch events.\r\n this.getParent().requestDisallowInterceptTouchEvent(false);\r\n break;\r\n }\r\n\r\n // Handle MapView's touch events.\r\n super.onTouchEvent(ev);\r\n return true;\r\n}\r\n{code}\r\n\r\nMaybe this could be implemented and be enabled/disabled via a property?", "updateAuthor": { "name": "m.mader", "key": "m.mader", "displayName": "M Mader", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-20T14:20:55.000+0000", "updated": "2012-11-20T14:20:55.000+0000" }, { "id": "228108", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "We seem to have an even bigger problem in Titanium 3.0, in the sense that even with canCancelEvents: false, it's almost impossible to scroll the scrollableview now. I've traced that problem to this commit: https://github.com/appcelerator/titanium_mobile/commit/533f6d187c \r\n\r\nWe'll no doubt have some parity issues to work out as well. My impression of using iOS on an iPhone _simulator_ is that it \"just works\" even without setting \"canCancelEvents\" at all (which means leaving it at its \"true\" default, I take it.)", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-20T23:54:56.000+0000", "updated": "2012-11-20T23:55:14.000+0000" }, { "id": "230484", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have a PR for this that will essentially block touch events to the scroll view from a scrollable view. You do no need to use 'canCancelEvents' to achieve this, so please test with the original test case.\n\nhttps://github.com/appcelerator/titanium_mobile/pull/3558\n\nThis PR also contains changes for the 'canCancelEvents' property, which should be tested against TIMOB-9955. The behavior for 'canCancelEvents' may be different in iOS since it's a native property there and I have updated the docs to say this as well.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T23:13:20.000+0000", "updated": "2012-12-07T23:13:20.000+0000" }, { "id": "234553", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "This ticket has been pushed back about 3 sprints now. Is there an ETA when it will actually be merged in?", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-16T05:55:10.000+0000", "updated": "2013-01-16T05:55:10.000+0000" }, { "id": "239631", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "ScrollableView is now easy to scroll.\r\nEnvironment used for verification -\r\nTitanium SDK: 3.1.0.v20130223030327\r\nTitanium  Studio:3.0.2.201302141201\r\nDevice : Nexus 7 Android 4.1", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-25T10:37:05.000+0000", "updated": "2013-02-25T10:37:05.000+0000" }, { "id": "262454", "author": { "name": "psrivastava", "key": "psrivastava", "displayName": "Priti Srivastava", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Using SDK 3.1.1 with Alloy project, when I tried test code that has ScrollableView inside ScrollView, I get 2 different behaviors mentioned below:\n\n1. Creating controls in controller -> I tested the code snippet provided in the JIRA ticket you mentioned, on Alloy controller, the scrollable view works fine. But, another big problem is that ScrollView does not respond if you swipe up/down direction initiating touch from scrollable view.\n\n2. Creating controls in XML -> Scrollable view does not swipes smoothly and works only if swipe direction is horizontal. In an angular motion on scrollableview, scrollView starts scrolling. In this approach ScrollView has expected behavior while swiping up/down directions.\n\nAttached herewith both the code snippets.\n\n", "updateAuthor": { "name": "psrivastava", "key": "psrivastava", "displayName": "Priti Srivastava", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T11:33:55.000+0000", "updated": "2013-07-19T11:33:55.000+0000" }, { "id": "262455", "author": { "name": "psrivastava", "key": "psrivastava", "displayName": "Priti Srivastava", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is the sample code:\n\n1. Creating controls in controller -> Used the original code in the issue and placed it in index.js\n\n2. Creating controls in XML ->\n\n\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n", "updateAuthor": { "name": "psrivastava", "key": "psrivastava", "displayName": "Priti Srivastava", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-19T11:36:31.000+0000", "updated": "2013-07-19T11:36:31.000+0000" }, { "id": "262462", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "Per Priti's comment above - this is still an issue.", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2013-07-19T14:18:34.000+0000", "updated": "2013-07-19T14:18:34.000+0000" }, { "id": "275077", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~psrivastava],\n\n1. This is expected behavior. As I mentioned before, for the android implementation, we block off all events to the scroll view from a scrollable view. This is why a vertical scroll inside a scrollable view won't affect the scroll view.\n\n2. In terms of scrolling not being smooth, this is native behavior. If you check out the demo at http://developer.android.com/training/animation/screen-slide.html, you get similar scrolling behavior. We just use the native ViewPager under the hood.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-14T23:34:56.000+0000", "updated": "2013-10-14T23:34:56.000+0000" }, { "id": "276280", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed.\n\nTiSDK 3.2.0.v20131022050844\nCLI 3.2.0\nTitanium Studio 3.2.0.201310181940\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-23T00:08:43.000+0000", "updated": "2013-10-23T00:08:43.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }