From: Damyan Ivanov Date: Wed, 13 May 2020 18:42:47 +0000 (+0300) Subject: whitespace X-Git-Tag: v0.13.0~11 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ee3c0ffdb714b35759198466f955e2333fdd8c8b;p=mobile-ledger.git whitespace --- 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 afb9c57f..cdf2068a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java @@ -180,9 +180,9 @@ public class LedgerTransaction { } description = cTr.getString(1); - try (Cursor cAcc = db.rawQuery("SELECT account_name, amount, currency, comment FROM " + - "transaction_accounts WHERE " + - "profile=? AND transaction_id = ?", + try (Cursor cAcc = db.rawQuery( + "SELECT account_name, amount, currency, comment FROM " + + "transaction_accounts WHERE profile=? AND transaction_id = ?", new String[]{profile, String.valueOf(id)})) { while (cAcc.moveToNext()) { diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java index 84d744b5..3e6cab36 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java @@ -169,7 +169,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder if (id == R.id.comment) { commentFocusChanged(commentLayout, tvComment, hasFocus); } - else if ( id == R.id.transaction_comment) { + else if (id == R.id.transaction_comment) { commentFocusChanged(transactionCommentLayout, tvTransactionComment, hasFocus); } }; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java index 7fd17768..f5568081 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java @@ -49,17 +49,17 @@ public class NewTransactionModel extends ViewModel { final MutableLiveData showCurrency = new MutableLiveData<>(false); final ArrayList items = new ArrayList<>(); final MutableLiveData isSubmittable = new MutableLiveData<>(false); + final MutableLiveData showComments = new MutableLiveData<>(true); private final Item header = new Item(this, null, ""); private final Item trailer = new Item(this); private final MutableLiveData focusedItem = new MutableLiveData<>(0); private final MutableLiveData accountCount = new MutableLiveData<>(0); private final MutableLiveData simulateSave = new MutableLiveData<>(false); + private final AtomicInteger busyCounter = new AtomicInteger(0); + private final MutableLiveData busyFlag = new MutableLiveData<>(false); private boolean observingDataProfile; private Observer profileObserver = profile -> showCurrency.postValue(profile.getShowCommodityByDefault()); - private final AtomicInteger busyCounter = new AtomicInteger(0); - private final MutableLiveData busyFlag = new MutableLiveData<>(false); - final MutableLiveData showComments = new MutableLiveData<>(false); void observeShowComments(LifecycleOwner owner, Observer observer) { showComments.observe(owner, observer); } @@ -206,11 +206,13 @@ public class NewTransactionModel extends ViewModel { } void incrementBusyCounter() { int newValue = busyCounter.incrementAndGet(); - if (newValue == 1) busyFlag.postValue(true); + if (newValue == 1) + busyFlag.postValue(true); } void decrementBusyCounter() { int newValue = busyCounter.decrementAndGet(); - if (newValue == 0) busyFlag.postValue(false); + if (newValue == 0) + busyFlag.postValue(false); } public boolean getBusyFlag() { return busyFlag.getValue();