class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItemHolder>
implements DescriptionSelectedCallback {
- private NewTransactionModel model;
+ private final NewTransactionModel model;
private MobileLedgerProfile mProfile;
- private ItemTouchHelper touchHelper;
+ private final ItemTouchHelper touchHelper;
private RecyclerView recyclerView;
private int checkHoldCounter = 0;
NewTransactionItemsAdapter(NewTransactionModel viewModel, MobileLedgerProfile profile) {
debug("description", broaderSql);
debug("description", description);
- activity.runOnUiThread(() -> {
- Snackbar.make(recyclerView, R.string.ignoring_preferred_account,
- Snackbar.LENGTH_LONG)
- .show();
- });
+ activity.runOnUiThread(
+ () -> Snackbar.make(recyclerView, R.string.ignoring_preferred_account,
+ Snackbar.LENGTH_LONG)
+ .show());
MLDB.queryInBackground(broaderSql, new String[]{description},
new MLDB.CallbackHelper() {
profileUUID, transactionId));
tr = profile.loadTransaction(transactionId);
- ArrayList<LedgerTransactionAccount> accounts = tr.getAccounts();
+ List<LedgerTransactionAccount> accounts = tr.getAccounts();
NewTransactionModel.Item firstNegative = null;
NewTransactionModel.Item firstPositive = null;
int singleNegativeIndex = -1;
}
private static class BalanceForCurrency {
- private HashMap<String, Float> hashMap = new HashMap<>();
+ private final HashMap<String, Float> hashMap = new HashMap<>();
float get(String currencyName) {
Float f = hashMap.get(currencyName);
if (f == null) {
}
private static class ItemsForCurrency {
- private HashMap<String, List<NewTransactionModel.Item>> hashMap = new HashMap<>();
+ private final HashMap<String, List<NewTransactionModel.Item>> hashMap = new HashMap<>();
@NonNull
List<NewTransactionModel.Item> getList(@Nullable String currencyName) {
List<NewTransactionModel.Item> list = hashMap.get(currencyName);