本文整理了Java中android.animation.AnimatorSet.playTogether()
方法的一些代码示例,展示了AnimatorSet.playTogether()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnimatorSet.playTogether()
方法的具体详情如下:
包路径:android.animation.AnimatorSet
类名称:AnimatorSet
方法名:playTogether
暂无
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "rotationY", 90, -10, 10, 0),//
ObjectAnimator.ofFloat(view, "alpha", 0.25f, 0.5f, 0.75f, 1));
}
}
代码示例来源:origin: andkulikov/Transitions-Everywhere
@Nullable
public static Animator mergeAnimators(@Nullable Animator animator1, @Nullable Animator animator2) {
if (animator1 == null) {
return animator2;
} else if (animator2 == null) {
return animator1;
} else {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animator1, animator2);
return animatorSet;
}
}
代码示例来源:origin: andkulikov/Transitions-Everywhere
@Nullable
public static Animator mergeAnimators(@Nullable Animator animator1, @Nullable Animator animator2) {
if (animator1 == null) {
return animator2;
} else if (animator2 == null) {
return animator1;
} else {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animator1, animator2);
return animatorSet;
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "scaleX", 0.3f, 0.5f, 0.9f, 0.8f, 0.9f, 1),//
ObjectAnimator.ofFloat(view, "scaleY", 0.3f, 0.5f, 0.9f, 0.8f, 0.9f, 1),//
ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1f), //
ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.5f, 1f),//
ObjectAnimator.ofFloat(view, "alpha", 0f, 1f),//
ObjectAnimator.ofFloat(view, "rotation", 1080, 720, 360, 0));
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "translationX", -250 * dm.density, 0), //
ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "translationX", 0, -250 * dm.density), //
ObjectAnimator.ofFloat(view, "alpha", 1, 0));
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "rotationX", 90, 0),//
ObjectAnimator.ofFloat(view, "translationY", -200 * dm.density, 0), //
ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
}
}
代码示例来源:origin: H07000223/FlycoDialog_Master
@Override
public void setAnimation(View view) {
DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
animatorSet.playTogether(//
ObjectAnimator.ofFloat(view, "rotationX", -90, 0),//
ObjectAnimator.ofFloat(view, "translationY", 200 * dm.density, 0), //
ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
}
}
代码示例来源:origin: bluelinelabs/Conductor
@Override @NonNull
protected Animator getAnimator(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, boolean isPush, boolean toAddedToContainer) {
AnimatorSet animator = new AnimatorSet();
List<Animator> viewAnimators = new ArrayList<>();
if (isPush && to != null) {
viewAnimators.add(ObjectAnimator.ofFloat(to, View.TRANSLATION_Y, to.getHeight(), 0));
} else if (!isPush && from != null) {
viewAnimators.add(ObjectAnimator.ofFloat(from, View.TRANSLATION_Y, from.getHeight()));
}
animator.playTogether(viewAnimators);
return animator;
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotation", 1080, 720, 360, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2),
ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.5f, 1).setDuration(mDuration)
);
}
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationY", -90, 0).setDuration(mDuration)
);
}
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationX", -90, 0).setDuration(mDuration)
);
}
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationY", 90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "translationX", -300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
);
}
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "rotationX", 90, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "translationY", 300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
);
}
}
代码示例来源:origin: sd6352051/NiftyDialogEffects
@Override
protected void setupAnimation(View view) {
getAnimatorSet().playTogether(
ObjectAnimator.ofFloat(view, "translationX", -300, 0).setDuration(mDuration),
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
);
}
}
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
View target = holder.itemView;
View icon = target.findViewById(R.id.icon);
Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
swing.setInterpolator(new OvershootInterpolator(5));
View right = holder.itemView.findViewById(R.id.right);
Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
rotateIn.setInterpolator(new DecelerateInterpolator());
AnimatorSet animator = new AnimatorSet();
animator.setDuration(getAddDuration());
animator.playTogether(swing, rotateIn);
animator.start();
}
代码示例来源:origin: gzu-liyujiang/AndroidPicker
@Override
protected void showAfter() {
View rootView = getRootView();
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator alpha = ObjectAnimator.ofFloat(rootView, "alpha", 0, 1);
ObjectAnimator translation = ObjectAnimator.ofFloat(rootView, "translationY", 300, 0);
animatorSet.playTogether(alpha, translation);
animatorSet.setDuration(1000);
animatorSet.setInterpolator(new AccelerateInterpolator());
animatorSet.start();
}
代码示例来源:origin: jeasonlzy/ImagePicker
private void enterAnimator() {
ObjectAnimator alpha = ObjectAnimator.ofFloat(masker, "alpha", 0, 1);
ObjectAnimator translationY = ObjectAnimator.ofFloat(listView, "translationY", listView.getHeight(), 0);
AnimatorSet set = new AnimatorSet();
set.setDuration(400);
set.playTogether(alpha, translationY);
set.setInterpolator(new AccelerateDecelerateInterpolator());
set.start();
}
代码示例来源:origin: nickbutcher/plaid
@Override
public Animator createAnimator(ViewGroup sceneRoot,
TransitionValues startValues,
TransitionValues endValues) {
Animator changeBounds = super.createAnimator(sceneRoot, startValues, endValues);
if (startValues == null || endValues == null
|| !(endValues.view instanceof ParallaxScrimageView)) return changeBounds;
ParallaxScrimageView psv = ((ParallaxScrimageView) endValues.view);
if (psv.getOffset() == 0) return changeBounds;
Animator deparallax = ObjectAnimator.ofInt(psv, ParallaxScrimageView.OFFSET, 0);
AnimatorSet transition = new AnimatorSet();
transition.playTogether(changeBounds, deparallax);
return transition;
}
}
内容来源于网络,如有侵权,请联系作者删除!