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 689d619..8e16408 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 b2ce8ef..28afff3 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;