{ "id": "63043", "key": "TIMOB-2411", "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": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-18T23:09:25.000+0000", "created": "2011-04-15T03:18:58.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "release-1.6.0", "reported-1.5.1", "view" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-18T23:09:25.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": "{html}
Currently showPagingControl has no effect. Don confirms this\nfunctionality is already implemented for android, but a recent\nchange caused it to cease working.
\n(added by bill:)
\nfailcase app.js, in which paging controls (back/forward arrows)\ndo not appear:
\n\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({ \n title:'Test',\n backgroundColor:'#000',\n exitOnClose: true\n});\n\nfunction getOrientation(o)\n{ //Came from orientation.js, but we didn't need the buttons and such\n switch (o)\n {\n case Titanium.UI.PORTRAIT:\n return 'portrait';\n case Titanium.UI.UPSIDE_PORTRAIT:\n return 'upside portrait';\n case Titanium.UI.LANDSCAPE_LEFT:\n return 'landscape left';\n case Titanium.UI.LANDSCAPE_RIGHT:\n return 'landscape right';\n case Titanium.UI.FACE_UP:\n return 'face up';\n case Titanium.UI.FACE_DOWN:\n return 'face down';\n case Titanium.UI.UNKNOWN:\n return 'unknown';\n }\n}\n\n\nwin.backgroundColor = '#ccc';\n\n// initialize to all modes\nwin.orientationModes = [\n Titanium.UI.PORTRAIT,\n Titanium.UI.LANDSCAPE_LEFT,\n Titanium.UI.LANDSCAPE_RIGHT\n];\n\n\n//\n// orientation change listener\n//\nTi.Gesture.addEventListener('orientationchange',function(e)\n{\n\n // get orienation from event object\n var orientation = getOrientation(e.orientation);\n});\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\n\nvar scrollView = Titanium.UI.createScrollableView({\n views:[view1,view2,view3,view4],\n showPagingControl:true,\n pagingControlHeight:30,\n maxZoomScale:2.0,\n currentPage:1\n});\n\nwin.add(scrollView);\n\nvar i=1;\nvar activeView = view1;\n\nscrollView.addEventListener('scroll', function(e)\n{\n activeView = e.view; // the object handle to the view that is about to become visible\n i = e.currentPage;\n Titanium.API.info(\"scroll called - current index \" + i + ' active view ' + activeView);\n});\nscrollView.addEventListener('click', function(e)\n{\n Ti.API.info('ScrollView received click event, source = ' + e.source);\n});\nscrollView.addEventListener('touchend', function(e)\n{\n Ti.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 title:'Add',\n style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\nadd.addEventListener('click',function()\n{\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 style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\njump.addEventListener('click',function()\n{\n i = (scrollView.currentPage + 1) % scrollView.views.length;\n scrollView.currentPage = i;\n});\n\n// change button to dynamically change a view\nvar change = Titanium.UI.createButton({\n title:'Change',\n style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED\n});\nchange.addEventListener('click',function()\n{\n var newView = Ti.UI.createView({\n backgroundColor:'#ff9900'\n });\n var l = Ti.UI.createLabel({\n text:'View (Changed) ' + (i+1),\n color:'#fff',\n height:'auto',\n width:'auto'\n });\n newView.add(l);\n var ar = [];\n for (var x=0;x<scrollView.views.length;x++)\n {\n if (x==i)\n {\n Ti.API.info('SETTING TO NEW VIEW ' + x);\n ar[x] = newView;\n }\n else\n {\n Ti.API.info('SETTING TO OLD VIEW ' + x);\n\n ar[x] = scrollView.views[x];\n }\n }\n scrollView.views = ar;\n});\n\n// move scroll view left\nvar left = Titanium.UI.createButton({\n image:'icon_arrow_left.png'\n});\nleft.addEventListener('click', function(e)\n{\n if (i === 0) {\n return;\n }\n i--;\n scrollView.scrollToView(i);\n});\n\n// move scroll view right\nvar right = Titanium.UI.createButton({\n image:'icon_arrow_right.png'\n});\nright.addEventListener('click', function(e)\n{\n if (i == (scrollView.views.length-1)){\n return;\n }\n i++;\n scrollView.scrollToView(scrollView.views[i]);\n});\nvar flexSpace = Titanium.UI.createButton({\n systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\n});\n\nif (Titanium.Platform.osname == 'iphone' || Titanium.Platform.osname == 'ipad')\n{\n // set toolbar\n win.setToolbar([flexSpace,left,change,add,jump,right,flexSpace]);\n}\nelse\n{\n var toolbar = Titanium.UI.createView({\n bottom: 10,\n height: 50,\n backgroundColor: '#333333',\n borderRadius: 10,\n opacity: 0.3,\n left: 10,\n right: 10\n });\n\n var floater = Titanium.UI.createView({\n width:320,\n height: 'auto',\n opacity: 0\n });\n\n toolbar.add(floater);\n\n left.left = 10;\n left.width = 30;\n\n change.left = 50;\n change.width = 70;\n change.height = 35;\n\n add.left = 130;\n add.width = 70;\n add.height = 35;\n\n jump.left = 210;\n jump.width = 70;\n jump.height = 35;\n\n right.right = 10;\n right.width = 30;\n\n floater.add(left);\n floater.add(change);\n floater.add(add);\n floater.add(jump);\n floater.add(right);\n win.add(toolbar);\n}\n\nwin.open();
\n
(from [20335d8603e2708b59a18bafbb91b7292278de8e])\n[#2411 state:fixed-in-qa] Properly handle\nshowPagingControl property in ScrollableView \nhttps://github.com/appcelerator/titanium_mobile/commit/20335d8603e2...
Verified on G1/1.6 and Nexus One/2.2.1 using build #e1cb22a
(from [74c5f4c81e631223feecf57b87f1232fae7fe998])\n[#2411 state:fixed-in-qa] make sure delayed\nhandler messages get cleared when views get cleared \nhttps://github.com/appcelerator/titanium_mobile/commit/74c5f4c81e63...