Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2422] Add scrollEnd event to scroll views on Android

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2012-08-08T15:09:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelstbs-1.8.0
ReporterRalf Pfeiffer
AssigneeBlain Hamon
Created2011-04-15T03:19:16.000+0000
Updated2017-03-24T18:37:06.000+0000

Description

Environment: - Android checked on device (os 2.3.6 nexus one) and emulator (OS 2.2) Create a scrollable region of content with Ti.UI.createScrollView. The expected behavior is to be able to trigger and event when the whole portion of area is scrolled. 'scrollEnd' event works fine on iOS but on Android no event is triggered. 'scroll' event correctly works. Sample code: http://pastie.org/2690123

Comments

  1. kevinwhinnery 2011-04-15

    This does not actually work on Android, unless I misunderstand how the event is supposed to be used:

       var win = Ti.UI.createWindow({
           backgroundColor:'#fff'
       });
       
       var container = Ti.UI.createScrollView({
           top:50,
           left:10,
           right:10,
           height:150,
           contentHeight:'auto'
       });
       
       container.addEventListener('scrollEnd', function() {
           Ti.API.info('got it');
       });
       
       container.add(Ti.UI.createView({height:800,backgroundColor:'green'}));
       
       win.add(container);
       win.open();
       
  2. James K 2011-04-15

    The scroll event currently implemented for iOS is in fact a scrollend event. It is implemented in scrollViewDidEndDecelerating.

    The better course would be to rename that event to scrollend and implement a true scroll event in scrollViewDidScroll which fires when the scroll is 50% complete and the page control changes color.

    I have done this locally with no issues.

  3. Ralf Pfeiffer 2011-04-15

    (good potential for exercise assignment)

  4. Lee Morris 2017-03-24

    Closing ticket as duplicate with reference to the linked issues.

JSON Source