public static class DynamicScrollContainer.DataSource
extends java.lang.Object
DynamicScrollContainer.AbstractView
s to display on a DynamicScrollContainer
.
You must populate the DynamicScrollContainer.DataSource
with all the views you want to display before passing it to the DynamicScrollContainer
Constructor and Description |
---|
DataSource() |
DataSource(int viewCount)
Create a
DynamicScrollContainer.DataSource and allocate memory for viewCount views to be stored |
Modifier and Type | Method and Description |
---|---|
void |
addView(DynamicScrollContainer.AbstractView view)
Adds a
DynamicScrollContainer.AbstractView to the datasource if it does not already exist. |
int |
getTotalScrollHeight(int scrollContainerWidth)
Returns the total scrollable height that all
DynamicScrollContainer.AbstractView s together will take up.
This is calculated based on each DynamicScrollContainer.AbstractView height and is called when a DynamicScrollContainer.DataSource is set on
a DynamicScrollContainer.DataSource or the DynamicScrollContainer detects screen rotation. |
DynamicScrollContainer.AbstractView |
getView(int no)
Returns view number
no |
Vector |
getVisibleViewsVec(int yStart,
int yEnd,
int scrollDirection)
Returns a Vector containing the
DynamicScrollContainer.AbstractView s that are visible in the Y viewing area of DynamicScrollContainer between y position yStart and yEnd |
void |
removeView(DynamicScrollContainer.AbstractView view)
Removes the
DynamicScrollContainer.AbstractView from the datasource. |
protected Vector views
public DataSource()
public DataSource(int viewCount)
DynamicScrollContainer.DataSource
and allocate memory for viewCount
views to be storedviewCount
- public int getTotalScrollHeight(int scrollContainerWidth)
DynamicScrollContainer.AbstractView
s together will take up.
This is calculated based on each DynamicScrollContainer.AbstractView
height and is called when a DynamicScrollContainer.DataSource
is set on
a DynamicScrollContainer.DataSource
or the DynamicScrollContainer
detects screen rotation.public void addView(DynamicScrollContainer.AbstractView view)
DynamicScrollContainer.AbstractView
to the datasource if it does not already exist.
This does not automatically recalculate the view heightview
- public void removeView(DynamicScrollContainer.AbstractView view)
DynamicScrollContainer.AbstractView
from the datasource.
This does not automatically recalculate the view heightview
- public Vector getVisibleViewsVec(int yStart, int yEnd, int scrollDirection)
DynamicScrollContainer.AbstractView
s that are visible in the Y viewing area of DynamicScrollContainer
between y position yStart
and yEnd
yStart
- yEnd
- public DynamicScrollContainer.AbstractView getView(int no)
no contained within this DynamicScrollContainer.DataSource
no
-