Methods Summary |
---|
public boolean | areAllItemsEnabled()
if (mAdapter != null) {
return mAreAllFixedViewsSelectable && mAdapter.areAllItemsEnabled();
} else {
return true;
}
|
private boolean | areAllListInfosSelectable(java.util.ArrayList infos)
if (infos != null) {
for (ListView.FixedViewInfo info : infos) {
if (!info.isSelectable) {
return false;
}
}
}
return true;
|
public int | getCount()
if (mAdapter != null) {
return getFootersCount() + getHeadersCount() + mAdapter.getCount();
} else {
return getFootersCount() + getHeadersCount();
}
|
public Filter | getFilter()
if (mIsFilterable) {
return ((Filterable) mAdapter).getFilter();
}
return null;
|
public int | getFootersCount()
return mFooterViewInfos == null ? 0 : mFooterViewInfos.size();
|
public int | getHeadersCount()
return mHeaderViewInfos == null ? 0 : mHeaderViewInfos.size();
|
public java.lang.Object | getItem(int position)
int numHeaders = getHeadersCount();
if (mAdapter != null && position >= numHeaders) {
int adjPosition = position - numHeaders;
int adapterCount = mAdapter.getCount();
if (adjPosition >= adapterCount && mFooterViewInfos != null) {
return mFooterViewInfos.get(adjPosition - adapterCount).data;
} else {
return mAdapter.getItem(adjPosition);
}
} else if (position < numHeaders && mHeaderViewInfos != null) {
return mHeaderViewInfos.get(position).data;
}
return null;
|
public long | getItemId(int position)
int numHeaders = getHeadersCount();
if (mAdapter != null && position >= numHeaders) {
int adjPosition = position - numHeaders;
int adapterCnt = mAdapter.getCount();
if (adjPosition < adapterCnt) {
return mAdapter.getItemId(adjPosition);
}
}
return -1;
|
public int | getItemViewType(int position)
int numHeaders = getHeadersCount();
if (mAdapter != null && position >= numHeaders) {
int adjPosition = position - numHeaders;
int adapterCount = mAdapter.getCount();
if (adjPosition < adapterCount) {
return mAdapter.getItemViewType(adjPosition);
}
}
return AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER;
|
public android.view.View | getView(int position, android.view.View convertView, android.view.ViewGroup parent)
int numHeaders = getHeadersCount();
if (mAdapter != null && position >= numHeaders) {
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);
}
} else if (position < numHeaders) {
return mHeaderViewInfos.get(position).view;
}
return null;
|
public int | getViewTypeCount()
if (mAdapter != null) {
return mAdapter.getViewTypeCount();
}
return 1;
|
public ListAdapter | getWrappedAdapter()
return mAdapter;
|
public boolean | hasStableIds()
if (mAdapter != null) {
return mAdapter.hasStableIds();
}
return false;
|
public boolean | isEmpty()
return mAdapter == null || mAdapter.isEmpty();
|
public boolean | isEnabled(int position)
int numHeaders = getHeadersCount();
if (mAdapter != null && position >= numHeaders) {
int adjPosition = position - numHeaders;
int adapterCount = mAdapter.getCount();
if (adjPosition >= adapterCount && mFooterViewInfos != null) {
return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable;
} else {
return mAdapter.isEnabled(adjPosition);
}
} else if (position < numHeaders && mHeaderViewInfos != null) {
return mHeaderViewInfos.get(position).isSelectable;
}
return true;
|
public void | registerDataSetObserver(android.database.DataSetObserver observer)
if (mAdapter != null) {
mAdapter.registerDataSetObserver(observer);
}
|
public boolean | removeFooter(android.view.View v)
for (int i = 0; i < mFooterViewInfos.size(); i++) {
ListView.FixedViewInfo info = mFooterViewInfos.get(i);
if (info.view == v) {
mFooterViewInfos.remove(i);
mAreAllFixedViewsSelectable =
areAllListInfosSelectable(mHeaderViewInfos)
&& areAllListInfosSelectable(mFooterViewInfos);
return true;
}
}
return false;
|
public boolean | removeHeader(android.view.View v)
for (int i = 0; i < mHeaderViewInfos.size(); i++) {
ListView.FixedViewInfo info = mHeaderViewInfos.get(i);
if (info.view == v) {
mHeaderViewInfos.remove(i);
mAreAllFixedViewsSelectable =
areAllListInfosSelectable(mHeaderViewInfos)
&& areAllListInfosSelectable(mFooterViewInfos);
return true;
}
}
return false;
|
public void | unregisterDataSetObserver(android.database.DataSetObserver observer)
if (mAdapter != null) {
mAdapter.unregisterDataSetObserver(observer);
}
|