extra keys: handle actions UP & CANCEL separately

Related issue: https://github.com/termux/termux-app/issues/905
This commit is contained in:
Leonid Plyushch
2019-11-23 15:22:11 +02:00
committed by Fredrik Fornwall
parent 677d75e173
commit cf883f5f05

View File

@@ -401,8 +401,14 @@ public final class ExtraKeysView extends GridLayout {
} }
return true; return true;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_CANCEL:
v.setBackgroundColor(BUTTON_COLOR);
if (scheduledExecutor != null) {
scheduledExecutor.shutdownNow();
scheduledExecutor = null;
}
return true;
case MotionEvent.ACTION_UP:
v.setBackgroundColor(BUTTON_COLOR); v.setBackgroundColor(BUTTON_COLOR);
if (scheduledExecutor != null) { if (scheduledExecutor != null) {
scheduledExecutor.shutdownNow(); scheduledExecutor.shutdownNow();