From: Damyan Ivanov Date: Sun, 9 Dec 2018 13:14:03 +0000 (+0000) Subject: Revert "new transaction: remove the xml-driven rows and populate by hand" X-Git-Tag: v0.3~267 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=1c31cec3c678668cedf3d4e71ed51863b1d14489;hp=f29c2112fa58df7195207ad93b5abd6fedd016b0 Revert "new transaction: remove the xml-driven rows and populate by hand" This reverts commit 37d9d3d9d02714ba64414492beeffb22e2dea267. --- diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index 1f259fba..853fd0a6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -81,9 +81,16 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true); table = findViewById(R.id.new_transaction_accounts_table); - table.removeAllViews(); - do_add_account_row(false); - do_add_account_row(false); + 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); + } } @Override