Fix reordering
This commit is contained in:
parent
5d8a348aaf
commit
add08d6054
@ -205,6 +205,8 @@ public class SQLiteHabitList extends HabitList
|
||||
record.save();
|
||||
|
||||
update(from);
|
||||
|
||||
getObservable().notifyListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -178,8 +178,6 @@ public class HabitCardListAdapter extends BaseAdapter
|
||||
public void reorder(int from, int to)
|
||||
{
|
||||
cache.reorder(from, to);
|
||||
cache.refreshAllHabits(false);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -144,12 +144,9 @@ public class HabitCardListCache implements CommandRunner.Listener
|
||||
public void reorder(int from, int to)
|
||||
{
|
||||
Habit fromHabit = data.habitsList.get(from);
|
||||
Habit toHabit = data.habitsList.get(to);
|
||||
|
||||
data.habitsList.remove(from);
|
||||
data.habitsList.add(to, fromHabit);
|
||||
|
||||
allHabits.reorder(fromHabit, toHabit);
|
||||
if(listener != null) listener.onCacheRefresh();
|
||||
}
|
||||
|
||||
public void setCheckmarkCount(int checkmarkCount)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user