Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9061] Android: `ScrollableView`: `scroll` event should be renamed to `dragEnd`; proper `scroll` event needed

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-12T23:50:47.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-12 API
ComponentsAndroid
Labelsapi, module_scrollableview, qe-testadded, release-note
ReporterRussell Frank
AssigneeBill Dawson
Created2012-05-03T08:26:14.000+0000
Updated2012-07-13T10:16:20.000+0000

Description

On Android, the ScrollableView scroll event is actually fired when dragging stops; it should therefore be renamed to dragEnd. Then, a proper scroll event, fired continuously as the view is scrolled, is needed. These changes have been addressed in my pull request: [titanium_mobile/#2101](https://github.com/appcelerator/titanium_mobile/pull/2101#issuecomment-5480208)

Comments

  1. Bill Dawson 2012-05-08

    Test case from Russ's PR

    With a little addition to make it viable as an app.js.
       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('dragEnd', function (e) {
          Ti.API.debug('scrollableView got a dragEnd event: ' + e.currentPage);
       });
       
       scrollableView.addEventListener('scrollEnd', function (e) {
          Ti.API.debug('scrollableView got a scrollEnd event: ' + e.currentPage);
       });
       
    Run that and watch logcat, make sure the values shown in logcat are logical.
  2. Blain Hamon 2012-06-04

    Pull merged
  3. Mukesh Gadiya 2012-06-23

    SDK: 2.1.0.v20120622174154 Android: 2.3.4 Droid3 OS: Lion 10.7.3 Verified that: 1. scroll is fired continuously as you scroll in the window of the app 2. scrollend and dragend events are fired as the user ends scrolling and dragging on the scrollable window.
  4. Anshu Mittal 2012-07-12

    Reopening to update labels.

JSON Source