Loading core/java/android/widget/HeaderViewListAdapter.java +9 −9 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { private ListAdapter mAdapter; // These two ArrayList are assumed to NOT be null. // They are indeed created when declared in ListView and then shared. ArrayList<ListView.FixedViewInfo> mHeaderViewInfos; ArrayList<ListView.FixedViewInfo> mFooterViewInfos; boolean mAreAllFixedViewsSelectable; Loading @@ -55,11 +57,11 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { } public int getHeadersCount() { return mHeaderViewInfos == null ? 0 : mHeaderViewInfos.size(); return mHeaderViewInfos.size(); } public int getFootersCount() { return mFooterViewInfos == null ? 0 : mFooterViewInfos.size(); return mFooterViewInfos.size(); } public boolean isEmpty() { Loading Loading @@ -132,12 +134,12 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { if (mAdapter != null && position >= numHeaders) { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount && mFooterViewInfos != null) { if (adjPosition >= adapterCount) { return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable; } else { return mAdapter.isEnabled(adjPosition); } } else if (position < numHeaders && mHeaderViewInfos != null) { } else if (position < numHeaders) { return mHeaderViewInfos.get(position).isSelectable; } return true; Loading @@ -148,12 +150,12 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { if (mAdapter != null && position >= numHeaders) { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount && mFooterViewInfos != null) { if (adjPosition >= adapterCount) { return mFooterViewInfos.get(adjPosition - adapterCount).data; } else { return mAdapter.getItem(adjPosition); } } else if (position < numHeaders && mHeaderViewInfos != null) { } else if (position < numHeaders) { return mHeaderViewInfos.get(position).data; } return null; Loading Loading @@ -184,9 +186,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount) { if (mFooterViewInfos != null) { return mFooterViewInfos.get(adjPosition - adapterCount).view; } } else { return mAdapter.getView(adjPosition, convertView, parent); } Loading core/java/android/widget/ListView.java +4 −4 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading @@ -273,7 +273,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading Loading @@ -324,7 +324,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading @@ -350,7 +350,7 @@ public class ListView extends AbsListView { * than once, the views will appear in the order they were added. Views added using * this call can take focus if they want. * <p>NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied * cursor with one that that will also account for header views. * cursor with one that will also account for header and footer views. * * * @param v The view to add. Loading Loading
core/java/android/widget/HeaderViewListAdapter.java +9 −9 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { private ListAdapter mAdapter; // These two ArrayList are assumed to NOT be null. // They are indeed created when declared in ListView and then shared. ArrayList<ListView.FixedViewInfo> mHeaderViewInfos; ArrayList<ListView.FixedViewInfo> mFooterViewInfos; boolean mAreAllFixedViewsSelectable; Loading @@ -55,11 +57,11 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { } public int getHeadersCount() { return mHeaderViewInfos == null ? 0 : mHeaderViewInfos.size(); return mHeaderViewInfos.size(); } public int getFootersCount() { return mFooterViewInfos == null ? 0 : mFooterViewInfos.size(); return mFooterViewInfos.size(); } public boolean isEmpty() { Loading Loading @@ -132,12 +134,12 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { if (mAdapter != null && position >= numHeaders) { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount && mFooterViewInfos != null) { if (adjPosition >= adapterCount) { return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable; } else { return mAdapter.isEnabled(adjPosition); } } else if (position < numHeaders && mHeaderViewInfos != null) { } else if (position < numHeaders) { return mHeaderViewInfos.get(position).isSelectable; } return true; Loading @@ -148,12 +150,12 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { if (mAdapter != null && position >= numHeaders) { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount && mFooterViewInfos != null) { if (adjPosition >= adapterCount) { return mFooterViewInfos.get(adjPosition - adapterCount).data; } else { return mAdapter.getItem(adjPosition); } } else if (position < numHeaders && mHeaderViewInfos != null) { } else if (position < numHeaders) { return mHeaderViewInfos.get(position).data; } return null; Loading Loading @@ -184,9 +186,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable { int adjPosition = position - numHeaders; int adapterCount = mAdapter.getCount(); if (adjPosition >= adapterCount) { if (mFooterViewInfos != null) { return mFooterViewInfos.get(adjPosition - adapterCount).view; } } else { return mAdapter.getView(adjPosition, convertView, parent); } Loading
core/java/android/widget/ListView.java +4 −4 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading @@ -273,7 +273,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading Loading @@ -324,7 +324,7 @@ public class ListView extends AbsListView { * added. Views added using this call can take focus if they want. * <p> * NOTE: Call this before calling setAdapter. This is so ListView can wrap * the supplied cursor with one that that will also account for header * the supplied cursor with one that will also account for header and footer * views. * * @param v The view to add. Loading @@ -350,7 +350,7 @@ public class ListView extends AbsListView { * than once, the views will appear in the order they were added. Views added using * this call can take focus if they want. * <p>NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied * cursor with one that that will also account for header views. * cursor with one that will also account for header and footer views. * * * @param v The view to add. Loading