List of usage examples for android.view View setScaleY
public void setScaleY(float scaleY)
From source file:Main.java
public static void onCompare(View v) { v.setScaleX(0f);//from www. j a v a2s.com v.setScaleY(0f); v.animate().setInterpolator(new OvershootInterpolator()).scaleX(1).scaleY(1).setDuration(150); }
From source file:Main.java
public static void animateScaleIn(View view, long duration, Animator.AnimatorListener listener) { view.setScaleX(0f);// w ww. j av a 2 s. c o m view.setScaleY(0f); view.setVisibility(View.VISIBLE); AnimatorSet scaleSet = new AnimatorSet(); scaleSet.playTogether(ObjectAnimator.ofFloat(view, View.SCALE_X, 1f), ObjectAnimator.ofFloat(view, View.SCALE_Y, 1f)); scaleSet.setInterpolator(new AccelerateDecelerateInterpolator()); scaleSet.setDuration(duration); if (listener != null) { scaleSet.addListener(listener); } scaleSet.start(); //return scaleSet; }
From source file:Main.java
public static void animateScaleOut(final View view) { if (!view.isShown()) { view.setScaleX(0.2f);//from ww w.ja v a 2 s . com view.setScaleY(0.2f); view.animate().setStartDelay(200).alpha(1).scaleX(1).scaleY(1) .setListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { view.setVisibility(View.VISIBLE); } @Override public void onAnimationCancel(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } }); } }
From source file:com.grottworkshop.gwsmaterialviewpagerreg.Utils.java
/** * modify the scale of multiples views/* w ww. j a v a 2s . c om*/ * @param scale the new scale * @param views the views */ public static void setScale(float scale, View... views) { for (View view : views) { if (view != null) { view.setScaleX(scale); view.setScaleY(scale); } } }
From source file:Main.java
public static void scaleView(View view, float originalSize, float finalSize, float percent) { float calcSize = (finalSize - originalSize) * percent + originalSize; float caleScale = calcSize / originalSize; view.setScaleX(caleScale);/* w w w . j a v a2s. c om*/ view.setScaleY(caleScale); }
From source file:by.gdgminsk.animationguide.util.AnimUtils.java
public static void scaleIn(final View view, int delay) { view.setAlpha(0.0f);// ww w. j a v a 2 s . c o m view.setScaleX(0.0f); view.setScaleY(0.0f); PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 1.0f); PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.0f); PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.0f); ObjectAnimator scaleInAnimation = ObjectAnimator.ofPropertyValuesHolder(view, alpha, scaleX, scaleY); scaleInAnimation.setDuration(view.getResources().getInteger(R.integer.duration_fab_scale_in)); scaleInAnimation.setStartDelay(delay); scaleInAnimation.setInterpolator(EASE_IN_INTERPOLATOR); scaleInAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { view.setVisibility(View.VISIBLE); } @Override public void onAnimationCancel(Animator animation) { view.setAlpha(1.0f); view.setScaleX(1.0f); view.setScaleY(1.0f); } }); scaleInAnimation.start(); }
From source file:Main.java
public static void animatePhotoLike(final View vBgLike, final View ivLike) { vBgLike.setVisibility(View.VISIBLE); ivLike.setVisibility(View.VISIBLE); vBgLike.setScaleY(0.1f); vBgLike.setScaleX(0.1f);//from w w w. ja v a 2s.c o m vBgLike.setAlpha(1f); ivLike.setScaleY(0.1f); ivLike.setScaleX(0.1f); android.animation.AnimatorSet animatorSet = new android.animation.AnimatorSet(); android.animation.ObjectAnimator bgScaleYAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "scaleY", 0.1f, 1f); bgScaleYAnim.setDuration(200); bgScaleYAnim.setInterpolator(DECELERATE_INTERPOLATOR); android.animation.ObjectAnimator bgScaleXAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "scaleX", 0.1f, 1f); bgScaleXAnim.setDuration(200); bgScaleXAnim.setInterpolator(DECELERATE_INTERPOLATOR); android.animation.ObjectAnimator bgAlphaAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "alpha", 1f, 0f); bgAlphaAnim.setDuration(200); bgAlphaAnim.setStartDelay(150); bgAlphaAnim.setInterpolator(DECELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleUpYAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleY", 0.1f, 1f); imgScaleUpYAnim.setDuration(300); imgScaleUpYAnim.setInterpolator(DECELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleUpXAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleX", 0.1f, 1f); imgScaleUpXAnim.setDuration(300); imgScaleUpXAnim.setInterpolator(DECELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleDownYAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleY", 1f, 0f); imgScaleDownYAnim.setDuration(300); imgScaleDownYAnim.setInterpolator(ACCELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleDownXAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleX", 1f, 0f); imgScaleDownXAnim.setDuration(300); imgScaleDownXAnim.setInterpolator(ACCELERATE_INTERPOLATOR); animatorSet.playTogether(bgScaleYAnim, bgScaleXAnim, bgAlphaAnim, imgScaleUpYAnim, imgScaleUpXAnim); animatorSet.play(imgScaleDownYAnim).with(imgScaleDownXAnim).after(imgScaleUpYAnim); animatorSet.addListener(new android.animation.AnimatorListenerAdapter() { @Override public void onAnimationEnd(android.animation.Animator animation) { vBgLike.setVisibility(View.INVISIBLE); ivLike.setVisibility(View.INVISIBLE); } }); animatorSet.start(); }
From source file:Main.java
public static void animatePhotoLike(final View vBgLike, final View ivLike) { vBgLike.setVisibility(View.VISIBLE); ivLike.setVisibility(View.VISIBLE); vBgLike.setScaleY(0.1f); vBgLike.setScaleX(0.1f);/*from w w w .j a v a2 s . co m*/ vBgLike.setAlpha(1f); ivLike.setScaleY(0.1f); ivLike.setScaleX(0.1f); android.animation.AnimatorSet animatorSet = new android.animation.AnimatorSet(); android.animation.ObjectAnimator bgScaleYAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "scaleY", 0.1f, 1f); bgScaleYAnim.setDuration(200); bgScaleYAnim.setInterpolator(DECCELERATE_INTERPOLATOR); android.animation.ObjectAnimator bgScaleXAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "scaleX", 0.1f, 1f); bgScaleXAnim.setDuration(200); bgScaleXAnim.setInterpolator(DECCELERATE_INTERPOLATOR); android.animation.ObjectAnimator bgAlphaAnim = android.animation.ObjectAnimator.ofFloat(vBgLike, "alpha", 1f, 0f); bgAlphaAnim.setDuration(200); bgAlphaAnim.setStartDelay(150); bgAlphaAnim.setInterpolator(DECCELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleUpYAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleY", 0.1f, 1f); imgScaleUpYAnim.setDuration(300); imgScaleUpYAnim.setInterpolator(DECCELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleUpXAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleX", 0.1f, 1f); imgScaleUpXAnim.setDuration(300); imgScaleUpXAnim.setInterpolator(DECCELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleDownYAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleY", 1f, 0f); imgScaleDownYAnim.setDuration(300); imgScaleDownYAnim.setInterpolator(ACCELERATE_INTERPOLATOR); android.animation.ObjectAnimator imgScaleDownXAnim = android.animation.ObjectAnimator.ofFloat(ivLike, "scaleX", 1f, 0f); imgScaleDownXAnim.setDuration(300); imgScaleDownXAnim.setInterpolator(ACCELERATE_INTERPOLATOR); animatorSet.playTogether(bgScaleYAnim, bgScaleXAnim, bgAlphaAnim, imgScaleUpYAnim, imgScaleUpXAnim); animatorSet.play(imgScaleDownYAnim).with(imgScaleDownXAnim).after(imgScaleUpYAnim); animatorSet.addListener(new android.animation.AnimatorListenerAdapter() { @Override public void onAnimationEnd(android.animation.Animator animation) { vBgLike.setVisibility(View.INVISIBLE); ivLike.setVisibility(View.INVISIBLE); } }); animatorSet.start(); }
From source file:Main.java
private static void scaleInternal(final View view, int startScaleValue, int endScaleValue, int durationMs, int startDelay, AnimatorListenerAdapter listener, Interpolator interpolator) { view.setScaleX(startScaleValue);/*from www.j av a2s.c o m*/ view.setScaleY(startScaleValue); final ViewPropertyAnimator animator = view.animate(); animator.cancel(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { animator.setInterpolator(interpolator).scaleX(endScaleValue).scaleY(endScaleValue) .setListener(listener); } else { animator.setInterpolator(interpolator).scaleX(endScaleValue).scaleY(endScaleValue).setListener(listener) .withLayer(); } if (durationMs != DEFAULT_DURATION) { animator.setDuration(durationMs); } animator.setStartDelay(startDelay); animator.start(); }
From source file:com.kogitune.activitytransition.core.TransitionAnimation.java
private static void runEnterAnimation(MoveData moveData, TimeInterpolator interpolator) { final View toView = moveData.toView; toView.setPivotX(0);/*from w w w . j a v a 2s.c om*/ toView.setPivotY(0); toView.setScaleX(moveData.widthScale); toView.setScaleY(moveData.heightScale); toView.setTranslationX(moveData.leftDelta); toView.setTranslationY(moveData.topDelta); toView.animate().setDuration(moveData.duration).scaleX(1).scaleY(1).translationX(0).translationY(0) .setInterpolator(interpolator); }