So I have the following code in the adapter:
@Override
public boolean isEnabled(int position)
{
GeneralItem item = super.getItem(position);
What about having an instance variable on your adapter:
boolean ignoreDisabled = false;
Then in areAllItemsEnabled
:
public boolean areAllItemsEnabled() {
return ignoreDisabled;
}
and then at the beginning of isEnabled
:
public boolean isEnabled(int position) {
if (areAllItemsEnabled()) {
return true;
}
... rest of your current isEnabled method ...
}
Then you can switch between the two modes by setting ignoreDisabled
appropriately and calling invalidate
on your ListView
.
Note that the addition to isEnabled
is probably unneeded; it just seems a bit more complete.