public interface

ItemTypeAdapter

implements Adapter
com.neomades.ui.ItemTypeAdapter

Class Overview

An ItemTypeAdapter object enables Lists showing different type of views for each item.

The ItemTypeAdapter provides access to the data types. ListView which uses ListAdapter, will reuse different type of item without mixing views.

IMPORTANT: ItemTypeAdapter could be used only if a ListAdapter is set on ListView.

Summary

Public Methods
abstract int getItemViewType(int position)
Get the type of View that will be created by getView(int, View, View) for the specified item.
abstract int getViewTypeCount()
Returns the number of types of Views that will be created by getView(int, View, View).
[Expand]
Inherited Methods
From interface com.neomades.ui.Adapter

Public Methods

public abstract int getItemViewType (int position)

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

Note: Integers must be in the range 0 to getViewTypeCount() - 1.

Parameters
position The position of the item within the adapter's data set whose view type we want.
Returns
  • An integer representing the type of View. Two views should share the same type if one can be converted to the other in getView(int, View, View).

public abstract int getViewTypeCount ()

Returns the number of types of Views that will be created by getView(int, View, View). Each type represents a set of views that can be converted in getView(int, View, View). 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