鸿蒙OS开发文档 第23页
Rating java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ProgressBar |—|—|—ohos.agp.components.AbsSlider |—|—|—|—ohos.agp.components.Rating public class Rating extends AbsSlider 提供带有评级项目的评级,例如星级或任何其他元素。 此类提供带有评级项目(如星号(或元素))的评级,以表示评级级别。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static interface Rating.RatingChangedListener 回调以处理评级的更改事件。 从类 ohos.agp.components.AbsSlider 继承的嵌套类/接口 AbsSlider.Formatter 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 从类 ohos.agp.components.ProgressBar 继承的嵌套类/接口 ProgressBar.BarObserver 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 构造函数摘要 构造函数 描述 Rating(Context context) 用于使用默认属性集和样式创建 Rating 实例的默认构造函数。 Rating(Context context, AttrSet attrSet) 用于在解析 XML 文件后使用指定的属性集和默认样式创建 Rating 实例的构造函数。 Rating(Context context, AttrSet attrSet, String styleName) 用于在解析 XML 文件后使用指定的属性集和指定样式创建 Rating 实例的构造函数。 方法总结 修饰符和类型 方法 描述 Element getFilledElement() 从评分项中获取填充元素。 float getGrainSize() 获取评级项目的步长(粒度)。 Element getHalfFilledElement() 从评分项中获取半填充元素。 int getRatingItems() 获取当前评分项的数量。 float getScore() 获取当前评分。 Element getThumbElement() 获取当前元素拇指。 Element getUnfilledElement() 从评分项中获取未填充的元素。 boolean isOperable() 检查评级是否不可操作。 void setFilledElement(Element element) 将指定的 Element 对象设置为评级项目的填充元素。 void setGrainSize(float size) 设置评级项目的步长。 void setHalfFilledElement(Element element) 将指定的 Element 对象设置为评级项目的半填充元素。 void setIsOperable(boolean isOperable) 设置评级是否不可操作。 void setRatingChangedListener(Rating.RatingChangedListener listener) 设置更改侦听器以处理评级的更改事件。 void setRatingItems(int numberItems) 设置由星号或其他符号表示的评级项目的数量以表示评级级别。 void setScore(float score) 设置评分。 void setThumbElement(Element element) 设置元素拇指。 void setUnfilledElement(Element element) 将指定的 Element 对象设置为评级项目的未填充元素。 从类 ohos.agp.components.AbsSlider 继承的方法 getFormatter, setFormatter 从类 ohos.agp.components.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, 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, unsubscribeVoiceEvents 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从类 ohos.agp.components.ProgressBar 继承的方法 addBarObserver, enableDividerLines, getBackgroundInstructElement, getDividerLineColor, getDividerLinesNumber, getDividerLineThickness, getInfiniteModeElement, getMax, getMaxHeight, getMaxWidth, getMin, getOrientation, getProgress, getProgressColor, getProgressColors, getProgressElement, getProgressHintText, getProgressHintTextAlignment, getProgressHintTextColor, getProgressHintTextSize, getProgressWidth, getStep, getViceProgressElement, getViceProgressValue, isDividerLinesEnabled, isIndeterminate, isInfiniteMode, removeBarObserver, setDividerLineColor, setDividerLinesNumber, setDividerLineThickness, setIndeterminate, setInfiniteModeElement, setMaxHeight, setMaxValue, setMaxWidth, setMinValue, setOrientation, setProgressBackgroundElement, setProgressColor, setProgressColors, setProgressElement, setProgressHintText, setProgressHintTextAlignment, setProgressHintTextColor, setProgressHintTextSize, setProgressValue, setProgressWidth, setStep, setViceProgress, setViceProgressElement 构造函数详细信息...
RadioContainer java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.DirectionalLayout |—|—|—|—ohos.agp.components.RadioContainer public class RadioContainer extends DirectionalLayout 创建一组表示一系列独占选项的单选按钮。 选择单选组中的一个单选按钮将自动取消选择同一组中的其他单选按钮。 默认情况下,取消选择组中的所有单选按钮。 无法取消选择已选择的单选按钮,但可以清除单选组以取消该单选按钮的选中状态。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static interface RadioContainer.CheckedStateChangedListener 提供回调方法来处理单选按钮容器的更改事件。 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 从类 ohos.agp.components.ComponentContainer 继承的嵌套类/接口 ComponentContainer.ArrangeListener 从类 ohos.agp.components.DirectionalLayout 继承的嵌套类/接口 DirectionalLayout.LayoutConfig 字段摘要 修饰符和类型 字段 描述 static int INVALID_ID 表示无效的 id。 protected RadioContainer.CheckedStateChangedListener mMarkListener 指示单选组中单选按钮更改事件的侦听器。 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 构造函数摘要 构造函数 描述 RadioContainer(Context context) 用于使用默认属性集和样式创建 RadioContainer 实例的默认构造函数。 RadioContainer(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 RadioContainer 实例的构造函数。 RadioContainer(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定样式创建 RadioContainer 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void cancelMarks() 清除单选组中所有单选按钮的选定状态。 RadioContainer.CheckedStateChangedListener getMarkChangedListener() 获取监听此 RadioContainer 中单选按钮更改事件的监听器。 int getMarkedButtonId() 获取单选组中选中单选按钮的ID。 void mark(int id) 选择其 ID 在参数中传递的单选按钮。 void setMarkChangedListener(RadioContainer.CheckedStateChangedListener listener) 为单选容器中单选按钮的更改事件设置侦听器。 从类 ohos.agp.components.Component 继承的方法 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, unsubscribeVoiceEvents 从类 ohos.agp.components.ComponentContainer 继承的方法 addComponent, addComponent, addComponent, addComponent, addComponent, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeAllComponents, removeComponent, removeComponentAt, removeComponentById, removeComponents, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitable 从接口 ohos.agp.components.ComponentParent 继承的方法 getComponentParent, postLayout 从类 ohos.agp.components.DirectionalLayout 继承的方法 createLayoutConfig, getAlignment, getOrientation, getTotalWeight, isLayoutBaselined, setAlignment, setLayoutBaselined, setOrientation, setTotalWeight, verifyLayoutConfig 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 INVALID_ID public static final int INVALID_ID 表示无效的 id。 使用此值可清除单选组中所有单选按钮的选定状态。 见标记(int)。 mMarkListener protected RadioContainer.CheckedStateChangedListener mMarkListener 指示单选组中单选按钮更改事件的侦听器。 构造函数详细信息 RadioContainer...
RadioButton java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Text |—|—|—ohos.agp.components.Button |—|—|—|—ohos.agp.components.AbsButton |—|—|—|—|—ohos.agp.components.RadioButton public class RadioButton extends AbsButton 提供一个单选按钮,可以选择或取消选择。 如果未选择单选按钮,您可以单击或按下它来选择它。 但是,如果已选择单选按钮,则无法再次单击它以取消选择它。 这与复选框不同。 多个 RadioButton 实例通常用于 RadioContainer 实例。 如果 RadioContainer 包含多个 RadioButton 实例,选择一个单选按钮将自动取消选择其他单选按钮。 Since: 1 嵌套类摘要 从类 ohos.agp.components.AbsButton 继承的嵌套类/接口 AbsButton.CheckedStateChangedListener 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 从类 ohos.agp.components.Text 继承的嵌套类/接口 Text.ConversionType, Text.EditorActionListener, Text.FontFamilyType, Text.TextColorObserver, Text.TextObserver, Text.TextSizeObserver, Text.TextSizeType, Text.TruncationMode 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 从类 ohos.agp.components.Text 继承的字段 AUTO_CURSOR_POSITION, AUTO_SCROLLING_FOREVER 构造函数摘要 构造函数 描述 RadioButton(Context context) 用于使用默认属性集和样式创建 RadioButton 实例的默认构造函数。 RadioButton(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 RadioButton 实例的构造函数。 RadioButton(Context context, AttrSet attrSet, String styleName) 一个构造函数,用于在解析 XML 文件后使用指定的属性集和指定的样式创建 RadioButton 实例。 方法总结 修饰符和类型 方法 描述 void setTextColor(Color color) 已弃用。 此更改从 API 版本 8 开始生效。替换为 setTextColorOff(Color) 和 setTextColorOn(Color) 从类 ohos.agp.components.AbsButton 继承的方法 getButtonElement, getTextColorOff, getTextColorOn, isChecked, setButtonElement, setChecked, setCheckedStateChangedListener, setTextColorOff, setTextColorOn, toggle 从类 ohos.agp.components.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, 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, 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, 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, unsubscribeVoiceEvents 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从类 ohos.agp.components.Text 继承的方法 addTextObserver, adjustCursorPosition, append, delete, delete, delete, getAdditionalLineSpacing, getAroundElements, getAroundElementsPadding, getAroundElementsRelative, getAutoFontSizeRule, getAutoFontSizeStep, getAutoScrollingCount, getAutoScrollingDuration, getBaseLine, getBottomElement, getBottonElement, getBoundingRect, getBubbleElement, getBubbleHeight, getBubbleWidth, getCombinedPaddingBottom, getCombinedPaddingEnd, getCombinedPaddingLeft, getCombinedPaddingRight, getCombinedPaddingStart, getCombinedPaddingTop, getCursorElement, getCustomInputMethodOptions, getEditableString, getEditingText, getEditorAction, getEditorActionText, getEndElement, getExtraInputData, getFadeEffectBoundaryWidth, getFont, getFontFamilyType, getFontFeatures, getFontVariations, getHint, getHintColor, getHyphenationStrategy, getInputFilters, getInputMethodLocales, getInputMethodOption, getJustifyStrategy, getLeftElement, getLetterSpacing, getLineBreakStrategy, getLineCount, getLineHeight, getLocales, getMaxAutoFontSize, getMaxTextHeight, getMaxTextLines, getMaxTextWidth, getMaxWidthInEms, getMinAutoFontSize, getMinTextHeight, getMinTextLines, getMinTextWidth, getMinWidthInEms, getNumOfFontHeight, getOffsetByCoordinates, getPaddingForText, getPrimaryLocale, getRichText, getRightElement, getSelectionColor, getSelectionEnd, getSelectionLeftBubbleElement, getSelectionLeftBubbleHeight, getSelectionLeftBubbleWidth, getSelectionRightBubbleElement, getSelectionRightBubbleHeight, getSelectionRightBubbleWidth, getSelectionStart, getStartElement, getText, getTextAlignment, getTextColor, getTextConversion, getTextDirectionStrategy, getTextHorizontalScale, getTextInputType, getTextShadowColor, getTextShadowOffsetX, getTextShadowOffsetY, getTextShadowRadius, getTextSize, getTextSize, getTextToBottomSpace, getTextToTopSpace, getTopElement, getTruncationMode, getUrls, insert, insert, isAdjustInputPanel, isAllUpperCase, isAutoFontSize, isAutoSelectEnabled, isEditable, isFallbackFontMetricsEnabled, isFocusedByTouch, isHyperLinkClickable, isInputMethodActive, isMultipleLine, isScrollable, isSoftInputVisibleOnFocus, isTextCursorVisible, isTextSelectable, length, lockEditingState, moveToPosition, onCustomInputMethodCommand, onLockEditingState, onRtlChanged, onTextEditorAction, onUnlockEditingState, removeTextObserver, setAdjustInputPanel, setAroundElements, setAroundElementsPadding, setAroundElementsRelative, setAutoCursorAdjustmentEnabled, setAutoFontSize, setAutoFontSize, setAutoFontSizeRule, setAutoFontSizeRule, setAutoScrollingCount, setAutoScrollingDuration, setAutoSelectEnabled, setBubbleElement, setBubbleElement, setBubbleHeight, setBubbleSize, setBubbleWidth, setCursorElement, setCursorElement, setCursorPosition, setCustomInputMethodOptions, setEditable, setEditorActionListener, setEditorActionText, setExtraInputData, setFadeEffectBoundaryWidth, setFallbackFontMetricsEnabled, setFont, setFontFamilyType, setFontFeatures, setFontVariations, setHint, setHint, setHintColor, setHyperLinkClickable, setHyperLinkColor, setHyphenationStrategy, setInputFilters, setInputMethodLocales, setInputMethodOption, setJustifyStrategy, setLeftBubbleHeight, setLeftBubbleSize, setLeftBubbleWidth, setLetterSpacing, setLineBreakStrategy, setLineHeight, setLines, setLineSpacing, setLocales, setMaxCharacters, setMaxTextHeight, setMaxTextLines, setMaxTextWidth, setMaxWidthInEms, setMinTextHeight, setMinTextLines, setMinTextWidth, setMinWidthInEms, setMultipleLine, setPaddingForText, setPrimaryLocale, setRichText, setRightBubbleHeight, setRightBubbleSize, setRightBubbleWidth, setScrollable, setSelection, setSelectionColor, setSelectionLeftBubbleElement, setSelectionLeftBubbleElement, setSelectionRightBubbleElement, setSelectionRightBubbleElement, setSoftInputVisibleOnFocus, setText, setText, setTextAlignment, setTextConversion, setTextCursorVisible, setTextDirectionStrategy, setTextHeight, setTextHorizontalScale, setTextInputType, setTextSelectable, setTextShadow, setTextSize, setTextSize, setTextWidth, setTextWidthInEms, setTruncationMode, startAutoScrolling, stopAutoScrolling, unlockEditingState 构造函数详细信息 RadioButton public RadioButton(Context context) 用于使用默认属性集和样式创建 RadioButton 实例的默认构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 RadioButton public RadioButton(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 RadioButton 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 RadioButton public RadioButton(Context context, AttrSet attrSet, String...
ProgressBar java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ProgressBar public class ProgressBar extends Component 提供用于指示 UI 上操作的进度的元素。 进度条支持确定类型和不确定类型。 进度条显示在 UI 或通知中,不会打扰用户。 不确定的进展 当操作所需的时间不确定时,使用不确定的进度条。 确定进度 当您需要显示操作的具体进度量时,使用确定进度条。 您可以使用 setProgressValue(int) 函数来更新当前进度。 默认情况下,当进度条上显示的进度值达到 100 时,操作完成。 Since: 1 嵌套类摘要 修饰符和类型 类 描述 static interface ProgressBar.BarObserver 提供一个文本观察器来监听组件中进度条的变化。 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 构造函数摘要 构造函数 描述 ProgressBar(Context context) 用于使用默认属性集和样式创建 ProgressBar 实例的默认构造函数。 ProgressBar(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 ProgressBar 实例的构造函数。 ProgressBar(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 ProgressBar 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addBarObserver(ProgressBar.BarObserver observer) 添加一个 BarObserver 来监控这个进度条的变化。 void enableDividerLines(boolean enable) 设置进度条的分隔符状态。 Element getBackgroundInstructElement() 获取用作进度条背景的 Element 对象。 Color getDividerLineColor() 获取分隔线颜色。 int getDividerLinesNumber() 获取此进度条的分隔线数。 int getDividerLineThickness() 获取分隔线粗细。 Element getInfiniteModeElement() 获取用于绘制不确定进度条的元素对象。 int getMax() 获取确定进度条的上限。 int getMaxHeight() 获取进度条的最大高度。 int getMaxWidth() 获取进度条的最大宽度。 int getMin() 获取确定进度条的下限。 int getOrientation() 获取进度条方向。 int getProgress() 获取进度条的当前进度值。 Color getProgressColor() 获取此进度条的颜色。 int[] getProgressColors() 获取用于绘制此进度条的 ShapeElement 对象的填充颜色。 Element getProgressElement() 获取用作进度条的 Element 对象。 String getProgressHintText() 获取进度条上的提示文本。 int getProgressHintTextAlignment() 获取进度条上的提示文本对齐方式。 Color getProgressHintTextColor() 获取进度条上的提示文本颜色。 int getProgressHintTextSize() 获取此进度条上提示文本的大小。 int getProgressWidth() 获取此进度条的最大宽度。...
PositionLayout java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.PositionLayout public class PositionLayout extends ComponentContainer 提供一个位置布局,指定其中子组件的位置(X/Y 坐标)。 由于使用了绝对定位,位置布局不太灵活且更难维护。 Since: 3 嵌套类摘要 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 从类 ohos.agp.components.ComponentContainer 继承的嵌套类/接口 ComponentContainer.ArrangeListener, ComponentContainer.LayoutConfig 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 构造函数摘要 构造函数 描述 PositionLayout(Context context) 用于使用默认属性集和样式创建 PositionLayout 实例的默认构造函数。 PositionLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 PositionLayout 实例的构造函数。 PositionLayout(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 PositionLayout 实例的构造函数。 方法总结 从类 ohos.agp.components.Component 继承的方法 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, unsubscribeVoiceEvents 从类 ohos.agp.components.ComponentContainer 继承的方法 addComponent, addComponent, addComponent, addComponent, addComponent, createLayoutConfig, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeAllComponents, removeComponent, removeComponentAt, removeComponentById, removeComponents, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitable, verifyLayoutConfig 从接口 ohos.agp.components.ComponentParent 继承的方法 getComponentParent, postLayout 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 PositionLayout public PositionLayout(Context context) 用于使用默认属性集和样式创建 PositionLayout 实例的默认构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 PositionLayout public PositionLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 PositionLayout 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 PositionLayout public PositionLayout(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 PositionLayout 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 styleName 指示要使用的样式名称。
Picker java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.DirectionalLayout |—|—|—|—ohos.agp.components.Picker public class Picker extends DirectionalLayout 提供一个数字选择器,允许从预定义的范围中选择数字。 该类配置数字选择器的属性,以便用户可以在屏幕上的取值范围内选择特定的数字。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static interface Picker.ElementFormatter 为 Picker 的每一项格式化左右复合元素对象。 static interface Picker.Formatter 格式化 Picker 的值并将其转换为字符串。 static interface Picker.ScrolledListener 处理 Picker 实例的滚动事件。 static interface Picker.ValueChangedListener 侦听 Picker 实例的值更改事件。 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 从类 ohos.agp.components.ComponentContainer 继承的嵌套类/接口 ComponentContainer.ArrangeListener 从类 ohos.agp.components.DirectionalLayout 继承的嵌套类/接口 DirectionalLayout.LayoutConfig 字段摘要 修饰符和类型 字段 描述 static float ROTATION_SENSITIVITY_DEFAULT 指示 Picker 响应旋转表冠事件的默认旋转灵敏度。 static float ROTATION_SENSITIVITY_HIGH 表示 Picker 响应旋转表冠事件的高旋转灵敏度。 static float ROTATION_SENSITIVITY_LOW 指示 Picker 响应旋转表冠事件的低旋转灵敏度。 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 构造函数摘要 构造函数 描述 Picker(Context context) 默认构造函数用于使用默认属性集和样式创建 Picker 实例。 Picker(Context context, AttrSet attrSet) 用于在解析 XML 文件后使用指定的属性集和默认样式创建 Picker 实例的构造函数。 Picker(Context context, AttrSet attrSet, String styleName) 用于在解析 XML 文件后使用指定的属性集和指定的样式创建 Picker 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getCompoundElementPadding() 获取文本和 Element 对象之间的填充。 Element getDisplayedBottomElement() 获取用于在选定数字底部绘制分割线的 Element 实例。 String[] getDisplayedData() 获取与要显示的数字匹配的字符串数组。 Element[] getDisplayedLinesElements() 获取用于在选定文本的顶部和底部绘制显示线条的 Element 实例。 Element getDisplayedTopElement() 获取用于在选定数字顶部绘制分割线的 Element 实例。 Picker.ElementFormatter getElementFormatter() 获取每个项目左右显示的Element的格式化程序。 Picker.Formatter getFormatter() 获取格式化显示内容的格式化程序。 int getMaxValue() 获取数字选择器的最大值。 int getMinValue() 获取数字选择器的最小值。 Color getNormalTextColor() 获取数字选择器上取消选择的文本的颜色。 Font getNormalTextFont() 获取此选取器中普通文本的字体。 int getNormalTextSize() 获取数字选择器上取消选择的文本的字体大小。 Picker.ScrolledListener getScrollListener() 获取监听picker滚动状态的监听器。 float getSelectedNormalTextMarginRatio() 获取此数字选择器中所选文本边距与正常文本边距的比率。 Element...
PageSliderProvider java.lang.Object |—ohos.agp.components.PageSliderProvider public abstract class PageSliderProvider extends Object 提供页面适配器来管理页面组件。 该类提供页面项管理功能,例如计算可用组件的数量,并在指定位置创建组件。 您需要继承并实现 PageSliderProvider 以在不同的页面上显示多个组件。 Since: 3 字段摘要 修饰符和类型 字段 描述 static int POSITION_INVALID 表示容器中的页面无效。 static int POSITION_REMAIN 表示页面在容器中的位置保持不变。 构造函数摘要 构造函数 描述 PageSliderProvider() 方法总结 修饰符和类型 方法 描述 void addDataSubscriber(DataSetSubscriber subscriber) 为当前的 Page Slider Provider 添加订阅者。 abstract Object createPageInContainer(ComponentContainer container, int position) 在指定位置创建页面。 abstract void destroyPageFromContainer(ComponentContainer container, int position, Object object) 销毁容器中的指定页面。 abstract int getCount() 获取当前适配器中可用组件的数量。 int getPageIndex(Object object) 获取容器中对象的索引。 String getPageTitle(int position) 获取页面在指定位置的标题。 abstract boolean isPageMatchToObject(Component page, Object object) 检查组件是否与从 createPageInContainer(ohos.agp.components.ComponentContainer,int) 返回的特定对象相关联。 void notifyDataChanged() 通知页面滑块提供程序数据集更改。 void onUpdateFinished(ComponentContainer componentContainer) 通知容器页面更新已完成。 void removeDataSubscriber(DataSetSubscriber subscriber) 从当前 PageSliderProvider 注销订阅者。 void startUpdate(ComponentContainer container) 收到通知,指示显示的页面上即将发生更新。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 POSITION_INVALID public static final int POSITION_INVALID 表示容器中的页面无效。 POSITION_REMAIN public static final int POSITION_REMAIN 表示页面在容器中的位置保持不变。 构造函数详细信息 PageSliderProvider public PageSliderProvider() 方法详情 getCount public abstract int getCount() 获取当前适配器中可用组件的数量。 返回: 返回可用组件的数量。 createPageInContainer public abstract Object createPageInContainer(ComponentContainer container, int position) 在指定位置创建页面。 页面被添加到容器中的指定位置。 参数: 参数名称 参数描述 container 指示要显示 PageSliderProvider 的容器。 position 表示容器中的指定位置。 返回: 返回显示的页面。 destroyPageFromContainer public...
PageSliderIndicator.IndicatorSelectionHandler java.lang.Object |—ohos.agp.database.Publisher<PageSlider.PageChangedListener& |—|—ohos.agp.components.PageSliderIndicator.IndicatorSelectionHandler protected static class PageSliderIndicator.IndicatorSelectionHandler extends Publisher<PageSlider.PageChangedListener> 处理选择 PageSlider 实例中包含的页面的事件。 该类用于监听和处理PageSlider中的页面选择变化事件,从而更新PageSliderIndicator所代表的与PageSlider关联的指标的显示。 Since: 5 字段摘要 从类 ohos.agp.database.Publisher 继承的字段 mSubscribers 构造函数摘要 修饰符 构造函数 描述 protected IndicatorSelectionHandler() 方法总结 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从类 ohos.agp.database.Publisher 继承的方法 registerSubscriber, unregisterSubscriber, unregisterSubscriber 构造函数详细信息 IndicatorSelectionHandler protected IndicatorSelectionHandler()
PageSliderIndicator java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.PageSliderIndicator public final class PageSliderIndicator extends Component 指示在 PageSlider 上选择了哪个页面。 如果一个 PageSlider 包含多个页面,可以将它与 PageSliderIndicator 关联,以便显示所选页面的指示器。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 protected static class PageSliderIndicator.IndicatorSelectionHandler 处理选择 PageSlider 实例中包含的页面的事件。 从类 ohos.agp.components.Component 继承的嵌套类/接口 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.VoiceEvent 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_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) 用于使用默认属性集和样式创建 PageSliderIndicator 实例的默认构造函数。 PageSliderIndicator(Context context, AttrSet attrSet) 用于在解析 XML 文件后使用指定的属性集和默认样式创建 PageSliderIndicator 实例的构造函数。 PageSliderIndicator(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 PageSliderIndicator 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addOnSelectionChangedListener(PageSlider.PageChangedListener listener) 添加侦听器以侦听页面更改事件。 void addPageChangedListener(PageSlider.PageChangedListener listener) 添加侦听器以侦听页面更改事件。 int getCount() 获取指标项数。 Element[] getItemElements() 获取每个选中和取消选中的指标项的 Element 对象。 Element getItemNormalElement() 获取未选中项的指标的 Element 对象。 int getItemOffset() 获取指标项之间的偏移量。 Element getItemSelectedElement() 获取选定项的指标的 Element 对象。 int getOnSelectionChangedListenerCount() 获取添加的 PageSlider.PageChangedListener 监听器的数量。 int getPageChangedListenerCount() 获取添加的 PageSlider.PageChangedListener 监听器的数量。 PageSlider getPageSlider() 获取关联的 PageSlider 对象。 int getSelected() 获取选中的指标项的位置。 void removeOnSelectionChangedListener(PageSlider.PageChangedListener listener) 删除 PageSlider.PageChangedListener。 void removePageChangedListener(PageSlider.PageChangedListener listener) 删除 PageSlider.PageChangedListener。 void setHeight(int height) 设置组件的高度。 void setItemElement(Element normal, Element selected) 为每个选定和取消选定的指示器项设置 Element 对象。 void setItemNormalElement(Element normal) 为未选中项的指示器设置 Element 对象。 void setItemOffset(int offset) 设置指标项之间的偏移量。 void setItemSelectedElement(Element selected) 为选定项的指示器设置 Element 对象。 void setPadding(int left, int top, int right, int bottom) 设置组件的填充。 void setPageSlider(PageSlider pageSlider) 将指示器项与 PageSlider 对象相关联。 void setSelected(int pos) 设置选定指标项的位置。 void setViewPager(PageSlider pageSlider) 将指示器项与 PageSlider 对象相关联。 void setWidth(int width) 设置组件的宽度。 从类 ohos.agp.components.Component...
PageSlider.ReboundEffectParams java.lang.Object |—ohos.agp.components.PageSlider.ReboundEffectParams public static class PageSlider.ReboundEffectParams extends Object 表示回弹效果参数。 Since: 4 构造函数摘要 构造函数 描述 ReboundEffectParams(int overscrollPercent, float overscrollRate, int remainVisiblePercent) 用于创建 ReboundEffectParams 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getOverscrollPercent() 获取 overscrollPercent 参数的值。 float getOverscrollRate() 获取 overscrollRate 参数的值。 int getRemainVisiblePercent() 获取保持可见百分比参数的值。 void setOverscrollPercent(int overscrollPercent) 设置 overscrollPercent 参数的值。 void setOverscrollRate(float overscrollRate) 设置 overscrollRate 参数的值。 void setRemainVisiblePercent(int remainVisiblePercent) 设置保持可见百分比参数的值。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 ReboundEffectParams public ReboundEffectParams(int overscrollPercent, float overscrollRate, int remainVisiblePercent) 用于创建 ReboundEffectParams 实例的构造函数。 参数: 参数名称 参数描述 overscrollPercent 表示过度滚动百分比(默认值:40)。 如果滚动内容的百分比超过该参数的值,则内容滚动速度受 overscrollRate 参数的影响。 具体来说,如果 overscrollRate 的值小于 1.0,则您的手指移动速度快于内容。 overscrollRate 表示过度滚动率(默认值:0.6)。 如果滚动内容的百分比超过 overscrollPercent 参数的值,此参数会影响内容滚动速度。 具体来说,内容滚动速度等于手指滚动速度乘以overscrollRate的值。 remainVisiblePercent 指示在过度滚动期间应保持可见的可滚动内容的最小百分比。 默认值为 20。 Since: 4 方法详情 getOverscrollPercent public int getOverscrollPercent() 获取 overscrollPercent 参数的值。 如果滚动内容的百分比超过此参数的值(默认值:40),则内容滚动速度受 overscrollRate 参数的影响。 如果 overscrollRate 的值小于 1.0,则您的手指移动速度比内容快。 返回: 返回 overscrollPercent 的值。 Since: 4 getOverscrollRate public float getOverscrollRate() 获取 overscrollRate 参数的值。 如果滚动内容的百分比超过 overscrollPercent 参数的值,此参数会影响内容滚动速度。 具体来说,内容滚动速度等于手指滚动速度乘以overscrollRate的值(默认值:0.6)。 返回: 返回 overscrollRate 的值。 Since: 4 getRemainVisiblePercent public int getRemainVisiblePercent() 获取保持可见百分比参数的值。 此参数指示在过度滚动期间应保持可见的可滚动内容的最小百分比。 默认值为 20。 返回: 返回保持可见百分比的值。 Since: 4 setOverscrollPercent public void setOverscrollPercent(int...