From 306669c23af86c11fdbddb7669dcda15931096e0 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 15 May 2020 15:18:29 +0200 Subject: [PATCH] Fixed that enterPressed() has been called on ACTION_DOWN and ACTION_UP --- .../fints4java/android/ui/extensions/EditTextExtensions.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/extensions/EditTextExtensions.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/extensions/EditTextExtensions.kt index 30577f6e..4117a473 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/extensions/EditTextExtensions.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/extensions/EditTextExtensions.kt @@ -5,8 +5,8 @@ import android.widget.EditText fun EditText.addEnterPressedListener(enterPressed: () -> Boolean) { - this.setOnKeyListener { _, keyCode, _ -> - if (keyCode == KeyEvent.KEYCODE_ENTER) { + this.setOnKeyListener { _, keyCode, event -> + if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) { return@setOnKeyListener enterPressed() }