[TIMOB-25991] Android: RefreshControl in ListView only works when dragging content
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | Release 9.3.0 |
Components | n/a |
Labels | android, listview, refreshcontrol |
Reporter | Michael Gangolf |
Assignee | Gary Mathews |
Created | 2018-04-26T19:25:06.000+0000 |
Updated | 2020-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
I've had the same and ended up by adding a fake tall listItem to the listView when on Android =/
anyone can take a look on this? iOS works well
master: https://github.com/appcelerator/titanium_mobile/pull/12029