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

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

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

ObjectAnimator.setTarget介绍

暂无

代码示例

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

ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(mContext, R.animator.flipping); 
anim.setTarget(A View Object reference goes here i.e. ImageView);
anim.setDuration(3000);
anim.start();

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

ObjectAnimator objAnim = (ObjectAnimator)AnimatorInflater.loadAnimator(getActivity(), R.animator.animator_bkg);
 objAnim.setTarget(view);
 objAnim.setEvaluator(new ArgbEvaluator());
 objAnim.start();

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

@SuppressLint("NewApi")
private void init() {
  ObjectAnimator rotationAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(getContext(), R.animator.rotation);
  rotationAnimator.setTarget(this);
  rotationAnimator.start();
}

代码示例来源:origin: com.albedinsky.android/ui-controller-pull

/**
 */
@Override
void onTargetsChanged(PullController controller) {
  super.onTargetsChanged(controller);
  PULL_ANIMATOR.setTarget(controller.mPullHelper);
}

代码示例来源:origin: com.albedinsky.android/ui-controller

/**
 */
@Override
void onTargetsChanged(PullController controller) {
  super.onTargetsChanged(controller);
  PULL_ANIMATOR.setTarget(controller.mPullHelper);
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 */
@Override
void onTargetsChanged(PullController controller) {
  super.onTargetsChanged(controller);
  PULL_ANIMATOR.setTarget(controller.mPullHelper);
}

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

public PropertyAnimator target(View view) {
  checkObj();
  animator.setTarget(view);
  return this;
}

代码示例来源:origin: google-ar/sceneform-android-sdk

private void startAnimation() {
 if (orbitAnimation != null) {
  return;
 }
 orbitAnimation = createAnimator();
 orbitAnimation.setTarget(this);
 orbitAnimation.setDuration(getAnimationDuration());
 orbitAnimation.start();
}

代码示例来源: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: zzz40500/AnimatorCompat

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

代码示例来源: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: 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: 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: 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: livroandroid/5ed

public void onClickAnimarXML(View view) {
  ImageView img = (ImageView) findViewById(R.id.img);
  ObjectAnimator a = (ObjectAnimator) AnimatorInflater.loadAnimator(this, R.anim.fade_out);
  a.setTarget(img);
  animar(a);
}

代码示例来源: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: 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: 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;
}

相关文章