FileDocCategorySizeDatePackage
Scale.javaAPI DocAndroid 5.1 API2440Thu Mar 12 22:22:56 GMT 2015android.support.v17.leanback.transition

Scale

public class Scale extends android.transition.Transition
hide

Fields Summary
private static final String
PROPNAME_SCALE
Constructors Summary
public Scale()


      
    
Methods Summary
public voidcaptureEndValues(android.transition.TransitionValues transitionValues)

        captureValues(transitionValues);
    
public voidcaptureStartValues(android.transition.TransitionValues transitionValues)

        captureValues(transitionValues);
    
private voidcaptureValues(android.transition.TransitionValues values)

        View view = values.view;
        values.values.put(PROPNAME_SCALE, view.getScaleX());
    
public android.animation.AnimatorcreateAnimator(android.view.ViewGroup sceneRoot, android.transition.TransitionValues startValues, android.transition.TransitionValues endValues)

        if (startValues == null || endValues == null) {
            return null;
        }

        final float startScale = (Float) startValues.values.get(PROPNAME_SCALE);
        final float endScale = (Float) endValues.values.get(PROPNAME_SCALE);

        final View view = startValues.view;
        view.setScaleX(startScale);
        view.setScaleY(startScale);

        ValueAnimator animator = ValueAnimator.ofFloat(startScale, endScale);
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                final float scale = (Float) animation.getAnimatedValue();
                view.setScaleX(scale);
                view.setScaleY(scale);
            }
        });
        return animator;