當前位置: 首頁>>代碼示例>>Java>>正文


Java Animator.clone方法代碼示例

本文整理匯總了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;
}
 
開發者ID:willowtreeapps,項目名稱:spruce-android,代碼行數:28,代碼來源:Spruce.java

示例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();
}
 
開發者ID:javonleee,項目名稱:DragPointView,代碼行數:16,代碼來源:PointViewAnimObject.java

示例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);
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:31,代碼來源:AnimatedVectorDrawableCompat.java


注:本文中的android.animation.Animator.clone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。