public abstract class OnClickListener extends ViewListener
AbilityForm supplier for listening for click events.
This class inherits from ViewListener and provides methods to be called back when a clickable component,
such as a button or image, is clicked.SystemCapability.Aafwk#ABILITY| 构造器 | 说明 |
|---|---|
OnClickListener() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract void |
onClick(int componentId,
AbilityForm form,
ViewsStatus viewsStatus) |
A callback method registered with the
AbilityForm supplier for you to implement callbacks upon click
events. |
void |
onTouchEvent(AbilityForm form,
ViewsStatus viewsStatus) |
A callback method registered with the
AbilityForm supplier for you to implement callbacks upon touch
events. |
public void onTouchEvent(AbilityForm form, ViewsStatus viewsStatus)
ViewListenerAbilityForm supplier for you to implement callbacks upon touch
events.
Generally, this method is triggered in the following scenario:
AbilityForm#registerViewListener(int, ViewListener) to
register a callback method upon touch events.ViewListener#onTouchEvent(AbilityForm, ViewsStatus).onTouchEvent 在类中 ViewListenerform - Indicates the AbilityForm object provided by the supplier.viewsStatus - Indicates the status of components for which a listener has been set on the client.public abstract void onClick(int componentId,
AbilityForm form,
ViewsStatus viewsStatus)
AbilityForm supplier for you to implement callbacks upon click
events.componentId - Identifies the component that is clicked. The value cannot be a negative number.form - Indicates the AbilityForm object provided by the supplier.viewsStatus - Indicates the status of components for which a listener has been set on the client.