From: Damyan Ivanov Date: Sun, 9 Dec 2018 13:31:36 +0000 (+0000) Subject: reset_form: focus the description before removing extra rows potentially containing... X-Git-Tag: v0.3~266 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=6c0c5ecc16d86998a7968a9797981a3f31bd7ca5;p=mobile-ledger.git reset_form: focus the description before removing extra rows potentially containing focused elements --- diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index 853fd0a6..754d57f4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -403,6 +403,9 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal private void reset_form() { text_date.setText(""); text_descr.setText(""); + + text_descr.requestFocus(); + while(table.getChildCount() > 2) { table.removeViewAt(2); } @@ -413,7 +416,5 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal ((TextView)tr.getChildAt(0)).setText(""); ((TextView)tr.getChildAt(1)).setText(""); } - - text_descr.requestFocus(); } }