Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25991] Android: RefreshControl in ListView only works when dragging content

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sRelease 9.3.0
Componentsn/a
Labelsandroid, listview, refreshcontrol
ReporterMichael Gangolf
AssigneeGary Mathews
Created2018-04-26T19:25:06.000+0000
Updated2020-11-20T00:25:04.000+0000

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

Comments

  1. Carlos Henrique Zinato 2018-09-28

    I've had the same and ended up by adding a fake tall listItem to the listView when on Android =/
  2. Brian GarcĂ­a 2019-04-09

    anyone can take a look on this? iOS works well
  3. Gary Mathews 2020-10-26

    master: https://github.com/appcelerator/titanium_mobile/pull/12029

JSON Source