[TIMOB-25634] Android: ScrollableView "cacheSize" cannot by dynamically changed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-09T21:29:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | ScrollableView, android |
Reporter | Prashant Saini |
Assignee | Joshua Quick |
Created | 2017-12-26T10:12:18.000+0000 |
Updated | 2018-06-26T21:23:10.000+0000 |
Description
On Android, calling ScrollableView's setCacheSize method is throwing error:
var win = Ti.UI.createWindow();
var view1 = Ti.UI.createView({ backgroundColor:'#123' });
var view2 = Ti.UI.createView({ backgroundColor:'#246' });
var view3 = Ti.UI.createView({ backgroundColor:'#48b' });
var scrollableView = Ti.UI.createScrollableView({
views:[view1,view2,view3],
showPagingControl:true
});
win.add(scrollableView);
win.open();
setTimeout(function (){
scrollableView.setCacheSize(3); // TypeError: setCacheSize is not a function
}, 5000);
I also looked out in the SDK source code & seems this method is missing in Android (perhaps iOS as well) source code.
*There's no way at present we can set dynamic cacheSize. we can set it at creation only.*
Attachments
File | Date | Size |
---|---|---|
ScrollableViewCacheSizeTest.js | 2018-05-03T23:54:05.000+0000 | 957 |
Hello, Can you send a sample code for us to test. Also, send the source code link/file that you are referring to. Thanks.
1- Added sample code. 2- 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= Now please do not ask me to test it on different SDK versions as I am not a tester.
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. The below code can better exercise support for setting the cache size dynamically and setter/getter function support...
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696
FR Passed. Waiting for merger to be enabled.
*Closing ticket.* Verified fix can be seen in SDK Version:
7.3.0.v20180625114905
*Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/9696