Search code examples
androidanimationviewscale

Android scale view


I need to scale View by setting the scale factor in percents. I need to set exactly the same param as ScaleAnimation use, because I'm going to scale it using ScaleAnimation in the future. How do I do it?

Thanks


Solution

  • I've solved the problem by creating animation xml file with duration=0, which sets desired parameters. It is also possible to create such animation via code. Then to apply it, just use:

    Animation animationInit = AnimationUtils.loadAnimation(context, R.anim.gallery_init);
    v.startAnimation(animationInit);