0

Please Find the attachment for my image.

https://docs.google.com/file/d/0B_c-SDSO63obS0ZyQ1dsOXdUQmc/edit?usp=sharing

My task is, animate that GONG type of image up to some time with clock wise and anti clock wise.

For that i did some coding in animation but i didn't succeed. I am using both translate and rotate.

     <translate
        android:fromXDelta="0%p"
        android:toXDelta="75%p"
        android:duration="1500" />

and rotate functions,

      <rotate android:fromDegrees="0"
    android:toDegrees="360"
    android:pivotX="50%"
    android:pivotY="50%"
    android:duration="600"
    android:repeatMode="restart"
    android:repeatCount="infinite"
    android:interpolator="@android:anim/cycle_interpolator"/>

Actually my idea is in a specific time i want to move with specific angle. But i don't know the correct way to solve this task.

Please help me. sorry for my English.

All answers are acceptable

Thanks

Shankar

1 Answers1

0

You have divided a circle in 12 parts in that image and that equals to 30 degrees per segment. you have to rotate it like this to look proper

 rotateDegree=[steps]*30;

use AlarmManager to trigger animation in specific time

EDIT:

to move your image in circular path with a radius you have to give a different pivot x and y

you can find it by tryng with

 pivotX= 0 and pivotY=(negative value)

I hope this helps.

Ercan
  • 3,705
  • 1
  • 22
  • 37