mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-17 22:31:35 +00:00
Fix crash in virtual controller if a release event happens without a press
This commit is contained in:
@@ -190,9 +190,15 @@ public class DigitalButton extends VirtualControllerElement {
|
|||||||
for (DigitalButtonListener listener : listeners) {
|
for (DigitalButtonListener listener : listeners) {
|
||||||
listener.onRelease();
|
listener.onRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We may be called for a release without a prior click
|
||||||
|
if (timerLongClick != null) {
|
||||||
timerLongClick.cancel();
|
timerLongClick.cancel();
|
||||||
|
}
|
||||||
|
if (longClickTimerTask != null) {
|
||||||
longClickTimerTask.cancel();
|
longClickTimerTask.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onElementTouchEvent(MotionEvent event) {
|
public boolean onElementTouchEvent(MotionEvent event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user