SQLiteHabitList: fix corrupted order automatically
This commit is contained in:
parent
461fe1f0b6
commit
d3f7ebd60c
@ -133,7 +133,6 @@ public class SQLiteHabitList extends HabitList
|
|||||||
return Collections.unmodifiableCollection(toList()).iterator();
|
return Collections.unmodifiableCollection(toList()).iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void rebuildOrder()
|
public void rebuildOrder()
|
||||||
{
|
{
|
||||||
List<Habit> habits = toList();
|
List<Habit> habits = toList();
|
||||||
@ -176,7 +175,7 @@ public class SQLiteHabitList extends HabitList
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reorder(Habit from, Habit to)
|
public synchronized void reorder(Habit from, Habit to)
|
||||||
{
|
{
|
||||||
if (from == to) return;
|
if (from == to) return;
|
||||||
|
|
||||||
@ -213,6 +212,7 @@ public class SQLiteHabitList extends HabitList
|
|||||||
fromRecord.save();
|
fromRecord.save();
|
||||||
|
|
||||||
update(from);
|
update(from);
|
||||||
|
rebuildOrder();
|
||||||
|
|
||||||
getObservable().notifyListeners();
|
getObservable().notifyListeners();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user