Android rotation animation -


i have problem , can't manage find solution works. so, here problem. have make imageview rotate itself, 90 degree on orientation change. did that, , image rotating pretty awesome, when animation finishes, image reset previous position.

here code used rotate image:

   matrix matrix = mimageview.getimagematrix();                     rectf dst = new rectf();                     matrix.maprect(dst, new rectf(mimageview.getdrawable().getbounds()));                     manimation = new rotateanimation(0.0f, -90.0f, animation.relative_to_self, 0.5f,                             animation.relative_to_self, 0.5f);                     manimation.setduration(5000);                     mimageview.startanimation(manimation);                     mimageview.setimagematrix(matrix);                     mcurrentorientation = 1; 

you can use animation persist after has been done:

manimation.setfillenabled(true); manimation.setfillafter(true); 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -