From: Damyan Ivanov Date: Sun, 17 Nov 2019 17:24:04 +0000 (+0200) Subject: whitespace X-Git-Tag: v0.11.0~53 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=8c39affe99dc23ed494f3b70fe29ea4c3e00c2f4;p=mobile-ledger.git whitespace --- 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 a9d74727..c0c902eb 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 @@ -151,10 +151,12 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas if (profileUUID != null) { mProfile = Data.getProfile(profileUUID); - if (mProfile == null) finish(); + if (mProfile == null) + finish(); Data.setCurrentProfile(mProfile); } - else super.initProfile(); + else + super.initProfile(); } @Override public void finish() { @@ -176,7 +178,8 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas // FIXME if (tvDescription.getText().toString().isEmpty()) tvDescription.requestFocus(); } public void saveTransaction() { - if (fab != null) fab.setEnabled(false); + if (fab != null) + fab.setEnabled(false); listAdapter.toggleAllEditing(false); progress.setVisibility(View.VISIBLE); try { @@ -193,7 +196,8 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas LedgerTransactionAccount acc = viewModel.getAccount(i); if (acc.getAccountName() .trim() - .isEmpty()) continue; + .isEmpty()) + continue; if (acc.isAmountSet()) { emptyAmountAccountBalance += acc.getAmount(); @@ -214,7 +218,8 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas progress.setVisibility(View.GONE); listAdapter.toggleAllEditing(true); - if (fab != null) fab.setEnabled(true); + if (fab != null) + fab.setEnabled(true); } } public void simulateCrash(MenuItem item) { @@ -248,10 +253,12 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas if (error == null) listAdapter.reset(); - else Snackbar.make(list, error, BaseTransientBottomBar.LENGTH_LONG) - .show(); + else + Snackbar.make(list, error, BaseTransientBottomBar.LENGTH_LONG) + .show(); listAdapter.toggleAllEditing(true); + viewModel.checkTransactionSubmittable(listAdapter); } 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 443c21f9..f6d556e5 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 @@ -247,6 +247,8 @@ public class NewTransactionModel extends ViewModel { } enum ItemType {generalData, transactionRow, bottomFiller} + //========================================================================================== + class Item extends Object { private ItemType type; private MutableLiveData date = new MutableLiveData<>();