Android is redrawing all Views when applying animation on one view
Asked Answered
I

0

6

I have an Application that contains one layout with sevral views, when i animate one view all views are getting redrawn! is that the normal behavior or i am doing something false ? i would like to cancel this behavior and just redraw the views that i manually invalidate thanx

<SecondsArc 
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/secondsArc" 
android:background="#00000000" 
android_layout_gravity="center"></SecondsArc >

<MinutesArc
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/minutesArc" 
android:background="#00000000" 
android_layout_gravity="center"></MinutesArc >

i have say two custom views and the secondsArc view ist being animated every second and therefor redrawn 10 times per second the problem is that the MinutesArc is also redrawn ! the prolem is that i have about 10 views and all of the are redrawn 10 times per second .this method is called in the SecondsArc to rotate it

public void rotateByDegree(float degree){
    RotateAnimation rotateAnim = new RotateAnimation(currentDegree, currentDegree + degree, getWidth()/2,270);
    rotateAnim.setDuration(600);
    rotateAnim.setFillAfter(true);
    rotateAnim.setFillEnabled(true);
    this.startAnimation(rotateAnim);}
Insult answered 14/6, 2011 at 11:32 Comment(2)
Please post some sample code, so we can see what the problem is.Ginaginder
hello, i'm having the same kind of problem : when i fadeIn one ImageView element of my ListView with startAnimation, all visible ImageViews get animated (!). did you find out more about this issue?Antecede

© 2022 - 2024 — McMap. All rights reserved.