From: Damyan Ivanov Date: Wed, 10 Apr 2019 16:04:27 +0000 (+0300) Subject: fixed last couple of glitchs when adding transaction via an app shortcut with the... X-Git-Tag: v0.9.3~1 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=c0a2a2d5aa42ad56f76dfe73ba10250e11e7f3fd fixed last couple of glitchs when adding transaction via an app shortcut with the main app not running --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java index 689d619a..8e16408f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java @@ -57,8 +57,8 @@ public class LedgerTransaction { throws ParseException { this(id, Globals.parseLedgerDate(dateString), description); } - public LedgerTransaction(Integer id, Date date, String description) { - this.profile = Data.profile.get().getUuid(); + public LedgerTransaction(Integer id, Date date, String description, MobileLedgerProfile profile) { + this.profile = profile.getUuid(); this.id = id; this.date = date; this.description = description; @@ -66,6 +66,9 @@ public class LedgerTransaction { this.dataHash = null; dataLoaded = false; } + public LedgerTransaction(Integer id, Date date, String description) { + this(id, date, description, Data.profile.get()); + } public LedgerTransaction(Date date, String description) { this(null, date, description); } diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java index b2ce8ef2..28afff37 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java @@ -163,7 +163,7 @@ public class NewTransactionActivity extends ProfileThemedActivity Date date; if (dateString.isEmpty()) date = new Date(); else date = Globals.parseLedgerDate(dateString); - LedgerTransaction tr = new LedgerTransaction(date, tvDescription.getText().toString()); + LedgerTransaction tr = new LedgerTransaction(null, date, tvDescription.getText().toString(), mProfile); TableLayout table = findViewById(R.id.new_transaction_accounts_table); LedgerTransactionAccount emptyAmountAccount = null;