public abstract class BaseSectionAdapter
extends android.widget.BaseAdapter
implements android.widget.SectionIndexer, android.widget.AbsListView.OnScrollListener
Modifier and Type | Field and Description |
---|---|
static int |
PINNED_HEADER_GONE
Pinned header state: don't show the header.
|
static int |
PINNED_HEADER_PUSHED_UP
Pinned header state: show the header.
|
static int |
PINNED_HEADER_VISIBLE
Pinned header state: show the header at the top of the list.
|
static String |
TAG |
Constructor and Description |
---|
BaseSectionAdapter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
bindSectionHeader(android.view.View view,
int position,
boolean displaySectionHeader) |
abstract void |
configurePinnedHeader(android.view.View header,
int position,
int alpha)
Configures the pinned header view to match the first visible list item.
|
abstract android.view.View |
getAmazingView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
int |
getPinnedHeaderState(int position)
Computes the desired state of the pinned header for the given position of the first visible list item.
|
abstract int |
getPositionForSection(int section) |
abstract int |
getSectionForPosition(int position) |
abstract Object[] |
getSections() |
android.view.View |
getView(int position,
android.view.View convertView,
android.view.ViewGroup parent) |
void |
onScroll(android.widget.AbsListView view,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount) |
void |
onScrollStateChanged(android.widget.AbsListView view,
int scrollState) |
areAllItemsEnabled, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
public static final String TAG
public static final int PINNED_HEADER_GONE
public static final int PINNED_HEADER_VISIBLE
public static final int PINNED_HEADER_PUSHED_UP
public int getPinnedHeaderState(int position)
PINNED_HEADER_GONE
, PINNED_HEADER_VISIBLE
or PINNED_HEADER_PUSHED_UP
.position
- position of itempublic void onScroll(android.widget.AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
onScroll
in interface android.widget.AbsListView.OnScrollListener
public void onScrollStateChanged(android.widget.AbsListView view, int scrollState)
onScrollStateChanged
in interface android.widget.AbsListView.OnScrollListener
public final android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent)
getView
in interface android.widget.Adapter
protected abstract void bindSectionHeader(android.view.View view, int position, boolean displaySectionHeader)
view
- view to populateposition
- position of itemdisplaySectionHeader
- whether to display a section headerpublic abstract android.view.View getAmazingView(int position, android.view.View convertView, android.view.ViewGroup parent)
position
- position of itemconvertView
- view to be recycledparent
- parent viewpublic abstract void configurePinnedHeader(android.view.View header, int position, int alpha)
header
- pinned header view.position
- position of the first visible list item.alpha
- fading of the header view, between 0 and 255.public abstract int getPositionForSection(int section)
getPositionForSection
in interface android.widget.SectionIndexer
public abstract int getSectionForPosition(int position)
getSectionForPosition
in interface android.widget.SectionIndexer
public abstract Object[] getSections()
getSections
in interface android.widget.SectionIndexer
Copyright © 2011–2014. All rights reserved.