mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 09:38:52 -06:00
Fix reordering
This commit is contained in:
@@ -205,6 +205,8 @@ public class SQLiteHabitList extends HabitList
|
|||||||
record.save();
|
record.save();
|
||||||
|
|
||||||
update(from);
|
update(from);
|
||||||
|
|
||||||
|
getObservable().notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -178,8 +178,6 @@ public class HabitCardListAdapter extends BaseAdapter
|
|||||||
public void reorder(int from, int to)
|
public void reorder(int from, int to)
|
||||||
{
|
{
|
||||||
cache.reorder(from, 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)
|
public void reorder(int from, int to)
|
||||||
{
|
{
|
||||||
Habit fromHabit = data.habitsList.get(from);
|
Habit fromHabit = data.habitsList.get(from);
|
||||||
Habit toHabit = data.habitsList.get(to);
|
|
||||||
|
|
||||||
data.habitsList.remove(from);
|
data.habitsList.remove(from);
|
||||||
data.habitsList.add(to, fromHabit);
|
data.habitsList.add(to, fromHabit);
|
||||||
|
if(listener != null) listener.onCacheRefresh();
|
||||||
allHabits.reorder(fromHabit, toHabit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckmarkCount(int checkmarkCount)
|
public void setCheckmarkCount(int checkmarkCount)
|
||||||
|
|||||||
Reference in New Issue
Block a user