whitespace
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:24:04 +0000 (19:24 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:24:18 +0000 (19:24 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java

index a9d7472..c0c902e 100644 (file)
@@ -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);
     }
 
index 443c21f..f6d556e 100644 (file)
@@ -247,6 +247,8 @@ public class NewTransactionModel extends ViewModel {
     }
     enum ItemType {generalData, transactionRow, bottomFiller}
 
+    //==========================================================================================
+
     class Item extends Object {
         private ItemType type;
         private MutableLiveData<Date> date = new MutableLiveData<>();