public final class PageSliderIndicator extends Component
PageSlider.
If a PageSlider contains multiple pages, it can be associated with PageSliderIndicator so that the
indicator of the selected page can be displayed.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
protected static class |
PageSliderIndicator.IndicatorSelectionHandler |
Processes events of selecting a page contained in the
PageSlider instance. |
Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEventACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE| 构造器 | 说明 |
|---|---|
PageSliderIndicator(Context context) |
Default constructor used to create a
PageSliderIndicator instance by using the default attribute set and
style. |
PageSliderIndicator(Context context,
AttrSet attrSet) |
A constructor used to create a
PageSliderIndicator instance by using specified attribute set and default
style after the XML file is parsed. |
PageSliderIndicator(Context context,
AttrSet attrSet,
String styleName) |
A constructor used to create a
PageSliderIndicator instance by using specified attribute set
and specified style after the XML file is parsed. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addOnSelectionChangedListener(PageSlider.PageChangedListener listener) |
Adds a listener to listen for page change events.
|
void |
addPageChangedListener(PageSlider.PageChangedListener listener) |
Adds a listener to listen for page change events.
|
int |
getCount() |
Obtains the number of indicator items.
|
Element[] |
getItemElements() |
Obtains the
Element object of each selected and deselected indicator item. |
Element |
getItemNormalElement() |
Obtains the
Element object of the indicator of a non-selected item. |
int |
getItemOffset() |
Obtains the offset between indicator items.
|
Element |
getItemSelectedElement() |
Obtains the
Element object of the indicator of a selected item. |
int |
getOnSelectionChangedListenerCount() |
Obtains the number of added
PageSlider.PageChangedListener listeners. |
int |
getPageChangedListenerCount() |
Obtains the number of added
PageSlider.PageChangedListener listeners. |
PageSlider |
getPageSlider() |
Obtains an associated
PageSlider object. |
int |
getSelected() |
Obtains the position of a selected indicator item.
|
void |
removeOnSelectionChangedListener(PageSlider.PageChangedListener listener) |
Removes the
PageSlider.PageChangedListener. |
void |
removePageChangedListener(PageSlider.PageChangedListener listener) |
Removes the
PageSlider.PageChangedListener. |
void |
setHeight(int height) |
Sets the height of a component.
|
void |
setItemElement(Element normal,
Element selected) |
Sets the
Element object for each selected and deselected indicator item. |
void |
setItemNormalElement(Element normal) |
Sets the
Element object for the indicator of a non-selected item. |
void |
setItemOffset(int offset) |
Sets the offset between indicator items.
|
void |
setItemSelectedElement(Element selected) |
Sets the
Element object for the indicator of a selected item. |
void |
setPadding(int left,
int top,
int right,
int bottom) |
Sets the padding of the component.
|
void |
setPageSlider(PageSlider pageSlider) |
Associates an indicator item with a
PageSlider object. |
void |
setSelected(int pos) |
Sets the position of a selected indicator item.
|
void |
setViewPager(PageSlider pageSlider) |
Associates an indicator item with a
PageSlider object. |
void |
setWidth(int width) |
Sets the width of a component.
|
addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, dispatchRestoreState, dispatchSaveState, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, findComponentById, findComponentHolderById, findFocus, findNextFocusableComponent, findRequestNextFocus, getAccessibility, getAccessibilityDescription, getAlpha, getAltitude, getBackgroundElement, getBaseLine, getBottom, getBoundaryFadeEffectBottomRate, getBoundaryFadeEffectLeftRate, getBoundaryFadeEffectRightRate, getBoundaryFadeEffectTopRate, getCenterZoomFactor, getCentralScrollMode, getClickedListener, getClipEnabled, getComponentDescription, getComponentMinSize, getComponentParent, getComponentPosition, getComponentSize, getComponentStateChangedListener, getComponentTreeObserver, getContentEnable, getContentPosition, getContentPositionX, getContentPositionY, getContext, getContour, getContourRefreshedListener, getCornerMark, getDragAcceptAngle, getDraggedListener, getEditEventListener, getEstimatedHeight, getEstimatedWidth, getFadeEffectBoundaryWidth, getFadeEffectColor, getFocusable, getFocusBorderEnable, getFocusBorderPadding, getFocusBorderRadius, getFocusBorderWidth, getForegroundElement, getForegroundGravity, getForwardHoverListener, getForwardTouchListener, getGesturePriority, getHeight, getHorizontalPadding, getHorizontalPosition, getHoverEventListener, getId, getKeyEventListener, getLayoutConfig, getLayoutDirection, getLayoutDirectionResolved, getLayoutRefreshedListener, getLeft, getLocationOnScreen, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, getMatrix, getMinHeight, getMinWidth, getMode, getModeResolved, getMouseEventListener, getMousePointerStyleListener, getName, getPadding, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPivot, getPivotX, getPivotY, getResourceManager, getRight, getRotation, getRotationEventListener, getRotationSensitivity, getScale, getScaledListener, getScaleX, getScaleY, getScrollbarBackgroundColor, getScrollbarColor, getScrollbarFadingDelay, getScrollbarFadingDuration, getScrollBarMode, getScrollbarRadius, getScrollbarRoundRect, getScrollbarStartAngle, getScrollbarSweepAngle, getScrollbarThickness, getScrollState, getScrollValue, getSelfVisibleRect, getShadowColor, getSpeechEventListener, getTag, getTop, getTouchEventListener, getTransitionSymbol, getTranslation, getTranslationX, getTranslationY, getTranslationZ, getUserNextFocus, getVerticalPadding, getVerticalPosition, getVisibility, getVisibleRectOnScreen, getWidth, getWindowVisibleRect, hasFocus, hasFocusedEffect, hasOverlaps, hideFocusBorder, informConfigurationChanged, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onDrag, onRestoreState, onRtlChanged, onSaveState, performScale, playSound, postLayout, refreshContour, release, removeBindStateChangedListener, removeScrolledListener, requestFocus, requestForceForwardTouchEvent, restoreComponentTreeState, saveComponentTreeState, scrollBy, scrollTo, setAccessibility, setAccessibilityDescription, setAlpha, setAltitude, setBackground, setBindStateChangedListener, setBottom, setBoundaryFadeEffectEnable, setCanAcceptScrollListener, setCenterZoomFactor, setCentralScrollMode, setClickable, setClickedListener, setClipEnabled, setClipToContourEnabled, setComponentDescription, setComponentMinSize, setComponentPosition, setComponentPosition, setComponentSize, setComponentStateChangedListener, setContentEnable, setContentPosition, setContentPositionX, setContentPositionY, setContour, setContourRefreshedListener, setDoubleClickedListener, setDragAcceptAngle, setDraggedListener, setEditEventListener, setEnabled, setEstimatedSize, setEstimateSizeListener, setFadeEffectBoundaryWidth, setFadeEffectColor, setFocusable, setFocusBorderEnable, setFocusBorderPadding, setFocusBorderRadius, setFocusBorderRadius, setFocusBorderWidth, setFocusChangedListener, setFocusedEffect, setForeground, setForegroundGravity, setForwardHoverListener, setForwardTouchListener, setGesturePriority, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMode, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPaddingBottom, setPaddingLeft, setPaddingRelative, setPaddingRight, setPaddingTop, setPivot, setPivot, setPivotX, setPivotY, setPosition, setPositionX, setPositionY, setPressState, setRight, setRotation, setRotationEventListener, setRotationSensitivity, setScale, setScaledListener, setScaleX, setScaleY, setScrollbarBackgroundColor, setScrollbarColor, setScrollbarFadingDelay, setScrollbarFadingDuration, setScrollbarFadingEnabled, setScrollBarMode, setScrollbarOverlapEnabled, setScrollbarRadius, setScrollbarRoundRect, setScrollbarStartAngle, setScrollbarSweepAngle, setScrollbarThickness, setScrolledListener, setSelected, setShadowColor, setShadowStyle, setSoundEnable, setSpeechEventListener, setTag, setTop, setTouchEventListener, setTouchFocusable, setTransitionSymbol, setTranslation, setTranslationX, setTranslationY, setTranslationZ, setUnconsumedKeyEventListener, setUserNextFocus, setVerticalPadding, setVerticalPosition, setVibrationEffectEnabled, setVisibility, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEventspublic PageSliderIndicator(Context context)
PageSliderIndicator instance by using the default attribute set and
style.context - Indicates the application context.public PageSliderIndicator(Context context, AttrSet attrSet)
PageSliderIndicator instance by using specified attribute set and default
style after the XML file is parsed.context - Indicates the application context.attrSet - Indicates the attribute set to be used.public PageSliderIndicator(Context context, AttrSet attrSet, String styleName)
PageSliderIndicator instance by using specified attribute set
and specified style after the XML file is parsed.context - Indicates the application context.attrSet - Indicates the attribute set to be used.styleName - Indicates the style name to use.public void setPageSlider(PageSlider pageSlider)
PageSlider object.pageSlider - Indicates the PageSlider object to be associated.public PageSlider getPageSlider()
PageSlider object.PageSlider object if any; returns null otherwise.public void setViewPager(PageSlider pageSlider)
PageSlider object.pageSlider - Indicates the PageSlider object to be associated.public void addPageChangedListener(PageSlider.PageChangedListener listener)
The listener receives a notification when the selected page in PageSlider is changed.
listener - Indicates the listener used to listen for page change events.public void removePageChangedListener(PageSlider.PageChangedListener listener)
PageSlider.PageChangedListener.listener - Indicates the listener which have to be removed.public void addOnSelectionChangedListener(PageSlider.PageChangedListener listener)
The listener receives a notification when the selected page in PageSlider is changed.
listener - Indicates the listener used to listen for page change events.public void removeOnSelectionChangedListener(PageSlider.PageChangedListener listener)
PageSlider.PageChangedListener.listener - Indicates the listener which have to be removed.public int getPageChangedListenerCount()
PageSlider.PageChangedListener listeners.PageSlider.PageChangedListener listeners.public int getOnSelectionChangedListenerCount()
PageSlider.PageChangedListener listeners.PageSlider.PageChangedListener listeners.public int getCount()
public void setSelected(int pos)
pos - Indicates the position of the selected indicator item.public int getSelected()
public void setItemElement(Element normal, Element selected)
Element object for each selected and deselected indicator item.public void setItemNormalElement(Element normal)
Element object for the indicator of a non-selected item.normal - Indicates the Element object to set.public void setItemSelectedElement(Element selected)
Element object for the indicator of a selected item.selected - Indicates the Element object to set.public Element[] getItemElements()
Element object of each selected and deselected indicator item.Element object of each selected and deselected indicator item.setItemElement(Element, Element)public Element getItemNormalElement()
Element object of the indicator of a non-selected item.Element object.setItemNormalElement(Element)public Element getItemSelectedElement()
Element object of the indicator of a selected item.Element object.setItemSelectedElement(Element)public void setItemOffset(int offset)
offset - Indicates the offset between indicator items.public int getItemOffset()
public void setWidth(int width)
ComponentThis method modifies the width in the LayoutConfig object associated with the component.The actual
effect varies depending on the parent layout type.
public void setHeight(int height)
ComponentThis method modifies the height in the LayoutConfig object associated with the component. The
actual effect varies depending on the parent layout type.
public void setPadding(int left,
int top,
int right,
int bottom)
ComponentA component reserves the spaces for the paddings on all four sizes before drawing itself.
setPadding 在类中 Componentleft - Indicates the left padding in pixels.top - Indicates the top padding in pixels.right - Indicates the right padding in pixels.bottom - Indicates the bottom padding in pixels.