AmrDeveloper / TreeView

Multi roots TreeView :palm_tree: implementation for Android Platform with a lot of options and customization
https://amrdeveloper.github.io/TreeView/
MIT License
174 stars 23 forks source link

No item click effect like RecyclerView #12

Closed ptu1710 closed 1 year ago

ptu1710 commented 1 year ago

Describe the bug My TreeView row using CardView, I set it to “selectableItemBackground” but no click effect work. It works fine with default RecyclerView (using same layout.xml).

To Reproduce Steps to reproduce the behavior:

  1. Create TreeView with custom tree node view
  2. Add android:focusable="true", android:clickable="true" and android:foreground="?attr/selectableItemBackground" to custom tree node view
  3. Click on 1 tree node
  4. No click effect performed

Expected behavior TreeView item should has ripple effect when clicked. https://drive.google.com/file/d/116yVaXkOfKYCWkDr6ZSc7rb4KdzsEnVd/view?usp=sharing

Video https://drive.google.com/file/d/118hr4uv6pyGhtSHLSnOu_EO6UP6h6vD8/view?usp=sharing

Smartphone (please complete the following information):

AmrDeveloper commented 1 year ago

Hello @ptu1710,

Thank you for reporting and creating sample for this issue, i have solved it and it increase the performance on the adapter, I will publish bug fix release now and you can try it after 1h.

https://github.com/AmrDeveloper/TreeView/assets/23631699/88e4980d-0f18-4272-9556-ed568f8b8df5

Thank you and Enjoy TreeView Amr Hesham

ptu1710 commented 1 year ago

Thanks for this quick fix! I will try it then.