public class ClickEventHandler extends PointerEventHandler
button-like interactive element.| Constructor and Description |
|---|
ClickEventHandler(Widget widget,
Clickable clickable)
Creates a swipe event handler on an element.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
onExited()
Does nothing by default.
|
protected boolean |
onPressed(int pointerX,
int pointerY)
Returns
false by default. |
protected boolean |
onReleased(int pointerX,
int pointerY)
Returns
false by default. |
void |
setOnClickListener(OnClickListener onClickListener)
Sets the "on click" listener.
|
handleEvent, onDraggedprotected void onExited()
PointerEventHandlerOverride this method to react on focus loss events.
onExited in class PointerEventHandlerprotected boolean onPressed(int pointerX,
int pointerY)
PointerEventHandlerfalse by default.
Override this method to react on PRESSED events.
Returns true to get event focus. Other widgets will no longer receive pointer events until next
RELEASED.
onPressed in class PointerEventHandlerpointerX - the Pointer event X, relative to the attached widget.pointerY - the Pointer event Y, relative to the attached widget.true if the event has been processed, false if it should be dispatched to other handlers.protected boolean onReleased(int pointerX,
int pointerY)
PointerEventHandlerfalse by default.
Override this method to react on RELEASED events.
Returns true to prevent other widgets to also handle this event.
onReleased in class PointerEventHandlerpointerX - the Pointer event X, relative to the attached widget.pointerY - the Pointer event Y, relative to the attached widget.true if the event has been processed, false if it should be dispatched to other handlers.public void setOnClickListener(@Nullable OnClickListener onClickListener)
onClickListener - the "on click" listener to set or null.