Search code examples
androidandroid-layoutandroid-studiozooming

How can i decrease image size when image is falling from top to bottom?


How can i decrease image size when image is falling from top to bottom?

I have developed top to bottom process through below link

Android Layout Animations from bottom to top and top to bottom on ImageView click

But i am facing one problem.How can i decrease size of image when image is falling top to bottom?

Please let me share your idea or link and code.

Please see my requirement in below image.

enter image description here


Solution

  • you can apply scale transformation to that view.

    Matrix matrix = new Matrix();
    matrix.setScale(valueX, valueY);
    view.setTransform(matrix); 
    

    For imageView

    imageView.setImageMatrix(matrix);