ComponentParentpublic class PageFlipper extends StackLayout
The page flipper provides the flipping effect when PageFlipper animates two or more
child components during their switching. It can also automatically flip through added child components at
a scheduled period.
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.VoiceEventComponentContainer.ArrangeListenerStackLayout.LayoutConfigACCESSIBILITY_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, VISIBLEFOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener| 构造器 | 说明 |
|---|---|
PageFlipper(Context context) |
Default constructor used to create a
PageFlipper instance by using the default attribute set and style. |
PageFlipper(Context context,
AttrSet attrSet) |
A constructor used to create a
PageFlipper instance by using specified attribute set and default
style after the XML file is parsed. |
PageFlipper(Context context,
AttrSet attrSet,
String styleName) |
A constructor used to create a
PageFlipper instance by using specified attribute set and specified
style after the XML file is parsed. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addComponent(Component component) |
Adds a component to the end of the queue by invoking
ComponentContainer.addComponent(ohos.agp.components.Component,int index) internally. |
Component |
getCurrentComponent() |
Obtains the currently displayed child component.
|
int |
getCurrentIndex() |
Obtains the index of the currently displayed child component.
|
int |
getFlipInterval() |
已过时。
This change is effective since API version 5. Replaced by
getFlipPeriod() |
int |
getFlipPeriod() |
Obtains the interval for flipping to the next child component, in milliseconds.
|
AnimatorProperty |
getIncomingAnimation() |
Obtains the animation effect used when the component enters the screen.
|
AnimatorProperty |
getOutgoingAnimation() |
Obtains the animation effect used when the component exits the screen.
|
boolean |
isFlipping() |
Obtains the flipping status of the current child component.
|
void |
removeAllComponents() |
Clears all components managed by
ComponentContainer. |
void |
removeComponent(Component component) |
Removes a child component from the parent component.
|
void |
removeComponentAt(int index) |
Removes a child component based on its index.
|
void |
removeComponents(int start,
int count) |
Removes child components in batches based on the specified start index and quantity.
|
void |
setCurrentIndex(int index) |
Sets the index of the currently displayed child component.
|
void |
setFlipInterval(int interval) |
已过时。
This change is effective since API version 5. Replaced by
setFlipPeriod(int) |
void |
setFlipPeriod(int period) |
Sets the interval for flipping to the next child component, in milliseconds.
|
void |
setIncomingAnimation(AnimatorProperty animatorProperty) |
Sets the animation effect to be used when the component enters the screen.
|
void |
setOutgoingAnimation(AnimatorProperty animatorProperty) |
Sets the animation effect to be used when the component exits the screen.
|
void |
showNext() |
Displays the next child component by triggering a manual switchover.
|
void |
showPrevious() |
Displays the previous child component by triggering a manual switchover.
|
void |
startFlipping() |
Starts a timer and flips through the added child components circularly.
|
void |
stopFlipping() |
Stops the timer for automatically flipping through the added child components circularly.
|
addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, 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, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, 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, setHeight, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMode, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPadding, 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, setWidth, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEventsaddComponent, addComponent, addComponent, addComponent, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeComponentById, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitablegetComponentParent, postLayoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateLayoutConfig, verifyLayoutConfigpublic PageFlipper(Context context)
PageFlipper instance by using the default attribute set and style.context - Indicates the application context.public PageFlipper(Context context, AttrSet attrSet)
PageFlipper 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 PageFlipper(Context context, AttrSet attrSet, String styleName)
PageFlipper 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 to be used.public void addComponent(Component component)
ComponentContainer.addComponent(ohos.agp.components.Component,int index) internally.addComponent 在类中 ComponentContainercomponent - Indicates the child component to add.public Component getCurrentComponent()
public int getCurrentIndex()
public void setCurrentIndex(int index)
index - Indicates the index to set.IllegalArgumentException - if index is negative.public void showNext()
public void showPrevious()
public void removeAllComponents()
ComponentContainer.public void removeComponent(Component component)
removeComponent 在接口中 ComponentParentremoveComponent 在类中 ComponentContainercomponent - Indicates the child component to remove.public void removeComponentAt(int index)
removeComponentAt 在接口中 ComponentParentremoveComponentAt 在类中 ComponentContainerindex - Indicates the index of the child component to remove.public void removeComponents(int start,
int count)
removeComponents 在接口中 ComponentParentremoveComponents 在类中 ComponentContainerstart - Indicates the start index of the child components to remove.count - Indicates the quantity of the child components to remove.public AnimatorProperty getIncomingAnimation()
public void setIncomingAnimation(AnimatorProperty animatorProperty)
animatorProperty - Indicates the animation effect to set.public AnimatorProperty getOutgoingAnimation()
public void setOutgoingAnimation(AnimatorProperty animatorProperty)
animatorProperty - Indicates the animation effect to set.public int getFlipPeriod()
public void setFlipPeriod(int period)
period - Indicates the interval to set. A negative value is taken as 0.@Deprecated public int getFlipInterval()
getFlipPeriod()@Deprecated public void setFlipInterval(int interval)
setFlipPeriod(int)interval - Indicates the interval for flipping to the next child component.
Note: the negative interval value considered as equals to 0.public void startFlipping()
public void stopFlipping()
public boolean isFlipping()
True if the component is flipping; returns False otherwise.