Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14317] TI API: Implement the scroll/drag start/end events for ListView

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-08-19T21:38:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.2.0
ComponentsTiAPI
Labelsmodule_listview, qe-testadded
ReporterBryan Hughes
AssigneeIngo Muschenetz
Created2013-06-20T20:21:13.000+0000
Updated2014-03-20T18:49:49.000+0000

Description

The scroll and drag events serve a variety of purposes in TableView, and we should bring them to ListView.

Comments

  1. Vishal Duggal 2013-08-01

    Brief Spec agreed upon 1. Introduce method setMarker on ListView allowing you to set a reference item via sectionIndex, itemIndex 2. Introduce event marker which fired when either the reference item or item past the reference item is displayed. 3. This is a one shot event. 4. Event does not bubble and has no payload. Test case is in TIMOB-14319
  2. Priya Agarwal 2013-10-24

    Verified the fix with: Appc-Studio: 3.2.0.201310230601 Sdk:3.2.0.v20131023171643 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3), iPhone5(v7.0) Xcode: 5 OS: Mac OSX 10.8 Code used to test:
       function genSection(sectionIndex) {
           var section = Ti.UI.createListSection({ headerTitle: 'Section '+sectionIndex});
           var data = [];
           var row=1;
           while(row<21) {
               data.push({properties:{title:'Section '+sectionIndex+' Row '+row}});
               row++;
           }
           section.setItems(data);
           return section;
       }
        
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       var listView = Ti.UI.createListView();
       var sections = [];
       var indices = [];
       var sc=0;
       while(sc<10) {
           sections.push(genSection(sc+1));
           indices.push({index:sc,title:'S'+sc});
           sc++;
       }
        
       listView.sections = sections;
       listView.sectionIndexTitles = indices;
        
       listView.setMarker({sectionIndex:2,itemIndex:5});
       listView.addEventListener('marker',function(e){
           Ti.API.info('GOT MARKER EVENT');
       })
       win.add(listView);
       win.open();
       
    ListView scroll/drag event working as per expectation: 1. Event fired only once. 2. Fired when doing a normal scroll. 3. Fired when scrolling using the sectionIndexTitles
  3. Bert Grantges 2014-03-20

JSON Source