]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java
transaction-level comments in new transaction UI, optional
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionModel.java
index 062495c1537a0a169fe7febc7015a44292b6529b..d7663bcd7ff272f13b9a070ec20136c63478a0f1 100644 (file)
@@ -59,6 +59,10 @@ public class NewTransactionModel extends ViewModel {
             profile -> showCurrency.postValue(profile.getShowCommodityByDefault());
     private final AtomicInteger busyCounter = new AtomicInteger(0);
     private final MutableLiveData<Boolean> busyFlag = new MutableLiveData<>(false);
+    final MutableLiveData<Boolean> showComments = new MutableLiveData<>(false);
+    void observeShowComments(LifecycleOwner owner, Observer<? super Boolean> observer) {
+        showComments.observe(owner, observer);
+    }
     void observeBusyFlag(@NonNull LifecycleOwner owner, Observer<? super Boolean> observer) {
         busyFlag.observe(owner, observer);
     }
@@ -207,6 +211,9 @@ public class NewTransactionModel extends ViewModel {
     public boolean getBusyFlag() {
         return busyFlag.getValue();
     }
+    public void toggleShowComments() {
+        showComments.setValue(!showComments.getValue());
+    }
     enum ItemType {generalData, transactionRow, bottomFiller}
 
     enum FocusedElement {Account, Comment, Amount}