I got a use case that clicks item once activates(selects) it and clicks it twice deactivates(deselects) it. But due to the source of 'SelectableAdapter.toggleSelection()':
public void toggleSelection(int position) {
if (position < 0) {
return;
}
if (mMode == SINGLE) {
clearSelection();
}
boolean contains = mSelectedPositions.contains(position);
if (contains) {
removeSelection(position);
} else {
addSelection(position);
}
log.v("toggleSelection %s on position %s, current %s",
(contains ? "removed" : "added"), position, mSelectedPositions);
}
If in SINGLE mode, item in 'position' can only be selected but toggled. I try to override, but many members are 'private' in 'SelectableAdapter' and 'FlexibleAdapter'.
Will toggle selection in SINGLE mode be supported in furture verson by introducing new field member something like 'toggleSelectionInSingleMode'? Thanks.
I got a use case that clicks item once activates(selects) it and clicks it twice deactivates(deselects) it. But due to the source of 'SelectableAdapter.toggleSelection()': public void toggleSelection(int position) { if (position < 0) { return; } if (mMode == SINGLE) { clearSelection(); } boolean contains = mSelectedPositions.contains(position); if (contains) { removeSelection(position); } else { addSelection(position); } log.v("toggleSelection %s on position %s, current %s", (contains ? "removed" : "added"), position, mSelectedPositions); } If in SINGLE mode, item in 'position' can only be selected but toggled. I try to override, but many members are 'private' in 'SelectableAdapter' and 'FlexibleAdapter'.
Will toggle selection in SINGLE mode be supported in furture verson by introducing new field member something like 'toggleSelectionInSingleMode'? Thanks.