public class

AdapterLooper

extends BaseAdapter
java.lang.Object
   ↳ android.widget.BaseAdapter
     ↳ com.droidux.ui.widgets.gallery.adapter.AdapterLooper

Class Overview

AdapterLooper wraps SpinnerAdapter adapter to loop/cycle it so that they appear to be an endless loop. It's not really endless, but the views will be cycled up to MAX_VALUE.

Summary

[Expand]
Inherited Constants
From interface android.widget.Adapter
Public Constructors
AdapterLooper(SpinnerAdapter innerAdapter)
Construct an adapter looper object.
Public Methods
int getCenterPosition()
Gets the position of the center item of the looper.
int getCount()
SpinnerAdapter getInnerAdapter()
Gets the wrapped adapter that is cycled by this looper.
int getInnerCount()
Gets the number of items in the wrapped adapter.
int getInnerPosition(int position)
Gets the actual position of an item in the wrapped adapter based on its position in the looper.
Object getItem(int position)
long getItemId(int position)
int getItemViewType(int position)
Get the type of View that will be created by getView(int, View, ViewGroup) for the specified item.
View getView(int position, View convertView, ViewGroup parent)
int getViewTypeCount()

Returns the number of types of Views that will be created by getView(int, View, ViewGroup).

boolean isEmpty()
[Expand]
Inherited Methods
From class android.widget.BaseAdapter
From class java.lang.Object
From interface android.widget.Adapter
From interface android.widget.ListAdapter
From interface android.widget.SpinnerAdapter

Public Constructors

public AdapterLooper (SpinnerAdapter innerAdapter)

Since: API Level 3.0

Construct an adapter looper object.

Parameters
innerAdapter The wrapped adapter.

Public Methods

public int getCenterPosition ()

Since: API Level 3.0

Gets the position of the center item of the looper.

Returns
  • The center position.

public int getCount ()

Since: API Level 3.0

public SpinnerAdapter getInnerAdapter ()

Since: API Level 3.0

Gets the wrapped adapter that is cycled by this looper.

Returns
  • The wrapped adapter.

public int getInnerCount ()

Since: API Level 3.0

Gets the number of items in the wrapped adapter.

Returns
  • Count of items.

public int getInnerPosition (int position)

Since: API Level 3.0

Gets the actual position of an item in the wrapped adapter based on its position in the looper.

Parameters
position The item's position in the looper.
Returns
  • The item's position in the wrapped adapter.

public Object getItem (int position)

Since: API Level 3.0

public long getItemId (int position)

Since: API Level 3.0

public int getItemViewType (int position)

Since: API Level

Get the type of View that will be created by getView(int, View, ViewGroup) for the specified item.

Parameters
position The position of the item within the adapter's data set whose view type we want.
Returns

public View getView (int position, View convertView, ViewGroup parent)

Since: API Level 3.0

public int getViewTypeCount ()

Since: API Level

Returns the number of types of Views that will be created by getView(int, View, ViewGroup). Each type represents a set of views that can be converted in getView(int, View, ViewGroup). If the adapter always returns the same type of View for all items, this method should return 1.

This method will only be called when when the adapter is set on the the AdapterView.

Returns
  • The number of types of Views that will be created by this adapter

public boolean isEmpty ()

Since: API Level