question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not registering onClick in RecyclerView

See original GitHub issue

Using the VerticalOverScrollBounceEffectDecorator on a RecyclerView causes the first touch over the overscroll to be ignored.

Reproduce steps:

  • Swipe to overscroll (couple times)
  • Tap the first item in the recyclerview
  • No onclick is notified.

When debugging, it seems like the onTouchListener of the Recyclerview in the OverScrollBounceEffectDecoratorBase is called. This calls the UP on the IdleState and returns false.

But in a normal usecase, the onTouchListener shouldn’t be called when a item is clicked. So it seems like the first touch after the overscroll goes to the children instead of the RecyclerView items.

Currently using: new VerticalOverScrollBounceEffectDecorator(new RecyclerViewOverScrollDecorAdapter(mRecyclerView), 1.8f, VerticalOverScrollBounceEffectDecorator.DEFAULT_TOUCH_DRAG_MOVE_RATIO_BCK, VerticalOverScrollBounceEffectDecorator.DEFAULT_DECELERATE_FACTOR);

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
d4vidicommented, Dec 4, 2016

I’ve solved this issue, will post a new release asap.

2reactions
d4vidicommented, Dec 22, 2016

Released version 1.0.4 - please give it a try!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RecyclerView OnClick not working - Stack Overflow
Is it not firing at all or is it just firing incorrectly. You should be setting the onClick during the bindViewHolder() since you...
Read more >
A Better Way to Handle Click Action in a RecyclerVIew Item.
A Better Way to Handle Click Action in a RecyclerVIew Item. There are various approaches to set the OnClickListener to a RecyclerView item....
Read more >
Handling click events in RecyclerView | by Meghan Mehta
Before creating the listener, create a function in the Activity class that performs the action to be done upon click. Next, update the...
Read more >
Android Basics: RecyclerView - II, adding onClick to list items
Implement View.OnClickListener in the ViewHolder class and add itemView.setOnClickListener(this); in the ViewHolder constructor. Override ...
Read more >
RecyclerView Item Click Listener Best Practice - YouTube
Hello World, today we will take a quick look at what I consider to be the best practice when handling setting OnClickListener for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found