当前位置: 首页>>代码示例>>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;未经允许,请勿转载。