Java tutorial
//package com.java2s; //License from project: Apache License import android.animation.Animator; import android.animation.ObjectAnimator; import android.support.annotation.NonNull; import android.view.View; public class Main { /** * Animator to animate Y scale of the view. X scale is constant * * @param view View to be animated * @param pivotX x coordinate of the pivot * @param pivotY y coordinate of the pivot * @param fromScale initial scale * @param toScale final scale * @param duration animation duration in milliseconds * @return Animator Object */ @NonNull public static Animator scaleY(@NonNull View view, int pivotX, int pivotY, float fromScale, float toScale, int duration) { view.setPivotX(pivotX); view.setPivotY(pivotY); Animator animator = ObjectAnimator.ofFloat(view, "scaleY", fromScale, toScale); animator.setDuration(duration); return animator; } }