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

Android: RefreshControl in ListView only works when dragging content

    Details

    • Type: Improvement
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      Problem:
      When creating a ListView with a RefreshControl you can only drag the view down when you drag&drop the content. If you ListView is empty you don't have any handle to drag.

      Code

      var win = Ti.UI.createWindow({
      	fullscreen: true
      });
      var counter = 0;
       
      function genData() {
      	var data = [];
      	var i = 1;
      	for (i = 1; i <= 3; i++) {
      		data.push({
      			properties: {
      				title: 'ROW ' + (counter + i)
      			}
      		})
      	}
      	counter += 3;
      	return data;
      }
      var section = Ti.UI.createListSection();
      section.setItems(genData());
      var control = Ti.UI.createRefreshControl({
      	tintColor: 'red'
      })
      var listView = Ti.UI.createListView({
      	sections: [section],
      	refreshControl: control,
      	height: Ti.UI.FILL,
      	width: Ti.UI.FILL
      });
      control.addEventListener('refreshstart', function(e) {
      	Ti.API.info('refreshstart');
      	setTimeout(function() {
      		Ti.API.debug('Timeout');
      		section.appendItems(genData());
      		control.endRefreshing();
      	}, 2000);
      })
      win.add(listView);
      win.open();
      
      

      Dragging below Row 3 won't show the RefreshControl it will only work when you start dragging on the 3 items.

      What to expect
      The whole ListView space (in the example Ti.UI.FILL) should work as a drag area. Otherwise you can't use it with an empty ListView

      Testsetup

      • Android 7.0.1 / HTC A9
      • SDK 7.1.0.GA

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michael Michael Gangolf
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code