List of usage examples for android.view ViewGroup getScaleX
@ViewDebug.ExportedProperty(category = "drawing") public float getScaleX()
From source file:com.skydoves.elasticviewsexample.ElasticVIews.ElasticAction.java
public static void doAction(ViewGroup view, int duration, float scaleX, float scaleY) { try {/*from w w w.j a v a2s. c o m*/ if (view.getScaleX() == 1) { ViewCompat.animate(view).setDuration(duration).scaleX(scaleX).scaleY(scaleY) .setInterpolator(new CycleInterpolator(0.5f)) .setListener(new ViewPropertyAnimatorListener() { @Override public void onAnimationStart(final View view) { } @Override public void onAnimationEnd(final View v) { } @Override public void onAnimationCancel(final View view) { } }).withLayer().start(); for (int index = 0; index < ((ViewGroup) view).getChildCount(); ++index) { View nextChild = ((ViewGroup) view).getChildAt(index); ViewCompat.animate(nextChild).setDuration(duration).scaleX(scaleX).scaleY(scaleY) .setInterpolator(new CycleInterpolator(0.5f)) .setListener(new ViewPropertyAnimatorListener() { @Override public void onAnimationStart(final View view) { } @Override public void onAnimationEnd(final View v) { } @Override public void onAnimationCancel(final View view) { } }).withLayer().start(); } } } catch (Exception e) { Log.e(TAG, "only ViewGroups : likes RelativeLayout, LinearLayout, etc could doAction"); } }