public class DynamicScrollContainer extends ScrollContainer
DynamicScrollContainer is a specialized type of Scroll Container intended for high performance
where hundreds or thousands of views need to be displayed in a scrollable list.
The performance is achieved by only every having the visible views on the screen occupy memory at a given time. When a view is scrolled out of the visible area of the scroll container it is immediately destroyed and removed from memory. When a view is scrolled into the visible area of the scroll container it is created if not already visible.
Views are created by aDynamicScrollContainer.DataSource
Only vertical scrolling is supported.| Modifier and Type | Class and Description |
|---|---|
static class |
DynamicScrollContainer.AbstractView
Represents a view to be displayed on a
DynamicScrollContainer. |
static class |
DynamicScrollContainer.DataSource
This class is responsible for serving up the
DynamicScrollContainer.AbstractViews to display on a DynamicScrollContainer. |
Control.TranslucentShape| Modifier and Type | Field and Description |
|---|---|
protected static int |
SCROLL_DOWN |
protected static int |
SCROLL_UNKNOWN |
protected static int |
SCROLL_UP |
autoScroll, bag, bag0, disabledFlick, flick, hsIgnoreAutoScroll, lastH, lastV, sbH, sbV, shrink2sizealwaysEraseBackground, BACKGROUND_CYLINDRIC_SHADED, BACKGROUND_SHADED, BACKGROUND_SHADED_INV, BACKGROUND_SOLID, backgroundStyle, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_ROUNDED, BORDER_SIMPLE, BORDER_TOP, borderColor, borderRadius, children, controlFound, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastScreenWidth, lastW, lastX, lastY, numChildren, started, tabOrder, tail, TRANSITION_TIMEAFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y| Constructor and Description |
|---|
DynamicScrollContainer() |
DynamicScrollContainer(DynamicScrollContainer.DataSource datasource) |
| Modifier and Type | Method and Description |
|---|---|
DynamicScrollContainer.AbstractView |
getTopMostVisibleView()
Returns the top most
DynamicScrollContainer.AbstractView that starts within the viewable area |
boolean |
isViewVisible(DynamicScrollContainer.AbstractView view)
Returns true if the view is in the currently visible part of the scroll container
|
void |
onEvent(Event event)
Called to process key, pen, control and other posted events.
|
void |
reposition()
Reposition this control, calling again setRect with the original parameters.
|
void |
resize(int maxX,
int maxY)
This method resizes the control to the needed bounds, based on the given maximum width and heights.
|
boolean |
scrollContent(int dx,
int dy,
boolean fromFlick)
Performs a relative move.
|
void |
scrollToView(DynamicScrollContainer.AbstractView view) |
void |
setDataSource(DynamicScrollContainer.DataSource datasource)
Set the
DynamicScrollContainer.DataSource to be used with this container |
void |
stopFlick()
Stops any triggered flick events
|
protected void |
updateVisibleViews(int scrollDirection) |
add, addScrollEventHandler, bagSetRect, canScrollContent, canShowScrollBars, disableFlick, enableFlick, flickEnded, flickStarted, getBagChildren, getBagInitialHeight, getBagInitialWidth, getClientRect, getFlick, getPreferredHeight, getPreferredWidth, getRealClientRect, getScrollDistance, getScrollPosition, moveFocusToNextControl, onBoundsChanged, onColorsChanged, onFontChanged, onPaint, remove, removeAll, removeScrollEventHandler, resize, scrollPage, scrollToControl, scrollToOrigin, scrollToPage, setBorderStyle, setHandlersVisibility, setHandlersVisibility, setHValue, setScrollBars, setVValue, updateListenerTriggered, wasScrolledadd, add, add, add, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getBorderStyle, getChildren, getChildrenCount, getClientRect, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextEditable, onAddAgain, onRemove, onSwapFinished, paintChildren, resizeHeight, resizeWidth, setBorderRadius, setEnabled, setFocusTraversable, setHighlighting, setInsets, setPressColor, setPressed, swapToTopmostWindow_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isTopMost, isVisible, isVisibleAndInside, onWindowPaintFinished, post, postEvent, postPressedEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboardprotected static final int SCROLL_UP
protected static final int SCROLL_UNKNOWN
protected static final int SCROLL_DOWN
public DynamicScrollContainer(DynamicScrollContainer.DataSource datasource)
public DynamicScrollContainer()
public void onEvent(Event event)
ControlonEvent in class ScrollContainerevent - the event to processEvent,
KeyEvent,
PenEventprotected void updateVisibleViews(int scrollDirection)
public DynamicScrollContainer.AbstractView getTopMostVisibleView()
DynamicScrollContainer.AbstractView that starts within the viewable areapublic boolean isViewVisible(DynamicScrollContainer.AbstractView view)
view - public void reposition()
Controlreposition in class ScrollContainerpublic void setDataSource(DynamicScrollContainer.DataSource datasource)
DynamicScrollContainer.DataSource to be used with this containerdatasource - public boolean scrollContent(int dx,
int dy,
boolean fromFlick)
ScrollablescrollContent in interface ScrollablescrollContent in class ScrollContainerdx - The relative amount of pixels to move in the X axis.dy - The relative amount of pixels to move in the Y axis.public void scrollToView(DynamicScrollContainer.AbstractView view)
public void resize(int maxX,
int maxY)
ScrollContainerresize in class ScrollContainerpublic void stopFlick()