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 8a560ebdad
commit 919dcfdf0e
1 changed files with 7 additions and 1 deletions

View File

@ -405,8 +405,14 @@ public final class ExtraKeysView extends GridLayout {
}
return true;
case MotionEvent.ACTION_UP:
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);
if (scheduledExecutor != null) {
scheduledExecutor.shutdownNow();