Fast taps (clicks) on RecyclerView opens multiple Fragments

前端 未结 10 903
渐次进展
渐次进展 2021-02-02 13:37

I have implemented onClick listener to my ViewHolder for my RecyclerView

But when I perform very fast double taps or mouse clicks, it performs the task (opens a seperate

10条回答
  •  生来不讨喜
    2021-02-02 13:52

    The most straightforward approach here would be using setMotionEventSplittingEnabled(false) in your RecyclerView.

    By default, this is set to true in RecyclerView, allowing multiple touches to be processed.

    When set to false, this ViewGroup method prevents the RecyclerView children to receive the multiple clicks, only processing the first one.

    See more about this here.

提交回复
热议问题