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, visibleItems
alwaysEraseBackground, 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_TIME
AFTER, 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, updateValue
add, 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, willOpenKeyboard
public 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.HORIZONTAL
public void setNeverShow()
public void tempShow()
ScrollBar
public void onBoundsChanged(boolean b)
Control
onBoundsChanged
in class ScrollBar
b
- If the bounds were changed due to a screen change (rotation, collapse)public void onColorsChanged(boolean b)
Control
onColorsChanged
in class ScrollBar
public void onPaint(Graphics g)
Container
super.onPaint(g);
, or the border will not be drawn.public void onEvent(Event e)
Control
public int getPreferredWidth()
ScrollBar
getPreferredWidth
in class ScrollBar
public int getPreferredHeight()
ScrollBar
getPreferredHeight
in class ScrollBar
public boolean flickStarted()
Scrollable
flickStarted
in interface Scrollable
public void flickEnded(boolean atPenDown)
Scrollable
flickEnded
in interface Scrollable
atPenDown
- Flag indicating if the animation ended due to a pendown event.public boolean canScrollContent(int direction, java.lang.Object target)
Scrollable
canScrollContent
in interface Scrollable
direction
- 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)
Scrollable
scrollContent
in interface Scrollable
xDelta
- 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)
Scrollable
getScrollPosition
in interface Scrollable
public Flick getFlick()
Scrollable
getFlick
in interface Scrollable
public void penDown(PenEvent e)
PenListener
penDown
in interface PenListener
PenEvent
public void penUp(PenEvent e)
PenListener
penUp
in interface PenListener
PenEvent
public void penDrag(DragEvent e)
PenListener
penDrag
in interface PenListener
PenEvent
public void penDragStart(DragEvent e)
PenListener
penDragStart
in interface PenListener
PenEvent
public void penDragEnd(DragEvent e)
PenListener
penDragEnd
in interface PenListener
PenEvent
public void setHandleVisibility(boolean visible)
public void timerTriggered(TimerEvent e)
TimerListener
timerTriggered
in interface TimerListener
TimerEvent
public boolean wasScrolled()
Scrollable
wasScrolled
in interface Scrollable