Touch feedback with RecyclerView and CardView

前端 未结 10 755
一向
一向 2020-12-07 09:32

I would love to enable touch feedback for my Open-Source library.

I\'ve created a RecyclerView and a CardView. The CardView co

10条回答
  •  感情败类
    2020-12-07 10:05

    The actual silly issue was in my case is the following....

    Technically, It's not the case just like everyone suggests here in my case. The real issue is you should not be using android:clickable="true" uncesseriliy everywhere in the LayoutView, RelativeView or TextView.

    It should only be in CardView. Then it works like charm

    android:focusable="true" Is not really requied.

    Just add the following in your CardView

    android:clickable="true" android:foreground="?android:attr/selectableItemBackground"


    
    
    
        
    
            
    
                
    
                
    
                
    
            
    
        
    
    
    

提交回复
热议问题