Another simple question that I can't seem to wrap my head around. I want an animation using ObjectAnimator to scale upwards from the center. However, I'm not sure how to set the PivotX/Y properties as any value I apply doesn't seem to affect the view. When I was using a scaleanimation, it worked fine but I must use an ObjectAnimator here.
I've tried
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view,"scaleX",0.0f,1.0f);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view,"scaleY",0.0f,1.0f);
//I've tried a wide range of values from 0,0 to 0,0.5, to 0.5, 0.5 but none of them do anything
ObjectAnimator pivotX = ObjectAnimator.ofFloat(view,"pivotX",0,1f);
ObjectAnimator pivotY = ObjectAnimator.ofFloat(view,"pivotY",0,1f);
//I've also tried view.setPivotX(0.5f) but that didn't do anything either
animatorSet.playTogether(scaleX,scaleY,pivotX,pivotY);
animatorSet.start();
I'm just not really sure how to make it scale from the center. I've tried not even using pivot but that didn't do anything either.
Any help is appreciated,
Thanks
** EDIT **
The following sort of works, except it isn't completely centered it instead grows towards the top left but still sort of centered. Its hard to describe. I tried using 0.5f and it didn't work either
ObjectAnimator pivotX = ObjectAnimator.ofFloat(view,"pivotX",1f);
ObjectAnimator pivotY = ObjectAnimator.ofFloat(view,"pivotY",1f);