Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27879

Android: ListView should only fire "scrolling" event when moving a min distance

    Details

    • Story Points:
      5
    • Sprint:
      2020 Sprint 13

      Description

      Android's ListView can spam a "scrolling" event even when your finger is held at a single position. This is because there is currently no touch tolerance applied and 1 pixel scroll movement will fire the event. It should only fire a "scrolling" event when the scroll direction changes and for a minimum pixel distance specified by Google's ViewConfiguration.getScaledTouchSlop() API.

      var win = Ti.UI.createWindow({backgroundColor: 'gray'});
      var listView = Ti.UI.createListView();
      var sections = [];
       
      var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
      var fruitDataSet = [
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Apple'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
          {properties: { height: 100,title: 'Banana'}},
      ];
      fruitSection.setItems(fruitDataSet);
      sections.push(fruitSection);
       
      listView.appendSection(sections);
      listView.addEventListener("scrolling",function(e){
      	console.log(e.direction);
      })
      win.add(listView);
      win.open();
      
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              michael Michael Gangolf
              Reviewer:
              Joshua Quick
              Tester:
              Samir Mohammed
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration