7

I'm trying to scale a View equivalent to the right and left from center of a View using ScaleAnimation . Whatever values I set for pivotX and PivotY it always scale in the same way (like right edge appears to be scaling keeping left edge constant). Below is the code I used to initialize the ScaleAnimation. Can anyone please let me know, if Im doing anything wrong?. Thanks.

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);
Elemental
  • 7,365
  • 2
  • 28
  • 33
Sukumar
  • 1,303
  • 10
  • 15

1 Answers1

3

Initialing the anim solved the problem.

I just used the below to code to initialise it.

    anim.initialize(/* animate view */child.getWidth(), 
                                     child.getHeight(),
                    /* parents view */ this.getWidth(), 
                                      this.getHeight());
Rotemmiz
  • 7,933
  • 3
  • 36
  • 36
Sukumar
  • 1,303
  • 10
  • 15