public class ButtonHelper
extends java.lang.Object
Constructor and Description |
---|
ButtonHelper(GenericListener helperListener)
Creates a button helper.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnClickListener(OnClickListener listener)
Adds a listener on the click events of the button.
|
boolean |
handleEvent(int event) |
boolean |
isPressed()
Gets whether the button is pressed or not.
|
protected void |
notifyOnClickListeners()
Notifies the listeners that a click event happened.
|
void |
performClick()
Performs the actions associated to a click.
|
void |
removeOnClickListener(OnClickListener listener)
Removes a listener on the click events of the button.
|
public ButtonHelper(GenericListener helperListener)
helperListener
- the listener to notify when the state changed.public void performClick()
public void addOnClickListener(OnClickListener listener)
listener
- the listener to add.java.lang.NullPointerException
- if the given listener is null
.public void removeOnClickListener(OnClickListener listener)
listener
- the listener to remove.protected void notifyOnClickListeners()
public boolean isPressed()
true
if the button is pressed, false
otherwise.public boolean handleEvent(int event)