|
|
@ -9,7 +9,6 @@ import android.graphics.Canvas;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
|
|
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import com.todoroo.astrid.adapter.CaldavTaskAdapter;
|
|
|
|
|
|
|
|
import com.todoroo.astrid.adapter.TaskAdapter;
|
|
|
|
import com.todoroo.astrid.adapter.TaskAdapter;
|
|
|
|
import com.todoroo.astrid.utility.Flags;
|
|
|
|
import com.todoroo.astrid.utility.Flags;
|
|
|
|
import org.tasks.data.TaskContainer;
|
|
|
|
import org.tasks.data.TaskContainer;
|
|
|
@ -141,17 +140,13 @@ public class ItemTouchHelperCallback extends ItemTouchHelper.Callback {
|
|
|
|
if (from < to) {
|
|
|
|
if (from < to) {
|
|
|
|
to++;
|
|
|
|
to++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!(adapter instanceof CaldavTaskAdapter)) {
|
|
|
|
vh.task.setIndent(targetIndent);
|
|
|
|
vh.task.setIndent(targetIndent);
|
|
|
|
vh.setIndent(targetIndent);
|
|
|
|
vh.setIndent(targetIndent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
recyclerAdapter.moved(from, to, targetIndent);
|
|
|
|
recyclerAdapter.moved(from, to, targetIndent);
|
|
|
|
} else if (task.getIndent() != targetIndent) {
|
|
|
|
} else if (task.getIndent() != targetIndent) {
|
|
|
|
int position = vh.getAdapterPosition();
|
|
|
|
int position = vh.getAdapterPosition();
|
|
|
|
if (!(adapter instanceof CaldavTaskAdapter)) {
|
|
|
|
vh.task.setIndent(targetIndent);
|
|
|
|
vh.task.setIndent(targetIndent);
|
|
|
|
vh.setIndent(targetIndent);
|
|
|
|
vh.setIndent(targetIndent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
recyclerAdapter.moved(position, position, targetIndent);
|
|
|
|
recyclerAdapter.moved(position, position, targetIndent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|