Animation scaling, like translation animation

I am implementing large-scale animation for practice in the game. I follow all the guidelines, but something strange always happens, and does not make the object larger. animation not only makes the image larger, but also moves it, even if I do not use translational animation ...

here is the xml file

<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"    
 xmlns:android="http://schemas.android.com/apk/res/android">
<scale
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:fromXScale="1.0"
    android:toXScale="1.4"
    android:fromYScale="1.0"
    android:toYScale="1.4"
    android:pivotX="50%"
    android:pivotY="50%"
    android:fillAfter="false"
    android:duration="1000" />
 </set>

and here it is called in java

private void startAnimation(final ImageView imageView) {
        final Animation popAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.scalebounce);
        imageView.startAnimation(popAnim);
        popAnim.setAnimationListener(new AnimationListener() {

            public void onAnimationStart(Animation animation) {

            }

            public void onAnimationRepeat(Animation animation) {

            }

            public void onAnimationEnd(Animation animation) {
                imageView.clearAnimation();
                imageView.setVisibility(View.GONE);
            }
        });
    }

its really strange, I tried all the solutions that I found on the network, but no luck, it still does this to translate the behavior, although this is only a scale ... im, making the image from a small point, then it gets bigger ( normal size). but I don’t want him to move, just to be in his place. thanks:)

P.S , , , , . ? ?

+4
2

pivotX pivotY , .

, :

enter image description here

, , , .

pivotX/pivotY 0, , .

pivotX = view.getWidth() / 2f pivotY = view.getHeight() / 2f, , ( )

, :)

+2

. , , , . Ihad scrollview relativelayout relativelayout.When , ther , , java-, xml, RELATIVE_TO_PARENT RELATIVE_TO_SELF, , (scrollview). , . , , :

ScaleAnimation animation = new ScaleAnimation(1.0f, 1.1f, 1.1f, 1.0f, Animation.RELATIVE_TO_PARENT, (float) (button1.getX()+ 45*ssu) / width, Animation.RELATIVE_TO_PARENT, (float) (button1.getY()+ 45*ssu) / (4 * height) );
                animation.setDuration(1000);
                animation.setRepeatMode(ValueAnimator.REVERSE);
                animation.setRepeatCount(animation.INFINITE);
                button1.startAnimation(animation);

, pivotX ( x ), (y ) ( 4 *), 45 * ssu , , . PS: ssu , java- 90 * ssu

II :)

+1

All Articles