Make implementation of isEmpty consistent with implementation of getCount in HeaderListViewAdapter

Fix for Issue ID 18316. Make isEmpty() return false when getCount() returns a non-zero value. So that the list cannot be considered empty when a header or footer is present.

https://code.google.com/p/android/issues/detail?id=18316

Change-Id: Ib69201e9d5ef3efcbb68ea298b8cc8ca6e027246
Signed-off-by: Emma Sajic <esajic@effectivelateralsolutions.co.uk>
This commit is contained in:
Emma Sajic
2012-12-09 13:32:05 +00:00
parent aeb6268645
commit ef2277ec58

View File

@@ -79,7 +79,8 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
}
public boolean isEmpty() {
return mAdapter == null || mAdapter.isEmpty();
return (mAdapter == null || mAdapter.isEmpty())
&& getFootersCount() + getHeadersCount() == 0;
}
private boolean areAllListInfosSelectable(ArrayList<ListView.FixedViewInfo> infos) {