API 11+:
Add android:foreground="?android:attr/selectableItemBackground"
to your CardView
element.
API 9+:
Add android:foreground="?selectableItemBackground"
to your CardView
element.
Edit: The ripple originating from the center and not from the touch point is a known bug, and has been fixed.
More Related Contents:
- CardView layout_width=”match_parent” does not match parent RecyclerView width
- Ripple effect on Android Lollipop CardView
- Cardview shadow not appearing in lollipop devices?
- RecyclerView inside ScrollView is not working
- How can I change default dialog button text color in android 5
- Error inflating class and android.support.v7.widget.CardView
- How can I align Android Toolbar menu/icons to the left like in Google Maps app?
- CardView not showing Shadow in Android L
- application content goes behind the navigation bar in android L
- Using android.support.v7.widget.CardView in my project (Eclipse)
- OnClickListener for CardView?
- How can I modify ripple color when using ?attr/selectableItemBackground as background?
- Change the background color of CardView programmatically
- How to use setOutlineProvider instead of setOutline in Lollipop
- Hide/Show bottomNavigationView on Scroll
- Android 5.0 android:elevation Works for View, but not Button?
- Android Lollipop, AppCompat ActionBar custom view doesn’t take up whole screen width
- Place 2 textview beside each other with 2nd textview always visible
- Heterogeneous GridLayout
- Restoring state of TextView after screen rotation?
- How to use View.OnTouchListener instead of onClick
- CollapsingToolbarLayout subtitle
- How to change Toolbar Navigation and Overflow Menu icons (appcompat v7)?
- Android: is using setContentView multiple times bad while changing layouts?
- Android Keyboard hides EditText
- How to turn off CalendarView in a DatePicker?
- Android Studio (Dolphin | 2021.3.1) & (Electric Eel | 2022.1.1) does not show layout preview
- Hex colors in Android are sometimes eight digits. How? What is the difference between #FFFFFF and #FFFFFF00?
- What event is fired after all views are fully drawn?
- ERROR No package identifier when getting value for resource number