To add the dividers between disabled items (not clickable) in ListView for Android previous to Lollipop I override adapter's method areAllItemsEnabled() to return true. But now in Lollipop this method doesn't fix the problem. The dividers are invisible in ExpandableListView too.
Is there a way to fix this problem without adding the divider in my item layout?
We ended up adding two Views of 1dp to fake the divider and checking on version to set Visibility. The problem is worse. We also needed to keep track of if the next row is enabled or not, if it is the last row. A lot of cheese on an already deficient ListView (as compared to UITableView for example).
if(isItemAvailable(item) || Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
rowView = inflater.inflate(R.layout.size_row, parent, false);
} else {
rowView = inflater.inflate(R.layout.size_row_with_divider, parent, false);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With