It is CardView connect the animation of clicking on CardView , when the code is shown below, the animation is present, but the action does not occur, if you remove the android:clickable="true" action works, and the animation disappears.

 <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/themeCardView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/cardview_my_layout_margin" android:foreground="?android:attr/selectableItemBackground"> <TextView android:id="@+id/themeTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" android:textColor="?attr/editTextColor" android:textSize="18sp"/> 

at the moment the situation is this: there is animation on API16, there is no animation on API23.

  • put the logs that they write ??? layings done? - elik

1 answer 1

And what do you have a clicker installed? If the internal content - the animation will not work. It works for View , on which the click listener is hung. It should work without clicable if the listener is hung on the card itself. For this, she needs to give out an id, find a listener by ID and hang it.

  • listener on LinearLayout in which CardView is located (inserted code with it, but for some reason LinearLayout doesn’t show in question) - Maxim Fomichev
  • @MaksimFomichev, this LinearLayout seems to be superfluous. You can remove it and hang the listener on the card. Well, or not removing the listener on the card to hang. And it does not show, because There was no 4 space from the code block - YuriySPb ♦
  • I removed LinearLayout, I hung a listener on CardView and it means I got this situation: there is animation on API16, there is no animation on API23 - Maxim Fomichev
  • @MaximFomichev, try to remove elevation - YuriySPb ♦
  • thanks, but did not help - Maxim Fomichev