package net.ktnx.mobileledger.ui.new_transaction;
import android.annotation.SuppressLint;
-import android.os.Handler;
-import android.os.Looper;
import android.text.TextUtils;
import androidx.annotation.NonNull;
newItems.add(accRow);
}
- new Handler(Looper.getMainLooper()).post(() -> replaceItems(newItems));
+ Misc.onMainThread(() -> replaceItems(newItems));
});
}
private int extractIntFromMatches(MatchResult m, Integer group, Integer literal) {
List<Item> list = Objects.requireNonNull(items.getValue());
TransactionHead head = list.get(0)
.toTransactionHead();
- SimpleDate date = head.getDate();
LedgerTransaction tr = head.asLedgerTransaction();
tr.setComment(head.getComment());
moveItemLast(newList, singlePositiveIndex);
}
- new Handler(Looper.getMainLooper()).post(() -> {
+ Misc.onMainThread(() -> {
setItems(newList);
noteFocusChanged(1, FocusedElement.Amount);
});
return ItemType.generalData;
}
public LedgerTransaction asLedgerTransaction() {
- return new LedgerTransaction(0, date, description, Data.getProfile());
+ return new LedgerTransaction(0, (date == null) ? SimpleDate.today() : date, description,
+ Data.getProfile());
}
public boolean equalContents(TransactionHead other) {
if (other == null)