public class ScrollPosition extends ScrollBar implements Scrollable, PenListener, TimerListener
Control.TranslucentShape| Modifier and Type | Field and Description |
|---|---|
static boolean |
AUTO_HIDE
Set to false to make the PositionBar always show (instead of the default auto-hide behaviour).
|
int |
barColor
The bar color.
|
static int |
heightMultiplierToShowHandle
Defines the height multiplier that must be reached to show the handle while scrolling.
|
static int |
VISIBLE_COUNT
By default, the ScrollPosition is shown during 1 second to let the user know that he can scroll.
|
AUTO_DELAY, bColor, blockIncrement, btnDec, btnInc, btnWH, directMove, disableBlockIncrement, dragBarMax, dragBarMin, dragBarPos, dragBarSize, enableAutoScroll, extraSize, fourColors, HORIZONTAL, INITIAL_DELAY, liveScrolling, maximum, midBarSize, minDragBarSize, minimum, npPartsHandle, sbColor, sbColorDis, sfColor, size, startDragPos, unitIncrement, value, valuesPerPixel, VERTICAL, verticalBar, visibleItemsalwaysEraseBackground, 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, lastH, 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 |
|---|
ScrollPosition()
Constructs a vertical ScrollPosition.
|
ScrollPosition(byte orientation)
Constructs a ScrollPosition with the given orientation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canScrollContent(int direction,
java.lang.Object target)
Checks if there is room to flick this container in the given direction.
|
void |
clear()
Resets position to 0 and posts a pressed event.
|
void |
flickEnded(boolean atPenDown)
Called when the flick animation is ended.
|
boolean |
flickStarted()
Called when the flick animation is started.
|
Flick |
getFlick()
Returns the current flick object.
|
int |
getPreferredHeight()
If this is a horizontal scroll bar, i strongly suggest you use PREFERRED in your control's height (with small adjustments)
|
int |
getPreferredWidth()
If this is a vertical scroll bar, i strongly suggest you use PREFERRED in your control's width (with small adjustments).
|
int |
getScrollPosition(int direction)
Returns the current position given the direction.
|
void |
onBoundsChanged(boolean b)
Called after a setRect.
|
void |
onColorsChanged(boolean b)
Called after a setEnabled, setForeColor and setBackColor and when a control has
been added to a Container.
|
void |
onEvent(Event e)
Called to process key, pen, control and other posted events.
|
void |
onPaint(Graphics g)
Draws the border (if any).
|
void |
penDown(PenEvent e)
A PEN_DOWN event was dispatched.
|
void |
penDrag(DragEvent e)
A PEN_DRAG event was dispatched.
|
void |
penDragEnd(DragEvent e)
A PEN_DRAG_END event was dispatched.
|
void |
penDragStart(DragEvent e)
A PEN_DRAG_START event was dispatched.
|
void |
penUp(PenEvent e)
A PEN_UP event was dispatched.
|
boolean |
scrollContent(int xDelta,
int yDelta,
boolean fromFlick)
Performs a relative move.
|
void |
setHandleVisibility(boolean visible)
Sets the visibility of the temporary scrollbar handler.
|
void |
setNeverShow()
Call this to never show the ScrollPosition
|
void |
tempShow()
Used by ScrollPosition
|
void |
timerTriggered(TimerEvent e)
A TRIGGERED event was dispatched.
|
boolean |
wasScrolled()
Returns true if the control was scrolled since last pen down
|
blockScroll, getBlockIncrement, getMaximum, getMinimum, getUnitIncrement, getValue, getVisibleItems, handleGeographicalFocusChangeKeys, onAnimationFinished, onFontChanged, recomputeParams, setBlockIncrement, setEnabled, setHighlighting, setLiveScrolling, setMaximum, setMinimum, setNinePatchHandle, setPos, setUnitIncrement, setValue, setValues, setVisibleItems, updateValueadd, add, add, add, add, broadcastEvent, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getBorderStyle, getChildren, getChildrenCount, getClientRect, getClientRect, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onRemove, onSwapFinished, paintChildren, remove, removeAll, resize, resizeHeight, resizeWidth, setBorderRadius, setBorderStyle, setFocusTraversable, 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, 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, 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, willOpenKeyboardpublic static boolean AUTO_HIDE
public static int VISIBLE_COUNT
public int barColor
public static int heightMultiplierToShowHandle
public ScrollPosition()
public ScrollPosition(byte orientation)
ScrollBar.VERTICAL,
ScrollBar.HORIZONTALpublic void setNeverShow()
public void tempShow()
ScrollBarpublic void onBoundsChanged(boolean b)
ControlonBoundsChanged in class ScrollBarb - If the bounds were changed due to a screen change (rotation, collapse)public void onColorsChanged(boolean b)
ControlonColorsChanged in class ScrollBarpublic void onPaint(Graphics g)
Containersuper.onPaint(g);, or the border will not be drawn.public void onEvent(Event e)
Controlpublic int getPreferredWidth()
ScrollBargetPreferredWidth in class ScrollBarpublic int getPreferredHeight()
ScrollBargetPreferredHeight in class ScrollBarpublic boolean flickStarted()
ScrollableflickStarted in interface Scrollablepublic void flickEnded(boolean atPenDown)
ScrollableflickEnded in interface ScrollableatPenDown - Flag indicating if the animation ended due to a pendown event.public boolean canScrollContent(int direction,
java.lang.Object target)
ScrollablecanScrollContent in interface Scrollabledirection - The direction we want to flick given by one of the following constants:target - The target of the series of PEN events that triggered this flick attempt.public boolean scrollContent(int xDelta,
int yDelta,
boolean fromFlick)
ScrollablescrollContent in interface ScrollablexDelta - The relative amount of pixels to move in the X axis.yDelta - The relative amount of pixels to move in the Y axis.public int getScrollPosition(int direction)
ScrollablegetScrollPosition in interface Scrollablepublic Flick getFlick()
ScrollablegetFlick in interface Scrollablepublic void penDown(PenEvent e)
PenListenerpenDown in interface PenListenerPenEventpublic void penUp(PenEvent e)
PenListenerpenUp in interface PenListenerPenEventpublic void penDrag(DragEvent e)
PenListenerpenDrag in interface PenListenerPenEventpublic void penDragStart(DragEvent e)
PenListenerpenDragStart in interface PenListenerPenEventpublic void penDragEnd(DragEvent e)
PenListenerpenDragEnd in interface PenListenerPenEventpublic void setHandleVisibility(boolean visible)
public void timerTriggered(TimerEvent e)
TimerListenertimerTriggered in interface TimerListenerTimerEventpublic boolean wasScrolled()
ScrollablewasScrolled in interface Scrollable