Exemple #1
0
            public override bool OnMove(
                RecyclerView recyclerView,
                RecyclerView.ViewHolder viewHolder,
                RecyclerView.ViewHolder target)
            {
                if (_from == -1)
                {
                    _from = viewHolder.AdapterPosition;
                }

                _to = target.AdapterPosition;

                // System.Diagnostics.Debug.WriteLine($">>>>> OnMove( from: {viewHolder.AdapterPosition}, to: {target.AdapterPosition} )");
                _recycleViewAdapter.OnItemMoving(viewHolder.AdapterPosition, target.AdapterPosition);

                return(true);
            }
            public override bool OnMove(
                RecyclerView recyclerView,
                RecyclerView.ViewHolder viewHolder,
                RecyclerView.ViewHolder target)
            {
                if (((ViewHolder)target).ViewCell is DraggableViewCell draggableViewCell &&
                    !draggableViewCell.IsDraggable)
                {
                    return(false);
                }

                if (_from == -1)
                {
                    _from = viewHolder.AdapterPosition;
                }

                _to = target.AdapterPosition;

                // System.Diagnostics.Debug.WriteLine($">>>>> OnMove( from: {_from}, to: {_to} )");
                _recycleViewAdapter.OnItemMoving(viewHolder.AdapterPosition, target.AdapterPosition);

                return(true);
            }