PivotX and PivotY do not affect ScaleAnimation

I am trying to scale the view equivalent to the right and left of the center of the view using ScaleAnimation. Regardless of the values ​​I set for pivotX and PivotY, it always scales the same way (for example, the right edge seems to scale, keeping the left edge constant). Below is the code I used to initialize ScaleAnimation. Can someone please let me know if I am doing something wrong ?. Thank you

final ScaleAnimation scaleAnim = new ScaleAnimation(1.0f, 2.0f, 1.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 
+7
source share
1 answer

Initializing the animation solved the problem.

I just used the code below to initialize it.

  anim.initialize(/* animate view */child.getWidth(), child.getHeight(), /* parents view */ this.getWidth(), this.getHeight()); 
+3
source

All Articles