Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9068] MobileWeb: Parity in ScrollableView for "scroll" and "scrollEnd" events

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-06-14T15:18:40.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 MW
ComponentsMobileWeb
Labelsparity
ReporterBill Dawson
AssigneeBryan Hughes
Created2012-05-09T10:39:46.000+0000
Updated2012-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.

Comments

  1. Chris Barber 2012-06-08

    Also add support for the "scrolling" event which fires continuously while scrolling.
  2. Bryan Hughes 2012-06-12

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2376
  3. Lokesh Choudhary 2012-08-02

    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

JSON Source