优惠码 第38页 DatePicker java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.StackLayout |—|—|—|—ohos.agp.components.DatePicker public class DatePicker extends StackLayout 提供用于选择日期的日期选择器。 此方法允许用户使用年、月和日列选择日期。 如果只需要年或月,或者年月日的顺序需要自定义,则使用DateOrder。 嵌套类摘要 修饰符和类型 类 描述 static interface DatePicker.DateOrder 定义 DatePicker 组件的显示格式。 static interface DatePicker.ValueChangedListener 提供日期更改的侦听器。 从类 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.StackLayout 继承的嵌套类/接口 StackLayout.LayoutConfig 字段摘要 修饰符和类型 字段 描述 static float ROTATION_SENSITIVITY_DEFAULT 指示 DatePicker 响应旋转表冠事件的默认旋转灵敏度。 static float ROTATION_SENSITIVITY_HIGH 指示 DatePicker 响应旋转表冠事件的高旋转灵敏度。 static float ROTATION_SENSITIVITY_LOW 指示 DatePicker 响应旋转表冠事件的低旋转灵敏度。 从类 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 构造函数摘要 构造函数 描述 DatePicker(Context context) 默认构造函数用于使用默认属性集和样式创建 DatePicker 实例。 DatePicker(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DatePicker 实例的构造函数。 DatePicker(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 DatePicker 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getDateOrder() 获取日期格式。 int getDayOfMonth() 获取日期选择器中设置的日期。 Element getDisplayedBottomElement() 获取用于在日期选择器中选定数字的底部绘制分割线的 Element 实例。 Element getDisplayedTopElement() 获取用于在日期选择器中选定数字的顶部绘制分割线的 Element 实例。 long getMaxDate() 获取日期选择器支持的最大日期。 long getMinDate() 获取日期选择器支持的最小日期。 int getMonth() 获取日期选择器中设置的月份。 Color getNormalTextColor() 获取日期选择器中普通文本的颜色。 Font getNormalTextFont() 获取普通文本的字体。 int getNormalTextSize() 获取日期选择器中普通文本的大小。 Element getOperatedTextBackgroundElement() 获取元素集作为正在操作的选中项的文本背景。 Color getOperatedTextColor() 获取日期选择器中被操作文本的颜色。 float getSelectedNormalTextMarginRatio() 获取此日期选择器中所选文本边距与正常文本边距的比率。 Element getSelectedTextBackgroundElement() 获取元素集作为日期选择器选择的文本的背景。 Color getSelectedTextColor() 获取日期选择器中选定文本的颜色。 Font getSelectedTextFont() 获取选定文本的字体。 int getSelectedTextSize()...
2024-04-03
CornerMark.CornerMarkCleaner java.lang.Object |—ohos.agp.components.CornerMark.CornerMarkCleaner protected static class CornerMark.CornerMarkCleaner extends Object 表示角标记的清洁器类。 当角标对象无用时,调用该类中的方法清理角标。 字段摘要 修饰符和类型 字段 描述 protected long mNativePtr Indicates the pointer to the corner mark. 构造函数摘要 构造函数 描述 CornerMarkCleaner(long nativePtr) 用于创建 CornerMarkCleaner 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void run() 运行清洁器以清洁角落标记。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 mNativePtr protected long mNativePtr 指示指向角标记的指针。 构造函数详细信息 CornerMarkCleaner public CornerMarkCleaner(long nativePtr) 用于创建 CornerMarkCleaner 实例的构造函数。 参数: 参数名称 参数描述 nativePtr 指示指向角标记的指针。 方法详情 run public void run() 运行清洁器以清洁角落标记。
2024-04-03
CornerMark java.lang.Object |—ohos.agp.components.CornerMark public class CornerMark extends Object 表示一个角标记类来标记组件。 为容器中的组件添加角标记元素,以在组件顶部显示角标记。 嵌套类摘要 修饰符和类型 类 描述 protected static class CornerMark.CornerMarkCleaner 表示角标记的清洁器类。 方法总结 修饰符和类型 方法 描述 ShapeElement getElement() 获取角标的形状元素。 int getHeight() 获取角标记的高度。 String getText() 获取角标中的文本。 Color getTextColor() 获取角标中显示的文本的颜色。 int getTextSize() 获取角标中显示的文本的大小。 int getWidth() 获取角标记的宽度。 protected void registerCleaner() 注册角标记清洁剂。 void setElement(ShapeElement element) 设置角标记的形状元素。 void setHeight(int height) 设置角标记的高度。 void setText(String text) 设置要在角标记中显示的文本。 void setTextColor(Color txtColor) 设置角标记中显示的文本的颜色。 void setTextSize(int textSize) 设置要在角标记中显示的文本大小。 void setWidth(int width) 设置角标记的宽度。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 registerCleaner protected void registerCleaner() 注册角标记清洁剂。 setText public void setText(String text) 设置要在角标记中显示的文本。 参数: 参数名称 参数描述 text 指示要设置的文本。 getText public String getText() 获取角标中的文本。 返回: 返回角标记中的文本。 getElement public ShapeElement getElement() 获取角标的形状元素。 返回: 返回当前角标记的形状元素。 setElement public void setElement(ShapeElement element) 设置角标记的形状元素。 参数: 参数名称 参数描述 element 指示给定的形状元素。 setWidth public void setWidth(int width) 设置角标记的宽度。 参数: 参数名称 参数描述 width 表示要设置的宽度。 getWidth public int...
2024-04-03
ComponentTreeObserver java.lang.Object |—ohos.agp.components.ComponentTreeObserver public final class ComponentTreeObserver extends Object 定义组件层次结构的侦听器。 您可以注册侦听器以监视组件层次结构中的全局更改。 嵌套类摘要 修饰符和类型 类 描述 static interface ComponentTreeObserver.GlobalFocusUpdatedListener 当组件树中的焦点状态发生变化时调用的回调。 static interface ComponentTreeObserver.GlobalLayoutListener 已弃用。 此更改从 API 版本 6 开始生效。替换为 Component.LayoutRefreshedListener static interface ComponentTreeObserver.ScrollChangedListener 滚动组件层次结构中的任何元素时调用的回调。 static interface ComponentTreeObserver.WindowBoundListener 当组件层次结构绑定到其窗口或从其窗口解除绑定时调用的回调。 static interface ComponentTreeObserver.WindowFocusUpdatedListener 当组件层次结构中窗口焦点状态发生变化时调用的回调。 方法总结 修饰符和类型 方法 描述 void addGlobalFocusUpdatedListener(ComponentTreeObserver.GlobalFocusUpdatedListener listener) 为 globalFocusChanged() 注册一个监听器。 void addScrolledListener(ComponentTreeObserver.ScrollChangedListener listener) 为 scrollChanged() 注册一个监听器。 void addTreeLayoutChangedListener(ComponentTreeObserver.GlobalLayoutListener listener) 已弃用。 此更改从 API 版本 6 开始生效。替换为 setLayoutRefreshedListener(Component.LayoutRefreshedListener) void addWindowBoundListener(ComponentTreeObserver.WindowBoundListener listener) 为 windowBound() 注册一个监听器。 void addWindowFocusUpdatedListener(ComponentTreeObserver.WindowFocusUpdatedListener listener) 为 windowFocusUpdated() 注册一个监听器。 void removeGlobalFocusUpdatedListener(ComponentTreeObserver.GlobalFocusUpdatedListener listener) 删除为 globalFocusChanged() 注册的侦听器。 void removeScrolledListener(ComponentTreeObserver.ScrollChangedListener listener) 删除为 scrollChanged() 注册的侦听器。 void removeTreeLayoutChangedListener(ComponentTreeObserver.GlobalLayoutListener listener) 已弃用。 此更改从 API 版本 6 开始生效。由 setLayoutRefreshedListener(Component.LayoutRefreshedListener) 替换为 null 侦听器值。 void removeWindowBoundListener(ComponentTreeObserver.WindowBoundListener listener) 删除为 windowAttached() 注册的侦听器。 void removeWindowFocusUpdatedListener(ComponentTreeObserver.WindowFocusUpdatedListener listener) 删除为 windowFocusUpdated() 注册的侦听器。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 addWindowFocusUpdatedListener public void addWindowFocusUpdatedListener(ComponentTreeObserver.WindowFocusUpdatedListener listener) 为 windowFocusUpdated() 注册一个监听器。 参数: 参数名称 参数描述 listener 指示要注册的侦听器。 removeWindowFocusUpdatedListener public void removeWindowFocusUpdatedListener(ComponentTreeObserver.WindowFocusUpdatedListener listener) 删除为 windowFocusUpdated() 注册的侦听器。 参数: 参数名称 参数描述 listener 指示要删除的侦听器。 addWindowBoundListener public void addWindowBoundListener(ComponentTreeObserver.WindowBoundListener listener) 为 windowBound() 注册一个监听器。 参数: 参数名称 参数描述 listener 指示要注册的侦听器。 removeWindowBoundListener public void removeWindowBoundListener(ComponentTreeObserver.WindowBoundListener listener) 删除为 windowAttached() 注册的侦听器。 参数: 参数名称 参数描述 listener...
2024-04-03
ComponentTransition java.lang.Object |—ohos.agp.components.ComponentTransition public class ComponentTransition extends Object 为 ComponentContainer 对象的布局更改提供动画。 要在布局容器上执行布局转换,请创建一个 ComponentTransition 对象,然后使用 ComponentContainer#setComponentTransition 设置一个 ComponentContainer 对象。 字段摘要 修饰符和类型 字段 描述 static int CHANGING 指示在由布局修改更改的组件上运行的动画,而不是通过在布局容器中添加或删除组件。 static int OTHERS_GONE 指示在组件上运行的动画,因为它们的关联组件之一从 ComponentContainer 中消失而发生更改。 static int OTHERS_SHOW 指示在组件上运行的动画,因为它们的关联组件之一出现在 ComponentContainer 中而发生更改。 static int SELF_GONE 表示当组件从 ComponentContainer 中消失时在组件上运行的动画。 static int SELF_SHOW 表示当组件出现在 ComponentContainer 中时在组件上运行的动画。 构造函数摘要 构造函数 描述 ComponentTransition() 用于创建 ComponentTransition 实例的默认构造函数。 方法总结 修饰符和类型 方法 描述 void addTransitionType(int type) 为 ComponentTransition 对象启用过渡类型。 AnimatorProperty getAnimatorProperty(int type) 获取指定转场类型的组件属性动画器。 boolean hasTransitionType(int type) 检查是否为 ComponentTransition 对象启用了指定的过渡类型。 void release() 释放一个 ComponentTransition 对象。 void removeTransitionType(int type) 从 ComponentTransition 对象中移除过渡类型。 void setAnimatorProperty(int type, AnimatorProperty animator) 设置指定转换类型的可自定义组件属性动画器。 void setTransitionTypeDuration(int type, int duration) 设置指定过渡类型动画的持续时间。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 CHANGING public static final int CHANGING 指示在由布局修改更改的组件上运行的动画,而不是通过在布局容器中添加或删除组件。 默认情况下,此转换类型被禁用。 您可以调用 addTransitionType(int) 来启用它。 OTHERS_GONE public static final int OTHERS_GONE 指示在组件上运行的动画,因为它们的关联组件之一从 ComponentContainer 中消失而发生更改。 OTHERS_SHOW public static final int OTHERS_SHOW 指示在组件上运行的动画,因为它们的关联组件之一出现在 ComponentContainer 中而发生更改。 SELF_GONE public static final int SELF_GONE 表示当组件从 ComponentContainer 中消失时在组件上运行的动画。 SELF_SHOW public static final int SELF_SHOW 表示当组件出现在 ComponentContainer 中时在组件上运行的动画。 构造函数详细信息...
2024-04-03
ComponentState java.lang.Object |—ohos.agp.components.ComponentState public class ComponentState extends Object 定义组件状态。 组件状态可以是 COMPONENT_STATE_FOCUSED、COMPONENT_STATE_SELECTED、COMPONENT_STATE_WINDOW_FOCUSED、COMPONENT_STATE_DISABLED、COMPONENT_STATE_CHECKED、COMPONENT_STATE_DRAG_ENTERED、COMPONENT_STATE_DRAG_RESPONDED、COMPONENT_STATE_PRESSED 或 COMPONENT_STATE_HOVERED。 字段摘要 修饰符和类型 字段 描述 static int COMPONENT_STATE_CHECKED 表示选中状态。 static int COMPONENT_STATE_DISABLED 表示禁用状态。 static int COMPONENT_STATE_DRAG_ENTERED 指示组件在拖动过程中被另一个组件悬停的状态。 static int COMPONENT_STATE_DRAG_RESPONDED 表示可以响应拖动事件的状态。 static int COMPONENT_STATE_EMPTY 表示为空的状态。 static int COMPONENT_STATE_FOCUSED 表示聚焦状态。 static int COMPONENT_STATE_HOVERED 表示悬停状态。 static int COMPONENT_STATE_PRESSED 表示按下状态。 static int COMPONENT_STATE_SELECTED 表示选中状态。 static int COMPONENT_STATE_WINDOW_FOCUSED 表示组件的窗口获得焦点的状态。 构造函数摘要 构造函数 描述 ComponentState() 方法总结 修饰符和类型 方法 描述 static boolean isStateMatched(int stateFlag, int stateMask) 检查状态是否与给定状态匹配。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 COMPONENT_STATE_CHECKED public static final int COMPONENT_STATE_CHECKED 表示选中状态。 COMPONENT_STATE_DISABLED public static final int COMPONENT_STATE_DISABLED 表示禁用状态。 COMPONENT_STATE_DRAG_ENTERED public static final int COMPONENT_STATE_DRAG_ENTERED 指示组件在拖动过程中被另一个组件悬停的状态。 COMPONENT_STATE_DRAG_RESPONDED public static final int COMPONENT_STATE_DRAG_RESPONDED 表示可以响应拖动事件的状态。 COMPONENT_STATE_EMPTY public static final int COMPONENT_STATE_EMPTY 表示为空的状态。 COMPONENT_STATE_FOCUSED public static final int COMPONENT_STATE_FOCUSED 表示聚焦状态。 COMPONENT_STATE_HOVERED public static final int COMPONENT_STATE_HOVERED 表示悬停状态。 COMPONENT_STATE_PRESSED public static final int COMPONENT_STATE_PRESSED 表示按下状态。 COMPONENT_STATE_SELECTED...
2024-04-03
ComponentSaveState java.lang.Object |—ohos.agp.components.AbsComponentSaveState |—|—ohos.agp.components.ComponentSaveState public class ComponentSaveState extends AbsComponentSaveState 用于保存和恢复组件状态的超类。 如果一个组件需要保存一个特定的状态,它必须继承这个类。 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static Sequenceable.ProducerComponentSaveState PRODUCER 基于 Parcel 对象创建一个 ComponentSaveState 实例。 从类 ohos.agp.components.AbsComponentSaveState 继承的字段 EMPTY_STATE 构造函数摘要 构造函数 描述 ComponentSaveState(Parcel in) 用于创建基于 Parcel 对象的 ComponentSaveState 实例的构造函数。 ComponentSaveState(Parcel in, ClassLoader classLoader) 用于创建基于 Parcel 和 ClassLoader 对象的 ComponentSaveState 实例的构造函数。 ComponentSaveState(Sequenceable superState) 用于创建基于 superState 的 ComponentSaveState 实例的构造函数。 方法总结 修饰符和类型 方法 描述 boolean marshalling(Parcel parcel) 将此 Sequenceable 对象编组为 Parcel。 从类 ohos.agp.components.AbsComponentSaveState 继承的方法 getSuperState, unmarshalling 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor 字段详细信息 PRODUCER public static final Sequenceable.ProducerComponentSaveState PRODUCER 基于 Parcel 对象创建一个 ComponentSaveState 实例。 构造函数详细信息 ComponentSaveState public ComponentSaveState(Sequenceable superState) 用于创建基于 superState 的 ComponentSaveState 实例的构造函数。 此方法由派生类调用。 参数: 参数名称 参数描述 superState 指示此组件的超类的状态。 ComponentSaveState public ComponentSaveState(Parcel in) 用于创建基于 Parcel 对象的 ComponentSaveState 实例的构造函数。 参数: 参数名称 参数描述 in 指示组件从中读取数据的 Parcel 对象。 ComponentSaveState public ComponentSaveState(Parcel in, ClassLoader classLoader) 用于创建基于 Parcel 和 ClassLoader 对象的 ComponentSaveState 实例的构造函数。 参数: 参数名称 参数描述 in 指示组件从中读取数据的 Parcel 对象。 classLoader 指示要使用的 ClassLoader 对象。 方法详情 marshalling public...
2024-04-03
ComponentProvider.Action java.lang.Object |—ohos.agp.components.ComponentProvider.Action public abstract static class ComponentProvider.Action extends Object implements Sequenceable 描述可以对远程组件执行的操作。 远程组件是可以在另一个应用程序中显示和更新的组件层次结构。 嵌套类摘要 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static int MERGE_REPLACE 允许合并和替换。 int viewId 表示组件ID。 构造函数摘要 构造函数 描述 Action() 方法总结 修饰符和类型 方法 描述 abstract void apply(ComponentContainer root) 应用更新组件内容的动作。 String getActionKey() 获取操作键。 abstract int getActionTag() 获取动作类型。 int mergeOperation() 返回合并行为。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从接口 ohos.utils.Sequenceable 继承的方法 hasFileDescriptor, marshalling, unmarshalling 字段详细信息 MERGE_REPLACE public static final int MERGE_REPLACE 允许合并和替换。 当多个 ComponentProvider.Action 应用于同一个组件的同一个属性时,这些动作可以被合并。 viewId public int viewId 表示组件ID。 构造函数详细信息 Action public Action() 方法详情 apply public abstract void apply(ComponentContainer root) throws ComponentProvider.ComponentProviderException 应用更新组件内容的动作。 参数: 参数名称 参数描述 root 表示 ComponentProvider 定义的所有组件的根节点。 Throws: Throw名称 Throw描述 ComponentProvider.ComponentProviderException 如果系统无法处理错误,则抛出此异常。 mergeOperation public int mergeOperation() 返回合并行为。 默认值为 MERGE_REPLACE。 返回: 默认情况下返回 MERGE_REPLACE。 getActionTag public abstract int getActionTag() 获取 Action 类型。 返回的操作类型取决于 ComponentProvider.Action。 返回: 返回 Action...
2024-04-03
ComponentProvider java.lang.Object |—ohos.agp.components.ComponentProvider public class ComponentProvider extends Object implements Sequenceable 为跨进程显示提供远程组件。 该类提供了一组用于修改远程组件内容的基本操作。 它通常用于开发显示在通知栏中的通知以及桌面或主屏幕上的小部件。 嵌套类摘要 修饰符和类型 类 描述 static class ComponentProvider.Action 描述可以对远程组件执行的操作。 static class ComponentProvider.ComponentProviderException 对远程组件操作期间发生的错误引发异常。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.ProducerT 字段摘要 修饰符和类型 字段 描述 static int APPLY_TYPE_ACTIONS_ONLY 在 ComponentProvider 对象更新后应用所有操作。 static int APPLY_TYPE_LAYOUT_AND_ACTIONS 在创建 ComponentProvider 对象后扩展布局并应用所有操作。 构造函数摘要 构造函数 描述 ComponentProvider() 用于创建 ComponentProvider 的默认构造函数。 ComponentProvider(int layoutId, Context context) 用于根据应用程序的布局 ID 和上下文创建 ComponentProvider 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void applyAction(ComponentContainer root) 应用当前进程中的所有操作。 CollectionComponentProvider.Action getActions() 获取所有动作。 ComponentContainer getAllComponents() 获取 ComponentContainer 中的所有组件。 int getApplyType() 获取操作类型。 String getDefaultBundleName() 获取默认捆绑包名称。 int getLayoutId() 获取布局ID。 void inflateLayout(Context context) 根据布局定义扩展布局。 boolean isValidComponentId(int componentId) 根据提供的组件 ID 检查组件是否有效。 boolean marshalling(Parcel out) 编组 ComponentProvider 对象,然后将其写入 Parcelobject。 void mergeAction(ComponentProvider.Action action) 将 ComponentProvider.Action 对象合并到一个 ComponentProvider 对象中。 void mergeActions(CollectionComponentProvider.Action actions) 将所有 Action 对象合并并存储到一个 ComponentProvider 对象中。 void resetActions() 清除当前 ComponentProvider 对象中的所有操作。 ComponentProvider.Action setAccessibilityDescription(int componentId, String description) 设置指定组件的可访问性模式的描述.. boolean setApplyType(int applyType) 设置操作类型。 ComponentProvider.Action setBackgroundPixelMap(int componentId, PixelMap pixelMap) 设置组件的背景图像。 ComponentProvider.Action setBoolean(int componentId, String methodName, boolean value) 调用组件的指定接口。 ComponentProvider.Action setClipToContourEnabled(int componentId, boolean enable) 设置组件的轮廓是否可以用于内容裁剪。 ComponentProvider.Action setComponentContainerLayoutConfig(int componentId, ComponentContainer.LayoutConfig params) 设置组件的边距布局参数。 void setDefaultBundleName(String bundleName) 设置获取资源的默认捆绑包名称。 ComponentProvider.Action setDouble(int componentId, String methodName, double value) 调用组件的指定接口。 ComponentProvider.Action setFloat(int componentId, String methodName, float value) 调用组件的指定接口。 ComponentProvider.Action setImageContent(int componentId, int resId) 设置要在指定图像组件上显示的内容。 ComponentProvider.Action setImagePixelMap(int componentId, PixelMap pixelMap) 设置组件的图像内容。 ComponentProvider.Action setInt(int componentId, String methodName, int value) 调用组件的指定接口。...
2024-04-03
ComponentHolder java.lang.Object |—ohos.agp.components.ComponentHolder public class ComponentHolder extends Object 表示 XML 文件中的组件持有者(布局)。 方法总结 修饰符和类型 方法 描述 void hide() 在父布局中隐藏此 ComponentHolder 布局。 Component show() 在父布局中显示此 ComponentHolder 布局。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 show public Component show() 在父布局中显示此 ComponentHolder 布局。 返回: 返回此 ComponentHolder 布局中的组件。 hide public void hide() 在父布局中隐藏此 ComponentHolder 布局。
2024-04-03