public abstract class ViewPagerAdapter<T>
extends android.support.v4.view.PagerAdapter
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Queue<android.view.View> |
cacheViews |
protected android.content.Context |
context |
protected int |
currentPosition |
protected android.view.View |
currentTarget |
protected java.util.ArrayList<T> |
data |
protected int |
layoutResId |
| Constructor and Description |
|---|
ViewPagerAdapter(android.content.Context context) |
ViewPagerAdapter(android.content.Context context,
int layoutResId) |
ViewPagerAdapter(android.content.Context context,
java.util.List<T> data,
int layoutResId) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T elem) |
void |
addAll(java.util.List<T> elements) |
void |
addAllAt(int location,
java.util.List<T> elements) |
void |
addAt(int location,
T elem) |
void |
clear() |
boolean |
contains(T elem) |
protected abstract void |
convert(H helper,
T item) |
protected android.view.View |
createView(android.view.ViewGroup container,
int position) |
void |
destroyItem(android.view.ViewGroup container,
int position,
java.lang.Object object) |
T |
get(int position) |
protected PagerAdapterHelper |
getAdapterHelper(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
java.util.ArrayList<T> |
getAll() |
int |
getCount() |
int |
getCurrentPosition() |
android.view.View |
getCurrentTarget() |
int |
getSize() |
java.lang.Object |
instantiateItem(android.view.ViewGroup container,
int position) |
boolean |
isViewFromObject(android.view.View view,
java.lang.Object object) |
void |
notifyDataSetChanged() |
void |
onEmptyData() |
void |
onHasData() |
void |
remove(T elem) |
void |
removeAll(java.util.List<T> elements) |
void |
removeAt(int index) |
void |
replace(T oldElem,
T newElem) |
void |
replaceAll(java.util.List<T> elements) |
void |
replaceAt(int index,
T elem) |
void |
setPrimaryItem(android.view.ViewGroup container,
int position,
java.lang.Object object) |
protected final android.content.Context context
protected final int layoutResId
protected final java.util.ArrayList<T> data
protected java.util.Queue<android.view.View> cacheViews
protected int currentPosition
protected android.view.View currentTarget
public ViewPagerAdapter(android.content.Context context)
public ViewPagerAdapter(android.content.Context context,
@LayoutRes
int layoutResId)
public ViewPagerAdapter(android.content.Context context,
@Nullable
java.util.List<T> data,
@LayoutRes
int layoutResId)
protected PagerAdapterHelper getAdapterHelper(int position, android.view.View convertView, android.view.ViewGroup parent)
public void add(T elem)
public void addAt(int location,
T elem)
public void addAll(java.util.List<T> elements)
public void addAllAt(int location,
java.util.List<T> elements)
public void remove(T elem)
public void removeAt(int index)
public void removeAll(java.util.List<T> elements)
public void clear()
public void replace(T oldElem,
T newElem)
public void replaceAt(int index,
T elem)
public void replaceAll(java.util.List<T> elements)
public T get(int position)
public java.util.ArrayList<T> getAll()
public int getSize()
public boolean contains(T elem)
public void onEmptyData()
public void onHasData()
public void notifyDataSetChanged()
notifyDataSetChanged in class android.support.v4.view.PagerAdapterpublic int getCount()
getCount in class android.support.v4.view.PagerAdapterpublic boolean isViewFromObject(android.view.View view,
java.lang.Object object)
isViewFromObject in class android.support.v4.view.PagerAdapterpublic java.lang.Object instantiateItem(android.view.ViewGroup container,
int position)
instantiateItem in class android.support.v4.view.PagerAdapterpublic void destroyItem(android.view.ViewGroup container,
int position,
java.lang.Object object)
destroyItem in class android.support.v4.view.PagerAdapterpublic void setPrimaryItem(android.view.ViewGroup container,
int position,
java.lang.Object object)
setPrimaryItem in class android.support.v4.view.PagerAdapterprotected android.view.View createView(android.view.ViewGroup container,
int position)
public int getCurrentPosition()
public android.view.View getCurrentTarget()
protected abstract void convert(H helper,
T item)