优惠码 第43页

鸿蒙OS PageSlider.PageChangedListener

PageSlider.PageChangedListener public static interface PageSlider.PageChangedListener 提供一个监听器来观察页面变化事件。 该界面在所选页面发生变化时触发。 方法总结 修饰符和类型 方法 描述 void onPageChosen(int itemPos) 选择新页面时回调。 void onPageSlideStateChanged(int state) 当页面滑动状态改变时调用。 void onPageSliding(int itemPos, float itemPosOffset, int itemPosOffsetPixels) 页面滑动时调用。 方法详情 onPageSliding void onPageSliding(int itemPos, float itemPosOffset, int itemPosOffsetPixels) 页面滑动时调用。 参数: 参数名称 参数描述 itemPos 显示页面的位置索引。 itemPosOffset 表示页面的位置偏移。 取值范围为(0, 1]。0表示正在显示同一页面;1表示正在显示目标页面。 itemPosOffsetPixels 表示显示页面的位置偏移像素数。 onPageSlideStateChanged void onPageSlideStateChanged(int state) 当页面滑动状态改变时调用。 参数: 参数名称 参数描述 state 指示页面状态。 该值可以是 0、1 或 2,分别表示页面处于空闲、拖动或滑动状态。 onPageChosen void onPageChosen(int itemPos) 选择新页面时回调。 参数: 参数名称 参数描述 itemPos 表示所选页面的索引。

鸿蒙OS ListContainer.ScrollListener

ListContainer.ScrollListener public static interface ListContainer.ScrollListener 表示用于监视 ListContainer 对象滚动结束的内部接口。 方法总结 修饰符和类型 方法 描述 void onScrollFinished() 当 ListContainer 对象的滚动完成时调用。 方法详情 onScrollFinished void onScrollFinished() 当 ListContainer 对象的滚动完成时调用。

鸿蒙OS ListContainer.ItemVisibilityChangedListener

ListContainer.ItemVisibilityChangedListener public static interface ListContainer.ItemVisibilityChangedListener 提供在将组件添加到可见项集中或从可见项集中删除时要调用的回调。 方法总结 修饰符和类型 方法 描述 void onItemAdded(Component component, int position) 当组件添加到可见组件集时调用。 void onItemRemoved(Component component, int position) 当从可见组件集中移除组件时调用。 方法详情 onItemAdded void onItemAdded(Component component, int position) 当组件添加到可见组件集时调用。 参数: 参数名称 参数描述 component 表示已添加的组件。 position 表示已添加的组件的位置。 onItemRemoved void onItemRemoved(Component component, int position) 当从可见组件集中移除组件时调用。 参数: 参数名称 参数描述 component 表示已移除的组件。 position 指示已移除组件的位置。

鸿蒙OS ListContainer.ItemSelectedListener

ListContainer.ItemSelectedListener public static interface ListContainer.ItemSelectedListener 侦听 ListContainer 对象中组件项的选定事件。 通过调用 onItemSelected 处理选定的事件。 方法总结 修饰符和类型 方法 描述 void onItemSelected(ListContainer parent, Component component, int position, long id) 选择 ListContainer 对象中的组件项时调用。 方法详情 onItemSelected void onItemSelected(ListContainer parent, Component component, int position, long id) 选择 ListContainer 对象中的组件项时调用。 此回调在以下情况下处理选定事件: ListContainer 对象中没有项目被选中。 ListContainer 对象中的另一个组件项被选中。 参数: 参数名称 参数描述 parent 指示具有选定组件项的 ListContainer 对象。 component 指示 ListContainer 对象中的选定组件项。 position 指示所选组件项在 ListContainer 对象中的位置。 id 表示所选组件项的行 ID。

鸿蒙OS ListContainer.ItemLongClickedListener

ListContainer.ItemLongClickedListener public static interface ListContainer.ItemLongClickedListener 提供用于侦听和处理 ListContainer 项的长按事件的侦听器。 此类继承自 ItemLongClickedListener#onItemLongClicked(ListContainer, Component, int, long) 以响应事件。 方法总结 修饰符和类型 方法 描述 boolean onItemLongClicked(ListContainer parent, Component component, int position, long id) 长按 ListContainer 项并处理长按事件时调用。 方法详情 onItemLongClicked boolean onItemLongClicked(ListContainer parent, Component component, int position, long id) 长按 ListContainer 项并处理长按事件时调用。 参数: 参数名称 参数描述 parent 指示 ListContainer 对象。 component 表示 ListContainer 对象中长按的 Component 项。 position 指示长按组件项在 ListContainer 对象中的位置。 id 表示长按项的行ID。 返回: 如果长按事件被处理,则返回 true; 否则返回 false。

鸿蒙OS ListContainer.ItemClickedListener

ListContainer.ItemClickedListener public static interface ListContainer.ItemClickedListener 侦听 ListContainer 项的单击事件。 要响应和处理 ListContainer 项的点击事件,必须实现 onItemClicked。 方法总结 修饰符和类型 方法 描述 void onItemClicked(ListContainer parent, Component component, int position, long id) 单击 ListContainer 实例中的项目并处理单击事件时调用。 方法详情 onItemClicked void onItemClicked(ListContainer parent, Component component, int position, long id) 单击 ListContainer 实例中的项目并处理单击事件时调用。 参数: 参数名称 参数描述 parent 指示具有单击项的 ListContainer 实例。 component 表示 ListContainer 实例中单击的 Component 项。 position 指示 Component 项在 ListContainer 实例中的位置。 该值是一个非负整数。 id 表示被点击项的行ID。

鸿蒙OS ListComponent.OnComponentBoundStatusChangeListener

ListComponent.OnComponentBoundStatusChangeListener public static interface ListComponent.OnComponentBoundStatusChangeListener 实现监听 ListComponent 的状态变化。 方法总结 修饰符和类型 方法 描述 void onChildComponentBoundToWindow(Component component) 当组件绑定到此 ListComponent 时调用。 void onChildComponentUnboundFromWindow(Component component) 当组件与此 ListComponent 解除绑定时调用。 方法详情 onChildComponentBoundToWindow void onChildComponentBoundToWindow(Component component) 当组件绑定到此 ListComponent 时调用。 参数: 参数名称 参数描述 component 表示组件绑定。 onChildComponentUnboundFromWindow void onChildComponentUnboundFromWindow(Component component) 当组件与此 ListComponent 解除绑定时调用。 参数: 参数名称 参数描述 component 表示组件未绑定。

鸿蒙OS ListComponent.CachePolicyListener

ListComponent.CachePolicyListener public static interface ListComponent.CachePolicyListener 实现监听以将组件添加到 ListComponentPool。 方法总结 修饰符和类型 方法 描述 void onCachePolicy(ComponentOwner owner) 回收组件时调用。代码 ListComponent 在清除 ComponentOwner 的内部数据并将组件添加到 ListComponentPool 之前调用此方法。 方法详情 onCachePolicy void onCachePolicy(ComponentOwner owner) 回收组件时调用。代码 ListComponent 在清除 ComponentOwner 的内部数据并将组件添加到 ListComponentPool 之前调用此方法。 参数: 参数名称 参数描述 owner 表示回收组件的 ComponentOwner。

鸿蒙OS ListComponent.BounceBackListener

ListComponent.BounceBackListener public static interface ListComponent.BounceBackListener 实现监听反弹状态的变化,包括反弹开始、反弹进行中、反弹结束。 方法总结 修饰符和类型 方法 描述 void onBounceBackChange(int xOverScrolled, int yOverScrolled) 在反弹过程中调用。 void onBounceBackEnd(int xOverScrolled, int yOverScrolled) 反弹结束时调用。 void onBounceBackStart(int xOverScrolled, int yOverScrolled) 反弹开始时调用。 方法详情 onBounceBackStart void onBounceBackStart(int xOverScrolled, int yOverScrolled) 反弹开始时调用。 参数: 参数名称 参数描述 xOverScrolled 表示水平方向移动的距离。 yOverScrolled 表示垂直方向移动的距离。 onBounceBackChange void onBounceBackChange(int xOverScrolled, int yOverScrolled) 在反弹过程中调用。 参数: 参数名称 参数描述 xOverScrolled 表示水平方向移动的距离。 yOverScrolled 表示垂直方向移动的距离。 onBounceBackEnd void onBounceBackEnd(int xOverScrolled, int yOverScrolled) 反弹结束时调用。 参数: 参数名称 参数描述 xOverScrolled 表示水平方向移动的距离。 yOverScrolled 表示垂直方向移动的距离。

鸿蒙OS LayoutScatter.Picker

LayoutScatter.Picker public static interface LayoutScatter.Picker 提供检查组件是否可以加载的方法。 方法总结 修饰符和类型 方法 描述 boolean isLoadClass(Class<?> clazz) 检查是否可以填充组件。 方法详情 isLoadClass boolean isLoadClass(Class<?> clazz) 检查是否可以填充组件。 参数: 参数名称 参数描述 clazz 表示将要填充的组件的类对象。 返回: 如果组件可以被填充,则返回 true; 否则返回 false。