Fix reordering

This commit is contained in:
2016-06-15 10:12:33 -04:00
parent 5d8a348aaf
commit add08d6054
3 changed files with 3 additions and 6 deletions

View File

@@ -205,6 +205,8 @@ public class SQLiteHabitList extends HabitList
record.save();
update(from);
getObservable().notifyListeners();
}
@Override

View File

@@ -178,8 +178,6 @@ public class HabitCardListAdapter extends BaseAdapter
public void reorder(int from, int to)
{
cache.reorder(from, to);
cache.refreshAllHabits(false);
notifyDataSetChanged();
}
/**

View File

@@ -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)