public class FlicButtonCallback
extends java.lang.Object
Constructor and Description |
---|
FlicButtonCallback() |
Modifier and Type | Method and Description |
---|---|
void |
onButtonClickOrHold(FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isClick,
boolean isHold)
Used for the scenario where you want to listen on button click and hold.
|
void |
onButtonSingleOrDoubleClick(FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isSingleClick,
boolean isDoubleClick)
Used for the scenario where you want to listen on single click and double click.
|
void |
onButtonSingleOrDoubleClickOrHold(FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isSingleClick,
boolean isDoubleClick,
boolean isHold)
Used for the scenario where you want to listen on single click, double click and hold.
|
void |
onButtonUpOrDown(FlicButton button,
boolean wasQueued,
int timeDiff,
boolean isUp,
boolean isDown)
Called when the button was pressed or released.
|
void |
onConnectionCompleted(FlicButton button)
Called when the connection to the button has been established and is ready to use.
|
void |
onConnectionFailed(FlicButton button,
int status)
Called if there was a problem establishing a Bluetooth connection to the button.
|
void |
onConnectionStarted(FlicButton button)
Called when the Bluetooth connection has just been started.
|
void |
onDisconnect(FlicButton button,
int flicError)
Called when the Bluetooth connection was disconnected, for example if the button becomes out of range or the user manually disconnecting this button in the Flic Application.
|
void |
onReadRemoteRSSI(FlicButton button,
int rssi,
int status)
Called as a result of
FlicButton.readRemoteRSSI() . |
public void onConnectionStarted(FlicButton button)
onConnectionCompleted(FlicButton)
will be called when ready.button
- The buttonpublic void onConnectionFailed(FlicButton button, int status)
button
- The buttonstatus
- A Bluetooth GATT status.public void onDisconnect(FlicButton button, int flicError)
button
- The buttonflicError
- An errorpublic void onConnectionCompleted(FlicButton button)
button
- The buttonpublic void onReadRemoteRSSI(FlicButton button, int rssi, int status)
FlicButton.readRemoteRSSI()
.button
- The buttonrssi
- RSSI value for the remote devicestatus
- 0 if the RSSI was read successfullypublic void onButtonUpOrDown(FlicButton button, boolean wasQueued, int timeDiff, boolean isUp, boolean isDown)
button
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isUp
- True if up, else falseisDown
- True if down, else falsepublic void onButtonClickOrHold(FlicButton button, boolean wasQueued, int timeDiff, boolean isClick, boolean isHold)
button
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isClick
- True if click, else falseisHold
- True if hold, else falsepublic void onButtonSingleOrDoubleClick(FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick)
button
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isSingleClick
- True if single click, else falseisDoubleClick
- True if double click, else falsepublic void onButtonSingleOrDoubleClickOrHold(FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick, boolean isHold)
button
- The buttonwasQueued
- If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true.timeDiff
- If the event was queued, the timeDiff will be the number of seconds since the event happened.isSingleClick
- True if single click, else falseisDoubleClick
- True if double click, else falseisHold
- True if hold, else false