[TIMOB-27283] Android: Add "contentSize" property to Ti.UI.ScrollView "scroll" event
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-10-02T15:28:45.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.3.0 |
| Components | Android |
| Labels | android, event, parity, scrollview |
| Reporter | Michael Gangolf |
| Assignee | Gary Mathews |
| Created | 2019-07-26T15:51:00.000+0000 |
| Updated | 2019-10-02T15:28:45.000+0000 |
Description
Parity for contentSize inside the scroll event of a ScrollView. iOS has this since 5.2.0.
*Example:*
var win = Ti.UI.createWindow({backgroundColor: '#fff'});
var view1 = Ti.UI.createView({width:20,height:1020,backgroundColor:"#f00",top:0});
var scrollView = Ti.UI.createScrollView({height:Ti.UI.FILL,width:Ti.UI.FILL});
var ldi = Ti.Platform.displayCaps.logicalDensityFactor;
scrollView.addEventListener("scroll",function(e){
console.log("contentSize", e.contentSize);
})
win.add(scrollView);
scrollView.add(view1);
win.open();
Will output height: 1020 (height of the red view) and your screen width.
PR: https://github.com/appcelerator/titanium_mobile/pull/11082
FR passed.Waiting on Jenkins
merged to master for 8.3.0 target
Improvement verified in SDK version 8.3.0.v20191001072347. Ble to see the following in the console:
{"width":411,"height":1020}