use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method hideScaleAnimationFromPivot.
public static void hideScaleAnimationFromPivot(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(new AccelerateDecelerateInterpolator()).scaleY(SCALE_START_ANCHOR).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method showViewByScaleY.
/**
* Shows a view by scaling
*
* @param v the view to be scaled
*
* @return the ViewPropertyAnimation to manage the animation
*/
public static ViewPropertyAnimator showViewByScaleY(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(1);
propertyAnimator.setListener(animatorListener);
return propertyAnimator;
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method startScaleAnimationFromPivotY.
public static void startScaleAnimationFromPivotY(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
v.setScaleY(SCALE_START_ANCHOR);
v.setPivotX(pivotX);
v.setPivotY(pivotY);
v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
v.getViewTreeObserver().removeOnPreDrawListener(this);
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
return true;
}
});
}
use of android.view.ViewPropertyAnimator in project Android-Material-Examples by saulmm.
the class GUIUtils method showViewByScale.
public static void showViewByScale(View view) {
ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR).scaleX(1).scaleY(1);
propertyAnimator.start();
}
use of android.view.ViewPropertyAnimator in project Android-Material-Examples by saulmm.
the class GUIUtils method hideViewByScale.
public static void hideViewByScale(View view) {
ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR).scaleX(0).scaleY(0);
propertyAnimator.start();
}
Aggregations