]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fixed last couple of glitchs when adding transaction via an app shortcut with the...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 10 Apr 2019 16:04:27 +0000 (19:04 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 10 Apr 2019 16:04:27 +0000 (19:04 +0300)
app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java

index 689d619a694d2d15ae0d5ea6a110aa1e8fcf3b30..8e16408ff18c69abc73d693fa18734b642c18194 100644 (file)
@@ -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);
     }
index b2ce8ef220880f31219f77f26b628fba4ba862d6..28afff37ab283fba697d6c144d8f4e78f2a6009e 100644 (file)
@@ -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;