[TIMOB-9068] MobileWeb: Parity in ScrollableView for "scroll" and "scrollEnd" events
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-14T15:18:40.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-12 MW |
Components | MobileWeb |
Labels | parity |
Reporter | Bill Dawson |
Assignee | Bryan Hughes |
Created | 2012-05-09T10:39:46.000+0000 |
Updated | 2012-08-02T10:45:56.000+0000 |
Description
To achieve parity with recent re-definition of the meaning of "scroll" and addition of the event "scrollEnd" via TIMOB-8933 (iOS) and TIMOB-9061 (Android), both of were settled via this PR: https://github.com/appcelerator/titanium_mobile/pull/2101.
See updated ScrollableView.yml file for documentation. (As I type this, it isn't merged yet, but will be soon.)
Test app.js from the community contributor:
var win = Ti.UI.createWindow({backgroundColor: "#444"});
var view1 = Ti.UI.createView({ backgroundColor:'#123', width: 250 });
var view2 = Ti.UI.createView({ backgroundColor:'#246', width: 250 });
var view3 = Ti.UI.createView({ backgroundColor:'#48b', width: 250 });
var scrollableView = Ti.UI.createScrollableView({
views: [view1,view2,view3],
showPagingControl: true,
width: 260,
height: 430
});
win.add(scrollableView);
win.open();
scrollableView.addEventListener('scroll', function (e) {
Ti.API.debug('scrollableView got a scroll event: float:' + e.currentPageAsFloat + ' int: ' + e.currentPage);
});
scrollableView.addEventListener('scrollEnd', function (e) {
Ti.API.debug('scrollableView got a scrollEnd event: ' + e.currentPage);
});
Run that and watch console, making sure the logged values are logical.
Also add support for the "scrolling" event which fires continuously while scrolling.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2376
Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120731184111 Mac osx - chrome 21,safari 5.1.4,firefox 14.0.1