Code example for SparseIntArray

Methods: indexOfValue

0
	public boolean hasStableIds() { 
		return delegate.hasStableIds();
	} 
 
	int translateAdapterPosition(int position) {
		return positionMapping.indexOfValue(position);
	} 
 
	int translateListViewPosition(int position) {
		int viewType = getItemViewType(position);
		if (viewType == headerViewType) {
			return positionMapping.get(position + 1);
		} else if (viewType == dividerViewType) {
			return positionMapping.get(position - 1);
		} else { 
			return positionMapping.get(position);
		} 
	} 
 
	@Override 
	public int getItemViewType(int position) {