Animation issues with KitKat

I am getting complaints from Android 4.4.4 users about strange rendering issues with my animation. So far, I have not received any complaints from other Android versions. I also cannot reproduce the bug in the emulator (or on my Nexus 7 which used one of the two complaints).

I have a complex layout with two fragments. The animation snippet has a ViewFlipper that contains the relative layout of the flash card object that is flipped (flipped). The flash card background is a gradient defined in XML. The gradient seems to become semi-transparent after animation.

I don't want to post too much code to make the question too confusing. Here are screenshots from one of the users that clearly show the problem. If you have any suggestions please let me know and I'll post the relevant code / layouts / etc.

This is what the layout looks like:

This is how the layout should look

This is how the layout unfolds after the flip animation:

This is how the layout breaks after the flip animation

+3


source to share


1 answer


I had the same problem and found this: Issue 70914
You need to call setLayerType (View.LAYER_TYPE_SOFTWARE, null) on the animated view.

The View.LAYER_TYPE_SOFTWARE field requires API level 11, so I did it like this:



    if(Build.VERSION.SDK_INT > 11)
    {
        for(View v : rotatedViews)
        {
            v.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
        }
     }

      

+2


source







All Articles