Why is my rotation animation alternating on some android devices

I have an image behind some buttons and it works great on my HTC One X, but on HTC One it lags behind and makes the app useless. It also works on my nexus 7 (new and old) and old asus tablet. they are all on 4.4. I also got some game reviews that mentioned lagging on the Galaxy S5, Xpreia Z1.

Any idea why this is?

Here's the animation code:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/linear_interpolator">

    <rotate
        android:duration="100000"
        android:fromDegrees="0"
        android:toDegrees="360"
        android:pivotX="50%"
        android:pivotY="50%"
        android:repeatCount="infinite" />

</set>

      

And in my activity I just call the onCreate method

rotate = AnimationUtils.loadAnimation(this, R.anim.rotate);
rotateview = (ImageView) this.findViewById(R.id.imageView1);
rotateview.startAnimation(rotate);

      

Imageview xml:

<ImageView
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/fog"
        android:layout_marginRight="-200dp"
        android:layout_marginLeft="-200dp"
        android:layout_marginTop="-200dp"
        android:layout_marginBottom="-200dp"
        android:alpha="0.5" />

      

I also have an alternate version of the image that causes the same problem:

<ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="400dp"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:src="@drawable/ring"
            android:alpha="0.5" />

      

+3


source to share


1 answer


Maybe you should add android:hardwareAccelerated="true"

to a tag <application>

in your AndroidManifest.xml



+1


source







All Articles