With the help of animation I turn the map over. The animation of the map passes correctly, but in the background and around there are some dark shadows or a dark vertical bar. On Android 4, it works properly. If you use LinerLayout instead of CardView works CardView . What could be the reason?
CardView imgFront = (CardView) view.findViewById(R.id.card_1); CardView imgBack = (CardView) view.findViewById(R.id.card_0); AnimatorSet setRightOut = (AnimatorSet) AnimatorInflater.loadAnimator(getApplicationContext(), R.animator.flight_right_out); AnimatorSet setLeftIn = (AnimatorSet) AnimatorInflater.loadAnimator(getApplicationContext(), R.animator.flight_left_in); if (!isBackVisible) { setRightOut.setTarget(imgFront); setLeftIn.setTarget(imgBack); setRightOut.start(); setLeftIn.start(); isBackVisible = true; } else { setRightOut.setTarget(imgBack); setLeftIn.setTarget(imgFront); setRightOut.start(); setLeftIn.start(); isBackVisible = false; } .
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <!-- Rotate. --> <objectAnimator android:valueFrom="-180" android:valueTo="0" android:propertyName="rotationY" android:interpolator="@android:interpolator/accelerate_decelerate" android:duration="500" /> <!-- When the roration reach half of animation, show the card --> <objectAnimator android:valueFrom="0.0" android:valueTo="1.0" android:propertyName="alpha" android:duration="1" android:startOffset="250"/> </set> 
CardViewtoLinearLayoutand using theandroid:background="@android:drawable/dialog_holo_light_frame"attributeandroid:background="@android:drawable/dialog_holo_light_frame"But the question remains open why does this happen when usingCardView? - Bogdan Shulga