From f9e2e7ecec64010c6911141cc1d06fd4480d491f Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 9 Dec 2018 19:31:27 +0000 Subject: [PATCH] new transaction: make text input fields single-line and use 'Next' action button can't make it multi-line (for accounts with long names) and still have 'Next' on the action button and not 'Enter' --- .../mobileledger/NewTransactionActivity.java | 4 +++- .../res/layout/content_new_transaction.xml | 22 ++++++++++++------- app/src/main/res/values-bg/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index f41063d9..93e6fe8d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -299,7 +299,9 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal acc.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT, 9f)); acc.setHint(R.string.new_transaction_account_hint); acc.setWidth(0); - acc.setImeOptions(EditorInfo.IME_ACTION_NEXT); + acc.setImeOptions(EditorInfo.IME_ACTION_NEXT | EditorInfo.IME_FLAG_NO_ENTER_ACTION + | EditorInfo.IME_FLAG_NAVIGATE_NEXT); + acc.setSingleLine(true); final EditText amt = new EditText(this); amt.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, diff --git a/app/src/main/res/layout/content_new_transaction.xml b/app/src/main/res/layout/content_new_transaction.xml index 0cbfc203..de29030b 100644 --- a/app/src/main/res/layout/content_new_transaction.xml +++ b/app/src/main/res/layout/content_new_transaction.xml @@ -28,16 +28,20 @@ @@ -52,12 +56,12 @@ android:ems="10" android:hint="@string/new_transaction_description_hint" android:imeOptions="actionNext" - android:inputType="textPersonName" android:nextFocusLeft="@+id/new_transaction_date" android:nextFocusRight="@+id/new_transaction_acc_1" android:nextFocusUp="@+id/new_transaction_date" android:nextFocusDown="@+id/new_transaction_acc_1" android:nextFocusForward="@+id/new_transaction_acc_1" + android:singleLine="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_weight="30" app:layout_constraintStart_toEndOf="@+id/new_transaction_date" @@ -81,14 +85,15 @@ android:layout_weight="9" android:width="0dp" android:accessibilityTraversalAfter="@+id/new_transaction_description" - android:accessibilityTraversalBefore="@+id/new_transaction_amt_2" + android:accessibilityTraversalBefore="@+id/new_transaction_amt_1" android:hint="@string/new_transaction_account_hint" android:imeOptions="actionNext" android:nextFocusLeft="@+id/new_transaction_description" android:nextFocusRight="@+id/new_transaction_amt_1" android:nextFocusUp="@+id/new_transaction_description" android:nextFocusDown="@+id/new_transaction_amt_1" - android:nextFocusForward="@+id/new_transaction_amt_1" /> + android:nextFocusForward="@+id/new_transaction_amt_1" + android:singleLine="true" /> + android:nextFocusForward="@+id/new_transaction_amt_2" + android:singleLine="true" /> Мрежова грешка Показване на скритите сметки Отначало + Следващ \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fcc23ecb..b7501a08 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -75,4 +75,5 @@ Show hidden accounts Invalid username or password Reset + Next -- 2.39.2