优惠码 第36页 ListContainer java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.ListContainer public class ListContainer extends ComponentContainer implements Text.TextObserver 提供在屏幕上向上或向下滚动时显示的列表容器。 此类继承自 ComponentContainer。 它使用 BaseItemProvider 来存储对象。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static interface ListContainer.ItemClickedListener 侦听 ListContainer 项的单击事件。 static interface ListContainer.ItemLongClickedListener 提供用于侦听和处理 ListContainer 项的长按事件的侦听器。 static interface ListContainer.ItemSelectedListener 侦听 ListContainer 对象中组件项的选定事件。 static interface ListContainer.ItemVisibilityChangedListener 提供在将组件添加到可见项集中或从可见项集中删除时要调用的回调。 static class ListContainer.ReboundEffectParams 表示回弹效果参数。 static interface ListContainer.ScrollListener 表示用于监视 ListContainer 对象滚动结束的内部接口。 从类 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 字段摘要 修饰符和类型 字段 描述 static int INVALID_INDEX 指示无效索引。 static float ROTATION_SENSITIVITY_DEFAULT 指示 ListContainer 响应旋转表冠事件的默认旋转灵敏度。 static float ROTATION_SENSITIVITY_HIGH 表示 ListContainer 响应旋转表冠事件的高旋转灵敏度。 static float ROTATION_SENSITIVITY_LOW 指示 ListContainer 响应旋转表冠事件的低旋转灵敏度。 从类 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 构造函数摘要 构造函数 描述 ListContainer(Context context) 用于使用默认属性集和样式创建 ListContainer 实例的默认构造函数。 ListContainer(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 ListContainer 实例的构造函数。 ListContainer(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 ListContainer 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addComponent(Component childComponent) 通过在内部调用 ComponentContainer.addComponent(ohos.agp.components.Component,int index) 将组件添加到队列的末尾。 void addComponent(Component childComponent, int index) 将组件添加到指定位置。 void addComponent(Component childComponent, int width, int height) 添加一个组件并设置其宽度和高度。 void addComponent(Component childComponent, int index, ComponentContainer.LayoutConfig layoutConfig) 添加组件并设置其布局参数和位置。 void addComponent(Component childComponent, ComponentContainer.LayoutConfig layoutConfig) 添加一个组件并设置其布局参数。 void addItemVisibilityChangedListener(ListContainer.ItemVisibilityChangedListener listener) 将 ItemVisibilityChangedListener 添加到侦听器列表中。 boolean executeItemClick(Component component, int position, long id) 处理组件项的单击事件。 <T extends Component>T findComponentById(int id) 查找具有给定 ID 的组件。 Element getBoundary() 获取用作列表自定义边界的 Element 对象。 Color getBoundaryColor() 获取此 ListContainer 对象的边界颜色。 boolean getBoundarySwitch() 指定是否启用边界绘制。...
2024-04-03
ListComponent.ReboundEffectParams java.lang.Object |—ohos.agp.components.ListComponent.ReboundEffectParams public static class ListComponent.ReboundEffectParams extends Object 提供参数来实现反弹效果。 Since: 7 构造函数摘要 构造函数 描述 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。 方法详情 getOverscrollPercent public int getOverscrollPercent() 获取 overscrollPercent 的值。 返回: 返回 overscrollPercent 的值。 Since: 7 getOverscrollRate public float getOverscrollRate() 获取 overscrollRate 的值。 返回: 返回 overscrollRate 的值。 Since: 7 getRemainVisiblePercent public int getRemainVisiblePercent() 获取保持可见百分比的值。 返回: 返回保持可见百分比的值。 Since: 7 setOverscrollPercent public void setOverscrollPercent(int overscrollPercent) 设置 overscrollPercent 的值。 参数: 参数名称 参数描述 overscrollPercent 表示要设置的值。 该参数表示过度滚动百分比。 默认值为 40。如果滚动内容的百分比超过此参数的值,则内容滚动速度受 overscrollRate 参数的影响。 具体来说,如果 overscrollRate 的值小于 1.0,则您的手指移动速度快于内容。 Since: 7 setOverscrollRate public void setOverscrollRate(float overscrollRate)...
2024-04-03
ListComponent.OnFlingListener java.lang.Object |—ohos.agp.components.ListComponent.OnFlingListener public abstract static class ListComponent.OnFlingListener extends Object 实现监听。 Since: 7 构造函数摘要 构造函数 描述 OnFlingListener() 方法总结 修饰符和类型 方法 描述 abstract boolean onFlingDetected(int speedX, int speedY) 当检测到投掷时调用。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 OnFlingListener public OnFlingListener() 方法详情 onFlingDetected public abstract boolean onFlingDetected(int speedX, int speedY) 当检测到投掷时调用。 参数: 参数名称 参数描述 speedX 表示水平方向的抛掷速度,以像素/秒为单位。 speedY 表示垂直方向的抛掷速度,以像素/秒为单位。 返回: 如果处理了 fling,则返回 true; 否则返回 false。 Since: 7
2024-04-03
ListComponent.ListLayoutConfig java.lang.Object |—ohos.agp.components.ComponentContainer.LayoutConfig |—|—ohos.agp.components.ListComponent.ListLayoutConfig public static class ListComponent.ListLayoutConfig extends ComponentContainer.LayoutConfig 继承自 ComponentContainer.LayoutConfig 并提供方法使 ListComponent 中的组件能够访问对应的 ComponentOwner。 字段摘要 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的字段 height, MATCH_CONTENT, MATCH_PARENT, width 构造函数摘要 构造函数 描述 ListLayoutConfig() 用于创建 ListLayoutConfig 实例的默认构造函数。 ListLayoutConfig(int width, int height) 用于根据指定的宽度和高度创建 ListLayoutConfig 实例的构造函数。 ListLayoutConfig(ComponentContainer.LayoutConfig source) 用于基于现有 ComponentContainer.LayoutConfig 实例创建 ListLayoutConfig 实例的构造函数。 ListLayoutConfig(ListComponent.ListLayoutConfig source) 用于基于现有 ListLayoutConfig 实例创建 ListLayoutConfig 实例的构造函数。 ListLayoutConfig(Context context, AttrSet attrSet) 用于根据指定的属性集创建 ListLayoutConfig 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void applyToComponent(Component component) 将 LayoutConfig 应用到指定的组件。 ComponentOwner getComponentOwner() 获取此 ListLayoutConfig 对应的ComponentOwner。 boolean getFullLane() 检查此 ListLayoutConfig 对应的组件是否占据了砌体布局中的所有通道。 void setComponentOwner(ComponentOwner componentOwner) 设置组件所有者。 void setFullLane(boolean fullLane) 设置此 ListLayoutConfig 对应的组件是否占据砌体布局中的所有车道。 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的方法 clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginTop 从类 java.lang.Object 继承的方法 equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 ListLayoutConfig public ListLayoutConfig() 用于创建 ListLayoutConfig 实例的默认构造函数。 此实例的宽度和高度默认设置为 MATCH_CONTENT。 ListLayoutConfig public ListLayoutConfig(Context context, AttrSet attrSet) 用于根据指定的属性集创建 ListLayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 Since: 7 ListLayoutConfig public ListLayoutConfig(int width, int height) 用于根据指定的宽度和高度创建 ListLayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 width 表示宽度,以像素为单位。 该值可以是 ComponentContainer.LayoutConfig.MATCH_CONTENT 或 ComponentContainer.LayoutConfig.MATCH_PARENT。 height 表示高度,以像素为单位。 该值可以是 ComponentContainer.LayoutConfig.MATCH_CONTENT 或 ComponentContainer.LayoutConfig.MATCH_PARENT。 ListLayoutConfig public ListLayoutConfig(ComponentContainer.LayoutConfig source) 用于基于现有 ComponentContainer.LayoutConfig 实例创建 ListLayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 source 指示要使用的现有 ComponentContainer.LayoutConfig 实例。 Since: 7...
2024-04-03
ListComponent java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.ListComponent public class ListComponent extends ComponentContainer 一个容器类,用于显示可以在屏幕上上下滚动的列表。 嵌套类摘要 修饰符和类型 类 描述 static interface ListComponent.BounceBackListener 实现监听反弹状态的变化,包括反弹开始、反弹进行中、反弹结束。 static interface ListComponent.CachePolicyListener 实现监听以将组件添加到 ListComponentPool。 static class ListComponent.ListLayoutConfig 继承自 ComponentContainer.LayoutConfig 并提供方法使 ListComponent 中的组件能够访问对应的 ComponentOwner。 static interface ListComponent.OnComponentBoundStatusChangeListener 实现监听 ListComponent 的状态变化。 static class ListComponent.OnFlingListener 实现监听。 static class ListComponent.ReboundEffectParams 提供参数来实现反弹效果。 从类 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 字段摘要 修饰符和类型 字段 描述 static int HORIZONTAL 表示组件在 ListComponent 中水平排列。 static long INVALID_ID 表示 ListComponent 中的组件 ID 无效。 static int INVALID_POSITION 指示 ListComponent 中的无效组件位置。 static int INVALID_TYPE 表示 ListComponent 中的组件类型无效。 static int ITEM_TYPE_NO_SCALE_MASK 表示不使用比例。 static int ITEM_TYPE_NO_STICK_MASK 表示不使用摇杆。 static int LIST_SCROLL_STATE_DRAGGING 指示正在拖动 ListComponent。 static int LIST_SCROLL_STATE_IDLE 表示 ListComponent 处于空闲状态。 static int LIST_SCROLL_STATE_SETTLING 表示 ListComponent 正在被滑动。 static int UNDEFINED_DURATION 表示未定义滚动持续时间。 static int VERTICAL 表示组件在 ListComponent 中垂直排列。 从类 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, 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, VISIBLE 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 构造函数摘要 构造函数 描述 ListComponent(Context context) 用于根据默认属性集和样式创建 ListComponent 实例的构造函数。 ListComponent(Context context, AttrSet attrSet) 用于根据指定的属性集和默认样式创建 ListComponent 实例的构造函数。 ListComponent(Context context, AttrSet attrSet, String styleName) 用于根据指定的属性集和样式创建 ListComponent 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addBounceBackListener(ListComponent.BounceBackListener listener) 为反弹状态更改添加侦听器。 void addCachePolicyListener(ListComponent.CachePolicyListener listener) 为缓存策略添加侦听器。 void addComponent(Component childComponent) 通过在内部调用 ComponentContainer.addComponent(ohos.agp.components.Component,int index) 将组件添加到队列的末尾。 void addComponent(Component childComponent, int index) 将组件添加到指定位置。 void addComponent(Component childComponent, int width, int height) 添加一个组件并设置其宽度和高度。 void addComponent(Component childComponent, int index, ComponentContainer.LayoutConfig layoutConfig) 添加组件并设置其布局参数和位置。 void addComponent(Component childComponent, ComponentContainer.LayoutConfig layoutConfig) 添加一个组件并设置其布局参数。...
2024-04-03
LayoutScatter java.lang.Object |—ohos.agp.components.LayoutScatter public class LayoutScatter extends Object 提供组件转换工具。 您可以使用该工具在 XML 文件中定义一个组件,然后调用 parse(int, ohos.agp.components.ComponentContainer, boolean) 方法使用该文件生成一个 Component 对象。 嵌套类摘要 修饰符和类型 类 描述 static interface LayoutScatter.Picker 提供检查组件是否可以加载的方法。 方法总结 修饰符和类型 方法 描述 LayoutScatter clone(Context context, ResourceManager resourceManager) 克隆一个 LayoutScatter 对象。 Component createComponentElement(String fullClassName, AttrSet attrSet) 根据组件的完全限定类名实例化组件。 static LayoutScatter getInstance(Context context) 根据上下文获取一个 LayoutScatter 对象。 LayoutScatter.Picker getPicker() 获取组件选择器。 Component parse(int xmlId, ComponentContainer root, boolean attachToRoot) 将 XML 文件转换为组件。 void setPicker(LayoutScatter.Picker picker) 设置一个新的组件选择器来替换现有的。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 getInstance public static LayoutScatter getInstance(Context context) 根据上下文获取一个 LayoutScatter 对象。 参数: 参数名称 参数描述 context 指示应用程序上下文。 返回: 返回用于将 XML 文件转换为组件的 LayoutScatter 对象。 clone public LayoutScatter clone(Context context, ResourceManager resourceManager) 克隆一个 LayoutScatter 对象。 使用传输的 Context 和 ResourceManager 对象克隆新的 LayoutScatter 对象。 参数: 参数名称 参数描述 context 指示应用程序的 Context 对象。 resourceManager 表示应用程序的 ResourceManager 对象。 返回: 返回 LayoutScatter 对象。 parse public Component parse(int xmlId, ComponentContainer root, boolean attachToRoot) 将 XML 文件转换为组件。 将 XML 文件转换为组件后,您可以将新组件添加到根组件,在这种情况下,将返回根组件。 否则,返回创建的组件。 参数: 参数名称 参数描述 xmlId...
2024-04-03
LayoutManager java.lang.Object |—ohos.agp.components.LayoutManager public abstract class LayoutManager extends Object 所有布局管理器的抽象类。 构造函数摘要 构造函数 描述 LayoutManager() 用于创建 LayoutManager 实例的默认构造函数。 方法总结 修饰符和类型 方法 描述 int getOrientation() 获取布局方向。 void setOrientation(int orientation) 设置布局方向。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 LayoutManager public LayoutManager() 用于创建 LayoutManager 实例的默认构造函数。 方法详情 setOrientation public void setOrientation(int orientation) 设置布局方向。 如果不设置布局方向,则默认使用 Component.VERTICAL。 参数: 参数名称 参数描述 orientation 指示要设置的布局方向。 Component.HORIZONTAL 表示组件水平排列,Component.VERTICAL 表示组件垂直排列。 Throws: Throw名称 Throw描述 IllegalArgumentException 如果参数值与 Component.HORIZONTAL 或 Component.VERTICAL 不对应,则引发异常。 getOrientation public int getOrientation() 获取布局方向。 返回: 如果组件水平排列,则返回 Component.HORIZONTAL; 如果组件是垂直排列的,则返回 Component.VERTICAL。
2024-04-03
InputAttribute java.lang.Object |—ohos.agp.components.InputAttribute public class InputAttribute extends Object 提供控件的输入属性。 字段摘要 修饰符和类型 字段 描述 static int ENTER_KEY_FLAG_FORBID_EDITOR_ACTION 表示输入法选项的标志,表示输入法全屏时,提取文本右侧的任何附属按钮都不能使用该操作。 static int ENTER_KEY_FLAG_FORBID_FULLSCREEN 表示输入法选项的标志,表示输入法不能进入全屏模式。 static int ENTER_KEY_FLAG_FORBID_PERSONALIZED 表示输入法选项的标志,表示输入法不允许数据个性化。 static int ENTER_KEY_FLAG_FORCE_LINEFEED 表示输入法选项的标志,表示当涉及多行文本时,回车按钮插入换行符。 static int ENTER_KEY_FLAG_NEXT_FOCUSABLE 表示输入法选项的标志,表示当前组件有可聚焦的下一个组件。 static int ENTER_KEY_FLAG_ONLY_ASCII 表示输入法选项的标志,表示输入法允许使用 ASCII 字符。 static int ENTER_KEY_FLAG_PREVIOUS_FOCUSABLE 表示输入法选项的标志,表示当前组件有可聚焦的前一个组件。 static int ENTER_KEY_NULL 表示输入法选项的通用未指定类型,即未指定回车按钮类型。 static int ENTER_KEY_TYPE_DONE 表示执行“完成”动作的回车键类型。 static int ENTER_KEY_TYPE_GO 表示执行“开始”动作的回车键类型。 static int ENTER_KEY_TYPE_MASK 指示用户按下 Enter 键后要执行的操作的位掩码。 static int ENTER_KEY_TYPE_NEXT 表示执行“下一个”动作的回车键类型。 static int ENTER_KEY_TYPE_NONE 表示不执行任何操作。 static int ENTER_KEY_TYPE_PREVIOUS 表示执行“上一个”动作的回车键类型。 static int ENTER_KEY_TYPE_SEARCH 表示执行“搜索”动作的回车键类型。 static int ENTER_KEY_TYPE_SEND 表示执行“发送”动作的回车键类型。 static int ENTER_KEY_TYPE_UNSPECIFIED 表示未指定的常见输入类型的输入键动作。 int inputEnterKeyType 指示编辑器的扩展类型,以便更好地集成输入法。 int inputPattern 指示 TextField 的输入类型。 static int PATTERN_DATETIME 表示键盘类型是日期和时间键盘。 static int PATTERN_DATETIME_NORMAL_TYPE 表示 PATTERN_NUMBER 的类型是日期和时间。 static int PATTERN_DATETIME_ONLY_DATE 表示 PATTERN_DATETIME 的类型是日期。 static int PATTERN_DATETIME_ONLY_TIME 表示 PATTERN_DATETIME 的类型是时间。 static int PATTERN_FLAGS_MASK 指示键盘类型标志的位掩码。 static int PATTERN_MASK 指示文本输入类型的位掩码。 static int PATTERN_NULL 表示未指定键盘类型,此时默认不显示键盘。 static int PATTERN_NUMBER 表示键盘类型是 PIN 键盘。 static int PATTERN_NUMBER_DECIMAL_FLAG 指示 PATTERN_NUMBER 的标志是十进制数字。 static int PATTERN_NUMBER_NORMAL_TYPE 表示 PATTERN_NUMBER 的类型是数字。 static int PATTERN_NUMBER_PASSWORD_TYPE 表示 PATTERN_NUMBER 的类型是 PIN。 static int PATTERN_NUMBER_SIGNED_FLAG 指示 PATTERN_NUMBER 的标志是有符号数字。 static int PATTERN_PASSWORD 表示键盘类型为安全键盘。 static int PATTERN_PHONE 表示键盘类型是电话号码键盘。 static int PATTERN_TEXT 表示键盘类型是文本键盘。 static int PATTERN_TEXT_EMAIL_ADDRESS_TYPE 表示 PATTERN_TEXT 的类型是电子邮件地址。 static int PATTERN_TEXT_EMAIL_SUBJECT_TYPE...
2024-04-03
IndexBar java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.IndexBar public class IndexBar extends Component 表示支持 UI 操作的圆形索引栏。 该类适用于 IndexBar 实例,例如智能手表上的联系人列表。 嵌套类摘要 修饰符和类型 类 描述 static interface IndexBar.OnSelectedListener 回调以侦听和索引索引栏的更改事件。 从类 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 构造函数摘要 构造函数 描述 IndexBar(Context context) 用于根据上下文创建 IndexBar 实例的构造函数。 IndexBar(Context context, AttrSet attrSet) 用于在 XML 文件解析后根据上下文和属性集创建 IndexBar 实例的构造函数。 IndexBar(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后根据上下文、属性集和样式创建 IndexBar 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getIndexBarStatus() 获取 IndexBar 的状态。 Paint getIndexPaint() 获取此索引栏的绘制。 float getIndexRadius() 获取此索引栏的半径。 String[] getIndexString() 获取此索引栏的索引数组。 Paint getIndexStringPaint() 获取此索引栏上的索引字符串的绘制。 int getMaxCount() 获取此索引栏上的最大索引数。 int getMinCount() 获取此索引栏上的最小索引数。 IndexBar.OnSelectedListener getSelectedCallback() 获取监听该索引栏选择的监听器。 int getSelectedCount() 获取在索引栏上显示的字符串的索引号。 Paint getSelectedPaint() 获取此索引栏上选定区域的绘制。 String getSelectedString() 获取选中的字符串。 Paint getStringSelectedPaint() 获取选定字符串的绘制。 void languageSwitch(String[] characterStrings) 切换到另一种语言。 void setIndexBarExpandedStatus(boolean expanded) 设置索引栏是否展开。 void setIndexPaint(Paint paint) 设置用于在索引栏上绘制圆圈的油漆。 void setIndexRadius(float radius) 设置索引栏的半径。 void setIndexString(String[] indexString, Paint paint) 设置索引栏上的索引字符串以及用于绘制字符串的相应绘制。 void setMaxCount(int maxCount) 设置此索引栏上的最大索引数。 void setMinCount(int minCount) 设置此索引栏上的最小索引数。 void setMinCountAndMaxCount(int minCount, int maxCount) 设置此索引栏上的最大和最小索引数。 void setSelectedCallback(IndexBar.OnSelectedListener listener) 设置一个监听器来观察索引栏的变化事件。 void setSelectedCount(int count) 设置要在索引栏上选择的索引号。 void setSelectedPaint(Paint paint) 设置用于在索引栏上绘制圆圈的选定颜料的属性。 void setSelectedString(String indexString) 设置索引栏选中的字符串。 void setStringSelectedPaint(Paint paint) 设置用于在索引栏上绘制字符串的选定绘制的属性。 从类...
2024-04-03
Image java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Image public class Image extends Component 表示显示图像的组件。 Image继承自Component,用于展示图片资源。 嵌套类摘要 修饰符和类型 类 描述 static class Image.ScaleMode 表示图像的缩放模式。 从类 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 字段摘要 修饰符和类型 字段 描述 static int CLIP_DIRECTION_NOT_SET 表示未设置的图像剪切方向。 static int CLIP_GRAVITY_NOT_SET 表示未设置的裁剪对齐模式。 static int CLIP_HORIZONTAL 表示水平剪裁模式。 static int CLIP_VERTICAL 表示垂直剪裁模式。 static int GRAVITY_BOTTOM 表示裁剪图像的底部对齐方式。 static int GRAVITY_CENTER 表示裁剪图像的居中对齐方式。 static int GRAVITY_LEFT 表示裁剪图像的左对齐方式。 static int GRAVITY_RIGHT 表示裁剪图像的右对齐方式。 static int GRAVITY_TOP 表示裁剪图像的顶部对齐方式。 从类 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 构造函数摘要 构造函数 描述 Image(Context context) 默认构造函数用于使用默认属性集和样式创建 Image 实例。 Image(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 Image 实例的构造函数。 Image(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 Image 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getClipAlignment() 获取图片裁剪对齐方式。 int getClipDirection() 获取图像裁剪方向。 int getClipGravity() 已弃用。 此更改从 API 版本 5 开始生效。由 getClipAlignment() 替换 float[] getCornerRadii() 获得四个角的半径。 float getCornerRadius() 获取圆角半径。 Element getImageElement() 获取元素的值。 int getMaxHeight() 获取 Image 对象的最大高度。 int getMaxWidth() 获取 Image 对象的最大宽度。 PixelMap getPixelMap() 获取此 Image 上显示的 PixelMap 对象。 PixelMapHolder getPixelMapHolder() 获取此 Image 上显示的 PixelMapHolder 对象。 Image.ScaleMode getScaleMode() 获取图像缩放模式。 void setClipAlignment(int clipAlignment) 设置剪裁对齐模式。 void setClipDirection(int clipDirection) 设置图像剪切方向。 void setClipGravity(int clipGravity) 已弃用。 此更改从 API 版本 5 开始生效。由 setClipAlignment() 替换 void setCornerRadii(float[] radii) 设置此图像的每个圆角的半径。 void setCornerRadius(float radius) 为此图像的四个圆角设置一个统一的半径。 void setImageAndDecodeBounds(int resId)...
2024-04-03