Fix animation when card moves and updates simultaneously

This commit is contained in:
2017-06-22 23:31:46 -04:00
parent 7872983064
commit f55dc0d811

View File

@@ -388,10 +388,17 @@ public class HabitCardListCache implements CommandRunner.Listener
int prevPosition = data.habits.indexOf(habit); int prevPosition = data.habits.indexOf(habit);
if (prevPosition < 0) performInsert(habit, currentPosition); if (prevPosition < 0)
else if (prevPosition == currentPosition) {
performInsert(habit, currentPosition);
}
else
{
if (prevPosition != currentPosition)
performMove(habit, prevPosition, currentPosition);
performUpdate(id, currentPosition); performUpdate(id, currentPosition);
else performMove(habit, prevPosition, currentPosition); }
} }
private void processRemovedHabits() private void processRemovedHabits()