mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix reordering
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user