ItemDataType - the generic type of the data in each itempublic abstract class ViewHolderBase<ItemDataType>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected android.view.View |
mCurrentView |
protected int |
mLastPosition |
protected int |
mPosition |
| Constructor and Description |
|---|
ViewHolderBase() |
| Modifier and Type | Method and Description |
|---|---|
abstract android.view.View |
createView(android.view.LayoutInflater layoutInflater)
create a view from resource Xml file, and hold the view that may be used in displaying data.
|
void |
setItemData(int position,
android.view.View view) |
abstract void |
showData(int position,
ItemDataType itemData)
using the held views to display data
|
boolean |
stillHoldLastItemData()
Check if the View Holder is still display the same data after back to screen.
|
protected int mLastPosition
protected int mPosition
protected android.view.View mCurrentView
public abstract android.view.View createView(android.view.LayoutInflater layoutInflater)
public abstract void showData(int position,
ItemDataType itemData)
public void setItemData(int position,
android.view.View view)
public boolean stillHoldLastItemData()