Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android scale animation flickering

I have frame layout in my app. In frame I have ImageView and TextView. I need to frame layout bounce all the time.

I've made this animation in xml:

<scale
    android:duration="100"
    android:fromXScale="0.1"
    android:fromYScale="0.1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="1.0"
    android:toYScale="1.0" />

<scale
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1200"
    android:fillAfter="false"
    android:fromXScale="1.0"
    android:fromYScale="1.0"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:startOffset="100"
    android:repeatCount="infinite"
    android:repeatMode="reverse"
    android:toXScale="0.9"
    android:toYScale="0.9" />

The problem is flickering of the text in text view. ImageView is fine. How to prevent this issue?

like image 665
Veljko Avatar asked Aug 15 '26 00:08

Veljko


1 Answers

I found the solution for this:

in Manifest.xml set hardwareAccelerated to true.

like image 65
Veljko Avatar answered Aug 17 '26 14:08

Veljko