1 package org.robolectric.shadows; 2 3 import android.view.animation.Animation; 4 import android.view.animation.Transformation; 5 import org.robolectric.annotation.internal.DoNotInstrument; 6 import org.robolectric.util.ReflectionHelpers; 7 import org.robolectric.util.ReflectionHelpers.ClassParameter; 8 9 /** 10 * Bridge between shadows and {@link android.view.animation.Animation}. 11 */ 12 @DoNotInstrument 13 public class ShadowAnimationBridge { 14 private Animation realAnimation; 15 ShadowAnimationBridge(Animation realAnimation)16 public ShadowAnimationBridge(Animation realAnimation) { 17 this.realAnimation = realAnimation; 18 } 19 applyTransformation(float interpolatedTime, Transformation transformation)20 public void applyTransformation(float interpolatedTime, Transformation transformation) { 21 ReflectionHelpers.callInstanceMethod(realAnimation, "applyTransformation", 22 ClassParameter.from(float.class, interpolatedTime), 23 ClassParameter.from(Transformation.class, transformation)); 24 } 25 } 26