avoid concurrent button press crash in TimeListEdit - now for real

This commit is contained in:
AdrianLxM 2021-01-10 03:54:51 +01:00
parent 4c25272969
commit b509d13073

View file

@ -372,12 +372,11 @@ public class TimeListEdit {
} }
private void addItem(int index, int timeAsSeconds, double value1, double value2) { private void addItem(int index, int timeAsSeconds, double value1, double value2) {
synchronized (this) { if (itemsCount() >= 24) return;
if (itemsCount() > inflatedUntil) { if (itemsCount() > inflatedUntil) {
layout.removeView(finalAdd); layout.removeView(finalAdd);
inflateRow(++inflatedUntil); inflateRow(++inflatedUntil);
layout.addView(finalAdd); layout.addView(finalAdd);
}
} }
try { try {
// shift data // shift data