{ "id": "102843", "key": "TIMOB-13301", "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": [ { "id": "15939", "description": "2014 Sprint 07", "name": "2014 Sprint 07", "archived": true, "released": true, "releaseDate": "2014-04-11" }, { "id": "15940", "description": "2014 Sprint 07 SDK", "name": "2014 Sprint 07 SDK", "archived": true, "released": true, "releaseDate": "2014-04-11" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-04-08T20:30:30.000+0000", "created": "2012-10-08T13:10:44.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "ios", "module_scrollableview", "qe-closed-3.3.0", "qe-testadded", "scrollableview" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-04-25T06:48:46.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "* on android setCurrentPage sets the page with animation.\r\nOn ios it doesnt.\r\n* movePrevious and moveNext should be implemented on iOS\r\n* it would be nice to be able to choose if scrollToView, moveNext, movePrevious happen with animation", "attachment": [ { "id": "46906", "filename": "app.js", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-27T21:23:04.000+0000", "size": 3176, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS: Add animation to scrollToView, moveNext, movePrevious on ScrollableView", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "titanium 3.0.0 master\r\nios sdk 6.0\r\nandroid 4.0.3", "comment": { "comments": [ { "id": "222881", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "pull request https://github.com/appcelerator/titanium_mobile/pull/3146\n{code}\nvar win = Titanium.UI.createWindow();\nwin.backgroundColor = '#ccc';\n\n// initialize to all modes\nwin.orientationModes = [Titanium.UI.PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT];\n\nvar view1 = Ti.UI.createView({\n\tbackgroundColor : 'red'\n});\nvar l1 = Ti.UI.createLabel({\n\ttext : 'View 1',\n\tcolor : '#fff',\n\twidth : 'auto',\n\theight : 'auto'\n});\nview1.add(l1);\n\nvar view2 = Ti.UI.createView({\n\tbackgroundColor : 'blue'\n});\nvar l2 = Ti.UI.createLabel({\n\ttext : 'Click Me (View 2 - see log)',\n\tcolor : '#fff',\n\twidth : 'auto',\n\theight : 'auto'\n});\nview2.add(l2);\n\nvar view3 = Ti.UI.createView({\n\tbackgroundColor : 'green'\n});\nvar l3 = Ti.UI.createLabel({\n\ttext : 'View 3',\n\tcolor : '#fff',\n\twidth : 'auto',\n\theight : 'auto'\n});\nview3.add(l3);\n\nvar view4 = Ti.UI.createView({\n\tbackgroundColor : 'black'\n});\nvar l4 = Ti.UI.createLabel({\n\ttext : 'View 4',\n\tcolor : '#fff',\n\twidth : 'auto',\n\theight : 'auto'\n});\nview4.add(l4);\n\nvar scrollView = Titanium.UI.createScrollableView({\n\tviews : [view1, view2, view3, view4],\n\tshowPagingControl : true,\n\tpagingControlHeight : 30,\n\tmaxZoomScale : 2.0,\n\tcurrentPage : 1\n});\n\nwin.add(scrollView);\n\nvar i = 1;\nvar activeView = view1;\n\nscrollView.addEventListener('scroll', function(e) {\n\tactiveView = e.view;\n\t// the object handle to the view that is about to become visible\n\ti = e.currentPage;\n\tTitanium.API.info(\"scroll called - current index \" + i + ' active view ' + activeView);\n});\nscrollView.addEventListener('click', function(e) {\n\tTi.API.info('ScrollView received click event, source = ' + e.source);\n});\nscrollView.addEventListener('touchend', function(e) {\n\tTi.API.info('ScrollView received touchend event, source = ' + e.source);\n});\n\n// add button to dynamically add a view\nvar add = Titanium.UI.createButton({\n\ttitle : 'Add',\n\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\nadd.addEventListener('click', function() {\n\tvar newView = Ti.UI.createView({\n\t\tbackgroundColor : 'purple'\n\t});\n\tvar l = Ti.UI.createLabel({\n\t\ttext : 'View ' + (scrollView.views.length + 1),\n\t\tcolor : '#fff',\n\t\twidth : 'auto',\n\t\theight : 'auto'\n\t});\n\tnewView.add(l);\n\tscrollView.addView(newView);\n});\n\n// jump button to dynamically change go directly to a page (non-animated)\nvar jump = Titanium.UI.createButton({\n\ttitle : 'Jump',\n\tstyle : Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\njump.addEventListener('click', function() {\n\ti = (scrollView.currentPage + 1) % scrollView.views.length;\n\tscrollView.currentPage = i;\n});\n\n// move scroll view left\nvar left = Titanium.UI.createButton({\n\tbackgroundColor : 'transparent',\n\ttitle : '<'\n});\nleft.addEventListener('click', function(e) {\n\tif (i === 0) {\n\t\treturn;\n\t}\n\ti--;\n\t// scrollView.scrollToView(i, true);///CHANGE THIS TO ANIMATE/NOT\n\t// scrollView.scrollToView(i, false);///CHANGE THIS TO ANIMATE/NOT\n\tscrollView.scrollToView(i);///CHANGE THIS TO ANIMATE/NOT\n});\n\n// move scroll view right\nvar right = Titanium.UI.createButton({\n\tbackgroundColor : 'transparent',\n\ttitle : '>'\n});\nright.addEventListener('click', function(e) {\n\tif (i === (scrollView.views.length - 1)) {\n\t\treturn;\n\t}\n\ti++;\n\t// scrollView.scrollToView(scrollView.views[i], true); ///CHANGE THIS TO ANIMATE/NOT\n\t// scrollView.scrollToView(scrollView.views[i], false); ///CHANGE THIS TO ANIMATE/NOT\n\tscrollView.scrollToView(scrollView.views[i]); ///CHANGE THIS TO ANIMATE/NOT\n});\nvar flexSpace = Titanium.UI.createButton({\n\tsystemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\n});\n\nvar toolbar = Titanium.UI.createView({\n\twidth : Ti.UI.FILL,\n\tlayout : 'horizontal',\n\theight : 40,\n\tbottom : 20,\n\tbackgroundColor : '#333333'\n});\n\nleft.left = add.left = jump.left = right.left = 10;\nleft.width = add.width = jump.width = right.width = 60;\n\ntoolbar.add(left);\ntoolbar.add(add);\ntoolbar.add(jump);\ntoolbar.add(right);\n\nwin.add(toolbar);\n\nwin.open();\n\n{code}", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-10-10T08:45:36.000+0000", "updated": "2012-10-10T08:45:36.000+0000" }, { "id": "228337", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "updated test case\n{code}\nvar win = Titanium.UI.createWindow();\nwin.backgroundColor = '#ccc';\n \n// initialize to all modes\nwin.orientationModes = [Titanium.UI.PORTRAIT, Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT];\n \nvar view1 = Ti.UI.createView({\n backgroundColor : 'red'\n});\nvar l1 = Ti.UI.createLabel({\n text : 'View 1',\n color : '#fff',\n width : 'auto',\n height : 'auto'\n});\nview1.add(l1);\n \nvar view2 = Ti.UI.createView({\n backgroundColor : 'blue'\n});\nvar l2 = Ti.UI.createLabel({\n text : 'Click Me (View 2 - see log)',\n color : '#fff',\n width : 'auto',\n height : 'auto'\n});\nview2.add(l2);\n \nvar view3 = Ti.UI.createView({\n backgroundColor : 'green'\n});\nvar l3 = Ti.UI.createLabel({\n text : 'View 3',\n color : '#fff',\n width : 'auto',\n height : 'auto'\n});\nview3.add(l3);\n \nvar view4 = Ti.UI.createView({\n backgroundColor : 'black'\n});\nvar l4 = Ti.UI.createLabel({\n text : 'View 4',\n color : '#fff',\n width : 'auto',\n height : 'auto'\n});\nview4.add(l4);\n \nvar scrollView = Titanium.UI.createScrollableView({\n views : [view1, view2, view3, view4],\n showPagingControl : false,\n scrollingEnabled:false,\n pagingControlHeight : 30,\n maxZoomScale : 2.0,\n currentPage : 1\n});\n \nwin.add(scrollView);\n \nvar i = 1;\nvar activeView = view1;\n \n// add button to dynamically add a view\nvar add = Titanium.UI.createButton({\n title : 'Add',\n height:40,\n width:100,\n style : Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\nadd.addEventListener('click', function() {\n var newView = Ti.UI.createView({\n backgroundColor : 'purple'\n });\n var l = Ti.UI.createLabel({\n text : 'View ' + (scrollView.views.length + 1),\n color : '#fff',\n width : 'auto',\n height : 'auto'\n });\n newView.add(l);\n scrollView.addView(newView);\n});\n \n// jump button to dynamically change go directly to a page (non-animated)\nvar jump = Titanium.UI.createButton({\n title : 'Jump',\n height:40,\n width:100,\n style : Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\njump.addEventListener('click', function() {\n i = (scrollView.currentPage + 1) % scrollView.views.length;\n scrollView.currentPage = i;\n});\n \n// move scroll view left\nvar left = Titanium.UI.createButton({\n backgroundColor : 'transparent',\n height:40,\n width:100,\n title : '<'\n});\nleft.addEventListener('click', function(e) {\n if (i === 0) {\n return;\n }\n i--;\n // scrollView.scrollToView(i, false);///CHANGE THIS TO ANIMATE/NOT\n scrollView.scrollToView(i, false);///CHANGE THIS TO ANIMATE/NOT\n});\n \n// move scroll view right\nvar right = Titanium.UI.createButton({\n backgroundColor : 'transparent',\n height:40,\n width:100,\n title : '>'\n});\nright.addEventListener('click', function(e) {\n if (i === (scrollView.views.length - 1)) {\n return;\n }\n i++;\n // scrollView.scrollToView(scrollView.views[i], false); ///CHANGE THIS TO ANIMATE/NOT\n scrollView.scrollToView(scrollView.views[i]); ///CHANGE THIS TO ANIMATE/NOT\n});\nvar flexSpace = Titanium.UI.createButton({\n systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\n});\n \nvar toolbar = Titanium.UI.createView({\n width : Ti.UI.FILL,\n layout : 'horizontal',\n height : 100,\n bottom : 20,\n backgroundColor : '#333333'\n});\n\nscrollView.addEventListener('swipe', function(e) {\n\tif (e.direction === 'left')\n\t{\n\t\tscrollView.moveNext();\n\t}\n\telse if (e.direction === 'right')\n\t{\n\t\tscrollView.movePrevious(false);\n\t}\n})\n\n\nvar deleteButton = Titanium.UI.createButton({\n backgroundColor : 'transparent',\n height:40,\n width:100,\n title : 'delete'\n});\ndeleteButton.addEventListener('click', function(e) {\n if (i === (scrollView.views.length - 1)) {\n return;\n }\n i++;\n // scrollView.removeView(scrollView.views[0]); ///CHANGE THIS TO ANIMATE/NOT\n scrollView.removeView(0); ///CHANGE THIS TO ANIMATE/NOT\n});\n\n \nleft.left = add.left = jump.left = right.left = 10;\nleft.width = add.width = jump.width = right.width = 60;\n \ntoolbar.add(left);\ntoolbar.add(add);\ntoolbar.add(jump);\ntoolbar.add(deleteButton);\ntoolbar.add(right);\n \nwin.add(toolbar);\n \nwin.open();\n{code}\n", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-11-22T15:52:25.000+0000", "updated": "2012-11-22T15:52:25.000+0000" }, { "id": "228338", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "pull request https://github.com/appcelerator/titanium_mobile/pull/3146", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-11-22T15:55:30.000+0000", "updated": "2012-11-22T15:55:30.000+0000" }, { "id": "278438", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "Hi, I am coding an Android InfiniteScrollableView widget for a project.\r\n\r\nThe widget works functionally in both directions, is optimised, is built using nothing but Ti framework code (unlike the other attempts I've found).\r\n\r\nThe only thing stopping this from being finished is the bug referred to by this ticket.\r\n\r\nSetting the current page using setCurrentPage should definitely NOT use animation.\r\n\r\nscrollToView, moveNext & movePrevious SHOULD use animation.\r\n\r\nThis is the most semantic solution.\r\n-----------------\r\n\r\nThere is a lot of community demand for a working InfiniteScrollableView widget so as an ultimatum I am offering to release the widget to the community along with an integration guide way ahead of schedule if this issue gets a 2013 fix date.\r\n\r\nYes, this is cheeky on my part. I'm well aware ;)", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-06T16:50:52.000+0000", "updated": "2013-11-06T16:50:52.000+0000" }, { "id": "278440", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-06T16:53:55.000+0000", "updated": "2013-11-06T16:53:55.000+0000" }, { "id": "278623", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "Hi Ingo, I see that the description for this issue has changed to just point to iOS.\r\n\r\nShould the fact that Android animates on setCurrentPage have it's own ticket?\r\n\r\nLee", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-07T09:13:18.000+0000", "updated": "2013-11-07T09:13:18.000+0000" }, { "id": "278647", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~lsdriscoll] So, to confirm for Android, it's the fact you can't choose to set the animation on or off that's the issue?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-07T16:45:33.000+0000", "updated": "2013-11-07T16:45:33.000+0000" }, { "id": "278652", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "Hi Ingo.\r\n\r\nFor my own project, yes that is the issue I have.\r\n\r\nPersonally I don't think that there should be a parameter passed to enable animation, just the following api:\r\n\r\n|setCurrentPage|no animation|\r\n|scrollToView|with animation|\r\n|moveNext|with animation|\r\n|movePrevious|with animation|\r\n\r\nMy reasoning for this is because I believe this to be the most semantic behaviour based on method names & it covers all developer requirements.\r\n\r\nmoveNext & movePrevious would simply be shorthand for view.scrollToView(view.currentPage++) and view.scrollToView(view.currentPage--) respectively.\r\n\r\nIMHO As a complete fix for this ticket, I would implement consistent behaviour across iOs and android.", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-07T17:23:09.000+0000", "updated": "2013-11-07T17:23:09.000+0000" }, { "id": "299037", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Test case for ticket in file.\r\nExpected behavior is as follows\r\n\r\ncurrentPage property - Non Animated Scroll\r\nmoveNext,movePrevious,scrollToView methods - Animated Scroll", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-27T21:23:04.000+0000", "updated": "2014-03-27T21:23:49.000+0000" }, { "id": "299039", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master\r\nhttps://github.com/appcelerator/titanium_mobile/pull/5543", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-27T21:24:44.000+0000", "updated": "2014-03-27T21:24:44.000+0000" }, { "id": "302148", "author": { "name": "nmittal", "key": "nmittal", "displayName": "Neha Mittal", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Verified fix with below environment:\r\n\r\nAppc Studio: 3.3.0.201404211130\r\nSDK build: 3.3.0.v20140422163054\r\nacs: 1.0.14\r\nnpm: 1.3.2\r\nalloy: 1.4.0-dev\r\nCLI: titanium-3.3.0-dev\r\ntitanium-code-processor:1.1.1-beta1\r\nXcode: 5.1.1\r\nOsx: Mavericks(10.9.2)\r\nDevice: iPhone 5C( iOS 7.1)\r\n\r\ncurrentPage property - Non Animated Scroll\r\nmoveNext,movePrevious,scrollToView methods - Animated Scroll as expected.\r\nHence Closing the issue.\r\n", "updateAuthor": { "name": "nmittal", "key": "nmittal", "displayName": "Neha Mittal", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-04-23T09:03:33.000+0000", "updated": "2014-04-23T09:03:33.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }