{ "id": "170683", "key": "TIMOB-25634", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-09T21:29:54.000+0000", "created": "2017-12-26T10:12:18.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ScrollableView", "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-26T21:23:10.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": "On Android, calling ScrollableView's setCacheSize method is throwing error:\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar view1 = Ti.UI.createView({ backgroundColor:'#123' });\r\nvar view2 = Ti.UI.createView({ backgroundColor:'#246' });\r\nvar view3 = Ti.UI.createView({ backgroundColor:'#48b' });\r\n\r\nvar scrollableView = Ti.UI.createScrollableView({\r\n views:[view1,view2,view3],\r\n showPagingControl:true\r\n});\r\n\r\nwin.add(scrollableView);\r\nwin.open();\r\n\r\nsetTimeout(function (){\r\n scrollableView.setCacheSize(3); // TypeError: setCacheSize is not a function\r\n}, 5000);\r\n\r\n{code}\r\n\r\nI also looked out in the SDK source code & seems this method is missing in Android (perhaps iOS as well) source code.\r\n\r\n*There's no way at present we can set dynamic cacheSize. we can set it at creation only.*", "attachment": [ { "id": "65130", "filename": "ScrollableViewCacheSizeTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T23:54:05.000+0000", "size": 957, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: ScrollableView \"cacheSize\" cannot by dynamically changed", "creator": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 7.0.1.GA", "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 }, { "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": "432555", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you send a sample code for us to test. Also, send the source code link/file that you are referring to. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-12-26T20:15:08.000+0000", "updated": "2017-12-26T20:15:08.000+0000" }, { "id": "432560", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1- Added sample code.\r\n2- Link to SDK source code which doesn't show any results to *setCacheSize* method : https://github.com/appcelerator/titanium_mobile/search?utf8=%E2%9C%93&q=setCacheSize&type=\r\n\r\nNow please do not ask me to test it on different SDK versions as I am not a tester.", "updateAuthor": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-27T06:57:18.000+0000", "updated": "2017-12-27T06:57:18.000+0000" }, { "id": "432771", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is really a documentation error, but it's easy enough to add support for it. We'll look into adding it into 7.1.0.\r\n\r\nThe below code can better exercise support for setting the cache size dynamically and setter/getter function support...\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar scrollableView = Ti.UI.createScrollableView(\r\n{\r\n\tviews:\r\n\t[\r\n\t\tTi.UI.createView({ backgroundColor: \"orange\", width: \"25dp\", height: \"25dp\" }),\r\n\t\tTi.UI.createView({ backgroundColor: \"red\", width: \"75dp\", height: \"75dp\" }),\r\n\t\tTi.UI.createView({ backgroundColor: \"green\", width: \"150dp\", height: \"150dp\" }),\r\n\t\tTi.UI.createView({ backgroundColor: \"blue\", width: \"225dp\", height: \"225dp\" }),\r\n\t\tTi.UI.createView({ backgroundColor: \"purple\", width: \"300dp\", height: \"300dp\" }),\r\n\t],\r\n\tcacheSize: 5,\r\n\tshowPagingControl: true,\r\n\tbackgroundColor: \"gray\",\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE,\r\n});\r\nTi.API.info(\"@@@ Initialized cacheSize: \" + scrollableView.cacheSize);\r\nscrollableView.cacheSize = 4;\r\nTi.API.info(\"@@@ Property assigned cacheSize: \" + scrollableView.cacheSize);\r\nscrollableView.setCacheSize(3);\r\nTi.API.info(\"@@@ Method assigned cacheSize: \" + scrollableView.getCacheSize());\r\nwindow.add(scrollableView);\r\nwindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-05T02:31:42.000+0000", "updated": "2018-01-05T02:31:42.000+0000" }, { "id": "432801", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-06T02:49:31.000+0000", "updated": "2018-01-06T02:49:31.000+0000" }, { "id": "437399", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting for merger to be enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-05T01:11:08.000+0000", "updated": "2018-05-05T01:11:08.000+0000" }, { "id": "438738", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix can be seen in SDK Version: {{7.3.0.v20180625114905}}\r\n\r\n*Test and other information can be found at:*\r\nhttps://github.com/appcelerator/titanium_mobile/pull/9696\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-26T21:22:52.000+0000", "updated": "2018-06-26T21:23:04.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }