0

I'm using TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta) but fromXDelta, toXDelta, fromYDelta, toYDelta are pixel. How to change pixel to percentage (I don't want to use animation wiht xml file)?

dakshbhatt21
  • 3,558
  • 3
  • 31
  • 40

1 Answers1

0

You need to use the TranslateAnimation constructor that takes typing of input.

Animation.RELATIVE_TO_SELF will move the animation in reference to itself where 1.0f equals 100% of the length/width of the object to be translated.

mach
  • 8,315
  • 3
  • 33
  • 51