public abstract class Section
extends java.lang.Object
Constructor and Description |
---|
Section() |
Modifier and Type | Method and Description |
---|---|
void |
addDecorator(Decorator decorator)
Adds a decorator to the section.
|
void |
addDecorator(Decorator decorator,
int priority)
Adds a decorator to the section with priority.
|
void |
hideSection()
Hide's the section inside the adapter.
|
boolean |
isSectionHidden()
Returns boolean flag indicating whether the section is hidden or not.
|
void |
onChanged(int position,
int count,
java.lang.Object payload) |
void |
onInserted(int position,
int count) |
void |
onMoved(int fromPosition,
int toPosition) |
void |
onRemoved(int position,
int count) |
void |
removeAllDecorators()
Removes all the decorators added to this section.
|
boolean |
removeDecorator(Decorator decorator)
Removes the mentioned decorator from this section.
|
void |
removeDecorator(int index)
Removes the decorator at the specified index from this section.
|
void |
setExpansionMode(Mode expansionMode)
Set the expansion mode for this section.
|
void |
setSectionExpansionMode(Mode sectionExpansionMode)
Set the section expansion mode for this section.
|
void |
setSelectionMode(Mode selectionMode)
Set the selection mode for this section.
|
void |
setSpanCount(int spanCount)
Set the span count for this section.
|
void |
showSection()
If the section was hidden from parent, this method shows it again in the parent.
|
public void addDecorator(Decorator decorator)
decorator
- Decorator to be addedpublic void addDecorator(Decorator decorator, int priority)
decorator
- Decorator to be addedpublic void hideSection()
getCount()
returns 0.public boolean isSectionHidden()
public void removeAllDecorators()
public boolean removeDecorator(Decorator decorator)
decorator
- Decorator to be removed.public void removeDecorator(int index)
index
- index of the decorator to be removed.public void setExpansionMode(Mode expansionMode)
Mode.INHERIT
. If
the value is set then it overrides the parent's expansion mode.expansionMode
- Mode to be set for this section's expansion modepublic void setSectionExpansionMode(Mode sectionExpansionMode)
Mode.INHERIT
. If
the value is set then it overrides the parent's section expansion mode.sectionExpansionMode
- Mode to be set for this section's section expansion modepublic void setSelectionMode(Mode selectionMode)
Mode.INHERIT
. If
the value is set then it overrides the parent's selection mode.selectionMode
- Mode to be set for this section's selection modepublic void setSpanCount(int spanCount)
ItemBinder.getSpanSize(int)
.
For example,
ItemBinder.getSpanSize(int)
is 3. Span count for each item will
be multiplied by 2 (ParentSpanCount / SectionSpanCount). Lets assume that each item inside the
section returns span count as 1. Then, inside parent each will be considered as 1 * 2 = 2.
As a best practice, set the spanCount for parent as multiple of the section's spanCount.spanCount
- Count to be set as span countpublic void showSection()
public final void onInserted(int position, int count)
public final void onRemoved(int position, int count)
public final void onMoved(int fromPosition, int toPosition)
public final void onChanged(int position, int count, java.lang.Object payload)