mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix animation when card moves and updates simultaneously
This commit is contained in:
@@ -388,10 +388,17 @@ public class HabitCardListCache implements CommandRunner.Listener
|
||||
|
||||
int prevPosition = data.habits.indexOf(habit);
|
||||
|
||||
if (prevPosition < 0) performInsert(habit, currentPosition);
|
||||
else if (prevPosition == currentPosition)
|
||||
if (prevPosition < 0)
|
||||
{
|
||||
performInsert(habit, currentPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prevPosition != currentPosition)
|
||||
performMove(habit, prevPosition, currentPosition);
|
||||
|
||||
performUpdate(id, currentPosition);
|
||||
else performMove(habit, prevPosition, currentPosition);
|
||||
}
|
||||
}
|
||||
|
||||
private void processRemovedHabits()
|
||||
|
||||
Reference in New Issue
Block a user