it's not if changing editability while editing, failing tests:
@Test
public void testDisableEditableWhileEditingMustTerminateEdit() {
int editingIndex = 1;
listView.edit(editingIndex);
listView.setEditable(false);
assertEquals(-1, listView.getEditingIndex());
}
/**
* test manual edit termination
*/
@Test
public void testDisableEditableWhileEditingMustAllowTerminateEdit() {
int editingIndex = 1;
listView.edit(editingIndex);
listView.setEditable(false);
listView.edit(-1);
assertEquals(-1, listView.getEditingIndex());
}
The list should update its editing state to not-editing on change of editable -> !editable. At the very least, it should be possible to manually update the location to not-editing which is not possible due to edit(..) unconditionally backing out if not editable:
public void edit(int itemIndex) {
if (!isEditable()) return;
setEditingIndex(itemIndex);
}
similar for all virtualized controls (not tested yet, but implementation is similar)
@Test
public void testDisableEditableWhileEditingMustTerminateEdit() {
int editingIndex = 1;
listView.edit(editingIndex);
listView.setEditable(false);
assertEquals(-1, listView.getEditingIndex());
}
/**
* test manual edit termination
*/
@Test
public void testDisableEditableWhileEditingMustAllowTerminateEdit() {
int editingIndex = 1;
listView.edit(editingIndex);
listView.setEditable(false);
listView.edit(-1);
assertEquals(-1, listView.getEditingIndex());
}
The list should update its editing state to not-editing on change of editable -> !editable. At the very least, it should be possible to manually update the location to not-editing which is not possible due to edit(..) unconditionally backing out if not editable:
public void edit(int itemIndex) {
if (!isEditable()) return;
setEditingIndex(itemIndex);
}
similar for all virtualized controls (not tested yet, but implementation is similar)