本文整理汇总了Java中android.animation.Animator.clone方法的典型用法代码示例。如果您正苦于以下问题:Java Animator.clone方法的具体用法?Java Animator.clone怎么用?Java Animator.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.Animator
的用法示例。
在下文中一共展示了Animator.clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnimatorSetForSort
import android.animation.Animator; //导入方法依赖的package包/类
private AnimatorSet getAnimatorSetForSort(Animator[] animators, SortFunction sortFunction) {
List<SpruceTimedView> childrenWithTime;
List<View> children = new ArrayList<>();
for (int i = 0; i < viewGroup.getChildCount(); i++) {
children.add(viewGroup.getChildAt(i));
}
sortFunction.sortChildren(viewGroup, children);
childrenWithTime = sortFunction.getViewListWithTimeOffsets(viewGroup, children);
animatorSet = new AnimatorSet();
List<Animator> animatorsList = new ArrayList<>();
for (SpruceTimedView childView : childrenWithTime) {
for (Animator animatorChild : animators) {
Animator animatorCopy = animatorChild.clone();
animatorCopy.setTarget(childView.getView());
animatorCopy.start();
animatorCopy.cancel();
animatorCopy.setStartDelay(childView.getTimeOffset());
animatorsList.add(animatorCopy);
}
}
animatorSet.playTogether(animatorsList);
return animatorSet;
}
示例2: start
import android.animation.Animator; //导入方法依赖的package包/类
private void start(Animator object, final OnPointDragListener removeListener) {
view.setVisibility(View.VISIBLE);
Animator copy = object.clone();
copy.setTarget(view);
copy.removeAllListeners();
copy.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
animation.removeListener(this);
end(removeListener);
}
});
copy.start();
}
示例3: AnimatedVectorDrawableCompatState
import android.animation.Animator; //导入方法依赖的package包/类
public AnimatedVectorDrawableCompatState(Context context, AnimatedVectorDrawableCompatState copy, Callback owner, Resources res) {
if (copy != null) {
this.mChangingConfigurations = copy.mChangingConfigurations;
if (copy.mVectorDrawable != null) {
ConstantState cs = copy.mVectorDrawable.getConstantState();
if (res != null) {
this.mVectorDrawable = (VectorDrawableCompat) cs.newDrawable(res);
} else {
this.mVectorDrawable = (VectorDrawableCompat) cs.newDrawable();
}
this.mVectorDrawable = (VectorDrawableCompat) this.mVectorDrawable.mutate();
this.mVectorDrawable.setCallback(owner);
this.mVectorDrawable.setBounds(copy.mVectorDrawable.getBounds());
this.mVectorDrawable.setAllowCaching(false);
}
if (copy.mAnimators != null) {
int numAnimators = copy.mAnimators.size();
this.mAnimators = new ArrayList(numAnimators);
this.mTargetNameMap = new ArrayMap(numAnimators);
for (int i = 0; i < numAnimators; i++) {
Animator anim = (Animator) copy.mAnimators.get(i);
Animator animClone = anim.clone();
String targetName = (String) copy.mTargetNameMap.get(anim);
animClone.setTarget(this.mVectorDrawable.getTargetByName(targetName));
this.mAnimators.add(animClone);
this.mTargetNameMap.put(animClone, targetName);
}
}
}
}