From 3d7346ab18d1050328ec030d9e1aef41a2a73d79 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 9 Dec 2018 12:52:32 +0000 Subject: [PATCH] new transaction: remove the xml-driven rows and populate by hand the by-hand method is used on demand anyway and should work and set all the propertied of the rows/fields the xml-driven stuff is still useful during development for figuring out what is the purpose of each property --- .../ktnx/mobileledger/NewTransactionActivity.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index 70b56321..ca2407db 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -78,16 +78,9 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true); table = findViewById(R.id.new_transaction_accounts_table); - for (int i = 0; i < table.getChildCount(); i++) { - TableRow row = (TableRow) table.getChildAt(i); - AutoCompleteTextView acc_name_view = (AutoCompleteTextView) row.getChildAt(0); - TextView amount_view = (TextView) row.getChildAt(1); - hook_swipe_listener(row); - hook_autocompletion_adapter(acc_name_view, MobileLedgerDB.ACCOUNTS_TABLE, "name"); - hook_text_change_listener(acc_name_view); - hook_text_change_listener(amount_view); -// Log.d("swipe", "hooked to row "+i); - } + table.removeAllViews(); + do_add_account_row(false); + do_add_account_row(false); } @Override -- 2.39.2