本文整理匯總了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);
}
}
}
}