import android.widget.TableRow;
import android.widget.TextView;
+import java.util.Date;
import java.util.Objects;
/*
});
text_descr = findViewById(R.id.new_transaction_description);
hook_autocompletion_adapter(text_descr, MobileLedgerDB.DESCRIPTION_HISTORY_TABLE, "description");
+ hook_text_change_listener(text_descr);
progress = findViewById(R.id.save_transaction_progress);
saver = new SaveTransactionTask(this);
saver.setPref(PreferenceManager.getDefaultSharedPreferences(this));
- LedgerTransaction tr = new LedgerTransaction(text_date.getText().toString(), text_descr.getText().toString());
+ String date = text_date.getText().toString();
+ if (date.isEmpty()) date = String.valueOf(new Date().getDate());
+ LedgerTransaction tr = new LedgerTransaction(date, text_descr.getText().toString());
TableLayout table = findViewById(R.id.new_transaction_accounts_table);
for ( int i = 0; i < table.getChildCount(); i++ ) {
do_add_account_row(true);
}
+ public
+ void resetTransactionFromMenu(MenuItem item) {
+ reset_form();
+ }
+
public void saveTransactionFromMenu(MenuItem item) {
save_transaction();
}