3

I am implementing a RecyclerView with drag and drop functionality using ItemTouch.Callback. Right now the device vibrates slightly when I start dragging a ViewHolder.

How can I stop the device vibration when the drag begins?

Ehtesham Hasan
  • 4,133
  • 2
  • 23
  • 31

1 Answers1

3

Solved it by disabling haptic feedback of my ViewHolder.

public CustomViewHolder(View view)
{
    super(view);

    view.setHapticFeedbackEnabled(false);
}

You can also disable it for any view in XML by using the following.

android:hapticFeedbackEnabled="false"
Ehtesham Hasan
  • 4,133
  • 2
  • 23
  • 31