android.animation.ObjectAnimator.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中android.animation.ObjectAnimator.<init>()方法的一些代码示例,展示了ObjectAnimator.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectAnimator.<init>()方法的具体详情如下:
包路径:android.animation.ObjectAnimator
类名称:ObjectAnimator
方法名:<init>

ObjectAnimator.<init>介绍

暂无

代码示例

代码示例来源:origin: mime-mob/AndroidAdvanceAnimation

protected void checkObj() {
  if(animator == null) {
    animator = new ObjectAnimator();
  }
}

代码示例来源:origin: stackoverflow.com

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);

代码示例来源:origin: zzz40500/AnimatorCompat

private ObjectAnimator newObjectAnimator() {
  mAnimListenerAdapter = new AnimListenerAdapter();
  mPropertyValuesHolderList = new ArrayList<>();
  ObjectAnimator animation = new ObjectAnimator();
  animation.setTarget(mTarget);
  animation.addListener(mAnimListenerAdapter);
  return animation;
}

代码示例来源:origin: shellljx/FuckingVolumeSlider

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);
}

代码示例来源:origin: hujiaweibujidao/yava

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();
  }
}

代码示例来源:origin: TakuSemba/CropMe

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);
}

代码示例来源:origin: CoderGuoy/Coder

/**
   * @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();
  }
}

代码示例来源:origin: Solartisan/TurboRecyclerViewHelper

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();
}

代码示例来源:origin: hujiaweibujidao/yava

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();
}

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: hujiaweibujidao/yava

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();
}

代码示例来源:origin: fookwood/Launcher3

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;
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

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;
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

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;
}

代码示例来源:origin: fookwood/Launcher3

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;
}

代码示例来源:origin: stackoverflow.com

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;
}

代码示例来源:origin: fookwood/Launcher3

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;
}

代码示例来源:origin: WeAreFairphone/FP2-Launcher

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;
}

代码示例来源:origin: com.github.japgolly.android.test/robolectric

@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;
}

代码示例来源:origin: james602152002/FloatingLabelSpinner

@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());
}

相关文章