public class HeaderAndFooterRecyclerView
extends RecyclerView
| Constructor and Description |
|---|
HeaderAndFooterRecyclerView(android.content.Context context)
Creates a new recycler view, which can contain multiple fixed views as headers and footers.
|
HeaderAndFooterRecyclerView(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new recycler view, which can contain multiple fixed views as headers and footers.
|
HeaderAndFooterRecyclerView(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new recycler view, which can contain multiple fixed views as headers and footers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFooterView(android.view.View view)
Adds a fixed view to appear at the bottom of the grid view.
|
void |
addHeaderView(android.view.View view)
Adds a fixed view to appear at the top of the grid view.
|
Adapter |
getAdapter() |
int |
getFooterViewsCount()
Returns the number of footer views in the grid view.
|
int |
getHeaderViewsCount()
Returns the number of header views in the grid view.
|
void |
removeFooterView(android.view.View view)
Removes a previously added footer view.
|
void |
removeHeaderView(android.view.View view)
Removes a previously added header view.
|
void |
setAdapter(Adapter adapter) |
public HeaderAndFooterRecyclerView(android.content.Context context)
context - The context, which should be used by the view, as an instance of the class Context. The context may not be nullpublic HeaderAndFooterRecyclerView(android.content.Context context,
android.util.AttributeSet attributeSet)
context - The context, which should be used by the view, as an instance of the class Context. The context may not be nullattributeSet - The attribute set, the view's attributes should be obtained from, as an instance of
the type AttributeSet or null, if no attributes should be obtainedpublic HeaderAndFooterRecyclerView(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
context - The context, which should be used by the view, as an instance of the class Context. The context may not be nullattributeSet - The attribute set, the view's attributes should be obtained from, as an instance of
the type AttributeSet or null, if no attributes should be obtaineddefaultStyle - The default style to apply to this view. If 0, no style will be applied (beyond what
is included in the theme). This may either be an attribute resource, whose value will
be retrieved from the current theme, or an explicit style resourcepublic final void addHeaderView(android.view.View view)
view - The header view, which should be added, as an instance of the class View. The
view may not be nullpublic final void removeHeaderView(android.view.View view)
view - The header view, which should be removed, as an instance of the class View.
The view may not be nullpublic final int getHeaderViewsCount()
Integer valuepublic final void addFooterView(android.view.View view)
view - The footer view, which should be added, as an instance of the class View. The
view may not be nullpublic final void removeFooterView(android.view.View view)
view - The footer view, which should be removed, as an instance of the class View.
The view may not be nullpublic final int getFooterViewsCount()
Integer valuepublic final Adapter getAdapter()
public final void setAdapter(Adapter adapter)