protected void checkObj() { if(animator == null) { animator = new ObjectAnimator(); } }
ObjectAnimator objectAnimator1 = new ObjectAnimator(); objectAnimator.setPropertyName("animX"); objectAnimator.setFloatValues(0, 1); objectAnimator.setTarget(logoView);//call this when your ready to set target objectAnimator.setDuration(1000);
private ObjectAnimator newObjectAnimator() { mAnimListenerAdapter = new AnimListenerAdapter(); mPropertyValuesHolderList = new ArrayList<>(); ObjectAnimator animation = new ObjectAnimator(); animation.setTarget(mTarget); animation.addListener(mAnimListenerAdapter); return animation; }
private void initAnimator() { mPressAnimator = ObjectAnimator.ofFloat(this, DEGREE, 0, -45); mPressAnimator.setDuration(1000); mUpAnimator = new AnimatorSet(); mDegreeAnimator = new ObjectAnimator(); mDegreeAnimator.setTarget(this); mDegreeAnimator.setProperty(DEGREE); mBallAnimator = new ObjectAnimator(); mBallAnimator.setTarget(this); mBallAnimator.setProperty(BALLLOCATION); mUpAnimator.playTogether(mDegreeAnimator, mBallAnimator); }
private void startAnimator1() { ObjectAnimator animator1 = new ObjectAnimator(); animator1.setTarget(textView1); animator1.setPropertyName("translationY"); animator1.setFloatValues(0f, -100f); animator1.setDuration(1000); animator1.setInterpolator(new LinearInterpolator()); animator1.setEvaluator(EasingFunction.BOUNCE_OUT); animator1.start(); } }
ScaleAnimatorImpl(View target, int maxScale) { this.maxScale = maxScale; this.animatorX = new ObjectAnimator(); animatorX.setProperty(SCALE_X); animatorX.setTarget(target); this.animatorY = new ObjectAnimator(); animatorY.setProperty(SCALE_Y); animatorY.setTarget(target); }
/** * @param view * @param interpolator */ private void setCurvedMotion(TextView view, int interpolator) { path = new Path(); path.moveTo(view.getLeft(), view.getTop()); path.lineTo(view.getLeft(), 600); animator = new ObjectAnimator().ofFloat(view, View.X, View.Y, path); animator.setInterpolator(new AnimationUtils().loadInterpolator( this, interpolator)); animator.setDuration(2000); animator.start(); } }
private void animateOffsetToEnd(final String propertyName, final Interpolator interpolator, float... value) { if (mResetAnimator == null) { mResetAnimator = new ObjectAnimator(); mResetAnimator.setTarget(this); } mResetAnimator.cancel(); mResetAnimator.setPropertyName(propertyName); mResetAnimator.setFloatValues(value); mResetAnimator.setInterpolator(interpolator); mResetAnimator.start(); }
private void startAnimator2() { ObjectAnimator animator2 = new ObjectAnimator(); animator2.setTarget(textView2); animator2.setPropertyName("translationY"); animator2.setFloatValues(0f, -100f); animator2.setDuration(1000); animator2.setInterpolator(EasingFunction.BOUNCE_OUT); animator2.setEvaluator(new FloatEvaluator()); animator2.start(); }
rotationAnimator=new ObjectAnimator(); rotationAnimator.setTarget(rotationController); rotationAnimator.setPropertyName("mapRotation"); ValueAnimator.setFrameDelay(24); rotationAnimator.setDuration(ROTATION_DURATION); rotationAnimator.setRepeatCount(ValueAnimator.INFINITE); rotationAnimator.setRepeatMode(ValueAnimator.RESTART); AnimatorSet animatorSet = new AnimatorSet(); animatorSet.getChildAnimations().add(rotationAnimator); animatorSet.setInterpolator(new LinearInterpolator()); ... animatorSet.start();
private void startAnimator2() { ObjectAnimator animator2 = new ObjectAnimator(); animator2.setTarget(textView2); animator2.setPropertyName("translationY"); animator2.setFloatValues(0f, -100f); animator2.setDuration(1000); animator2.setInterpolator(Functions.with(new IFunction() { @Override public float getValue(float input) { return input * 2 + 3; } })); animator2.setEvaluator(new FloatEvaluator()); animator2.start(); }
public static ObjectAnimator ofPropertyValuesHolder(View target, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, target); return anim; }
public static ObjectAnimator ofPropertyValuesHolder(View target, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, target); return anim; }
public static ObjectAnimator ofPropertyValuesHolder(Object target, View view, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, view); return anim; }
public static ObjectAnimator ofPropertyValuesHolder(Object target, View view, PropertyValuesHolder... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, view); return anim; }
private ObjectAnimator getAnimator(AnimatedVectorDrawable vector, int in, int out, int delay) { ObjectAnimator animator = new ObjectAnimator(); animator.setTarget(vector); animator.setPropertyName("pathData"); TypeEvaluator evaluator = PathAnimatorInflater.setupAnimatorForPath(animator, getResources().getString(in), getResources().getString(out)); if (evaluator == null) { return null; } animator.setEvaluator(evaluator); animator.setRepeatMode(ValueAnimator.REVERSE); animator.setDuration(3000); animator.setStartDelay(delay); return animator; }
public static ObjectAnimator ofFloat(View target, String propertyName, float... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setPropertyName(propertyName); anim.setFloatValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, target); return anim; }
public static ObjectAnimator ofFloat(View target, String propertyName, float... values) { ObjectAnimator anim = new ObjectAnimator(); anim.setTarget(target); anim.setPropertyName(propertyName); anim.setFloatValues(values); cancelOnDestroyActivity(anim); new FirstFrameAnimatorHelper(anim, target); return anim; }
@Implementation public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) { ObjectAnimator result = new ObjectAnimator(); result.setTarget(target); result.setPropertyName(propertyName); result.setFloatValues(values); RobolectricShadowOfLevel16.shadowOf(result).setAnimationType(float.class); return result; }
@Test public void testDispatchDrawWithErrorMargin() throws NoSuchFieldException, IllegalAccessException { customView.setErrorMargin(10, 10); customView.setError("error"); Field field = FloatingLabelSpinner.class.getDeclaredField("errorAnimator"); field.setAccessible(true); field.set(customView, new ObjectAnimator()); customView.setHint("hint"); customView.setError("error"); customView.dispatchDraw(new Canvas()); }