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() {
// 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 {
LedgerTransactionAccount acc = viewModel.getAccount(i);
if (acc.getAccountName()
.trim()
- .isEmpty()) continue;
+ .isEmpty())
+ continue;
if (acc.isAmountSet()) {
emptyAmountAccountBalance += acc.getAmount();
progress.setVisibility(View.GONE);
listAdapter.toggleAllEditing(true);
- if (fab != null) fab.setEnabled(true);
+ if (fab != null)
+ fab.setEnabled(true);
}
}
public void simulateCrash(MenuItem item) {
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);
}
}
enum ItemType {generalData, transactionRow, bottomFiller}
+ //==========================================================================================
+
class Item extends Object {
private ItemType type;
private MutableLiveData<Date> date = new MutableLiveData<>();