public interface IListProvider
IListProvider
is used by a IListRenderer
to create
it's content and handle events.Modifier and Type | Method and Description |
---|---|
nUIDisplayObject |
getCell(int rowIndex,
nUIDisplayObject reusableObject)
For every row in the
IListRenderer this method is called to
return the actual cell object to be displayed at the given index. |
int |
getNumberOfRows()
Use to return the number of cells (rows) the
IListRenderer needs
to display. |
nUIDisplayObject |
getPlaceholder()
This method will be called to get template which will be shown in list view if there are no data to show.
|
nUIDisplayObject |
getSeparator()
Define a separator to divide rows.
|
SwipeBehavior |
getSwipeBehavior(int type,
int swipeDirection)
Define a swipe behavior per row and per direction.
|
int |
getTypeForCell(int rowIndex)
If you use rows with different height or layout you need provide for each
cell type an identifier.
|
boolean |
shouldSelect(int rowIndex) |
boolean |
shouldSelectInEditMode(int rowIndex) |
int getNumberOfRows()
IListRenderer
needs
to display. For every row getCell(int, nUIDisplayObject)
will be
called to get the cell object at the given index.int getTypeForCell(int rowIndex)
rowIndex
- - type for the rowIndexnUIDisplayObject getCell(int rowIndex, nUIDisplayObject reusableObject)
IListRenderer
this method is called to
return the actual cell object to be displayed at the given index. A cell
is typically a nUITableButton
(or subclass), but could be any
nUIDisplayObject
.
For better performance already use reusableObject
if it's
provided.
rowIndex
- the index of the cell starting at 0reusableObject
- - if not null, use this object to set all values for the
current row.rowIndex
SwipeBehavior getSwipeBehavior(int type, int swipeDirection)
SwipeBehavior
methods
to create a desired behavior.type
- - type of cellswipeDirection
- - one of IListActionListener.SWIPE_LEFT_TO_RIGHT
, IListActionListener.SWIPE_RIGHT_TO_LEFT
SwipeBehavior
nUIDisplayObject getSeparator()
nUIDisplayObject
, but typically you would use a
nUISeparatorElement
.nUIDisplayObject getPlaceholder()
null
boolean shouldSelect(int rowIndex)
rowIndex
- - the index of the cellboolean shouldSelectInEditMode(int rowIndex)
rowIndex
- - the index of the cell