本文整理汇总了Java中android.animation.AnimatorSet.playTogether方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorSet.playTogether方法的具体用法?Java AnimatorSet.playTogether怎么用?Java AnimatorSet.playTogether使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.AnimatorSet
的用法示例。
在下文中一共展示了AnimatorSet.playTogether方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: animator
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void animator(final View itemView, final Filter item, final FloatImgBean floatImg, int startX, int startY, int endX, int endY) {
ObjectAnimator animatorX = ObjectAnimator.ofFloat(floatImg.mImageView, "translationX", startX - mStartX, endX - mStartX);
ObjectAnimator animatorY = ObjectAnimator.ofFloat(floatImg.mImageView, "translationY", startY - mStartY, endY - mStartY);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animatorX, animatorY);
animatorSet.setDuration(calcDuration(startX - endX, startY - endY));
animatorSet.setInterpolator(new OvershootInterpolator(1.1f));
animatorSet.start();
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
floatImg.mImageView.setVisibility(View.GONE);
floatImg.mIsAnimator = false;
mIconListRvAdapter.add(item);
mIconRecyclerView.smoothScrollToPosition(mIconListRvAdapter.getItemCount());
mPlaceHolder.setVisibility(View.GONE);
refreshLayout(false);
itemView.setClickable(true);
}
});
}
示例2: Play
import android.animation.AnimatorSet; //导入方法依赖的package包/类
void Play(int val){
final ImageView iv = top;
top = btm;
btm = creatImg();
btm.setImageBitmap(BM);
addView(btm,0);
Set = new AnimatorSet();
Set.setInterpolator(Ui.cd.TH);
Set.playTogether(ObjectAnimator.ofFloat(iv, "X",val));
Set.setDuration(500).start();
Set.addListener(new animLis(){
@Override
public void onAnimationEnd(Animator animation) {
imgSlider.this.removeView(iv);
}
});
}
示例3: animateMenuItemOpen
import android.animation.AnimatorSet; //导入方法依赖的package包/类
void animateMenuItemOpen(View view,long delay){
ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",0.0f,1.0f);
ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",0.0f,1.0f);
ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",0,ITEM_FINAL_ALPHA);
ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",0,360.0f);
final int X_SCALE_ANIMATION_DURATION = 300;
final int Y_SCALE_ANIMATION_DURATION = 300;
animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);
animRotation.setDuration(200);
AnimatorSet animSet = new AnimatorSet();
if(allowItemRotationAnim)
animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
else
animSet.playTogether(animScaleX,animScaleY,animAlpha);
animSet.setStartDelay(delay);
animSet.setInterpolator(new AccelerateDecelerateInterpolator());
animSet.start();
}
示例4: buildIndicatorAnimatorTowards
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private AnimatorSet buildIndicatorAnimatorTowards(TextView tab) {
ObjectAnimator xAnimator = ObjectAnimator.ofFloat(indicator, "X", indicator.getX(), tab.getX());
final ViewGroup.LayoutParams params = indicator.getLayoutParams();
ValueAnimator widthAnimator = ValueAnimator.ofInt(params.width, tab.getMeasuredWidth());
widthAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
params.width = (int) animation.getAnimatedValue();
indicator.setLayoutParams(params);
}
});
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new FastOutSlowInInterpolator());
set.playTogether(xAnimator, widthAnimator);
return set;
}
示例5: closeDrawer
import android.animation.AnimatorSet; //导入方法依赖的package包/类
public void closeDrawer(boolean fast) {
cancelCurrentAnimation();
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(
ObjectAnimator.ofFloat(this, "drawerPosition", 0)
);
animatorSet.setInterpolator(new DecelerateInterpolator());
if (fast) {
animatorSet.setDuration(Math.max((int) (200.0f / drawerLayout.getMeasuredWidth() * drawerPosition), 50));
} else {
animatorSet.setDuration(300);
}
animatorSet.addListener(new AnimatorListenerAdapterProxy() {
@Override
public void onAnimationEnd(Animator animator) {
onDrawerAnimationEnd(false);
}
});
animatorSet.start();
}
示例6: shakeTextView
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void shakeTextView(final float x, final int num) {
if (num == 6) {
return;
}
AnimatorSet AnimatorSet = new AnimatorSet();
AnimatorSet.playTogether(ObjectAnimator.ofFloat(passcodeTextView, "translationX", AndroidUtilities.dp(x)));
AnimatorSet.setDuration(50);
AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
@Override
public void onAnimationEnd(Animator animation) {
shakeTextView(num == 5 ? 0 : -x, num + 1);
}
});
AnimatorSet.start();
}
示例7: startChildAnimation
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private void startChildAnimation(View child) {
if (animationEnabled) {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(
ObjectAnimator.ofFloat(child, "alpha", 0.0f, 1.0f),
ObjectAnimator.ofFloat(child, "translationY", AndroidUtilities.dp(showedFromBotton ? 6 : -6), 0));
animatorSet.setDuration(180);
animatorSet.setInterpolator(decelerateInterpolator);
animatorSet.start();
}
}
示例8: prepare
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "translationX", -target.getWidth(), 30, -10, 0),
ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1)
);
}
示例9: onTouch
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public boolean onTouch(View view, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
AnimatorSet upSet = new AnimatorSet();
upSet.playTogether(
ObjectAnimator.ofFloat(view, "translationZ", 16),
ObjectAnimator.ofFloat(view, "scaleX", 1.05f),
ObjectAnimator.ofFloat(view, "scaleY", 1.05f)
);
upSet.setDuration(150);
upSet.setInterpolator(new DecelerateInterpolator());
upSet.start();
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
AnimatorSet downSet = new AnimatorSet();
downSet.playTogether(
ObjectAnimator.ofFloat(view, "translationZ", 0),
ObjectAnimator.ofFloat(view, "scaleX", 1f),
ObjectAnimator.ofFloat(view, "scaleY", 1f)
);
downSet.setDuration(150);
downSet.setInterpolator(new DecelerateInterpolator());
downSet.start();
break;
}
return false;
}
示例10: prepare
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
float x = target.getWidth() - target.getPaddingRight();
float y = target.getHeight() - target.getPaddingBottom();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 0),
ObjectAnimator.ofFloat(target, "rotation", 0, 90),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例11: openMenuAnimation
import android.animation.AnimatorSet; //导入方法依赖的package包/类
private AnimatorSet openMenuAnimation(Point center) {
setAnimating(true);
Animator lastAnimation = null;
List<SubButton> subActionItems = menu.getSubMenuButtons();
ArrayList<Animator> animatorArrayList = new ArrayList<>();
for (int i = 0; i < subActionItems.size(); i++) {
SubButton currentSubButton = subActionItems.get(i);
ArrayList<PropertyValuesHolder> properties = new ArrayList<>();
properties.add(PropertyValuesHolder.ofFloat(View.TRANSLATION_X, currentSubButton.getX() - center.x + currentSubButton.getWidth() / 2));
properties.add(PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, currentSubButton.getY() - center.y + currentSubButton.getHeight() / 2));
if (shouldRotate) {
properties.add(PropertyValuesHolder.ofFloat(View.ROTATION, 720));
}
if (shouldScale) {
properties.add(PropertyValuesHolder.ofFloat(View.SCALE_X, 1));
properties.add(PropertyValuesHolder.ofFloat(View.SCALE_Y, 1));
}
if (shouldFade) {
properties.add(PropertyValuesHolder.ofFloat(View.ALPHA, 1));
}
PropertyValuesHolder[] parameters = new PropertyValuesHolder[properties.size() - 1];
parameters = properties.toArray(parameters);
final ObjectAnimator animation = ObjectAnimator.ofPropertyValuesHolder(currentSubButton.getView(), parameters);
animation.setDuration(openingDuration);
animation.setInterpolator(openingInterpolator);
menuButtonAnimationListener = new FloatingMenuButtonAnimationListener(FloatingMenuAnimationHandler.this, currentSubButton, MenuState.OPENING);
animation.addListener(menuButtonAnimationListener);
if (i == 0) {
lastAnimation = animation;
}
animation.setStartDelay((subActionItems.size() - i) * lagBetweenItems);
animatorArrayList.add(animation);
}
if (lastAnimation != null) {
lastAnimation.addListener(this);
}
AnimatorSet openAnimatorSet = new AnimatorSet();
openAnimatorSet.playTogether(animatorArrayList);
return openAnimatorSet;
}
示例12: onLayoutChange
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
mRequestView.removeOnLayoutChangeListener(this);
Animator scrimFader = ObjectAnimator.ofInt(mFullContainer.getBackground(),
AnimatorProperties.DRAWABLE_ALPHA_PROPERTY, 0, 127);
Animator alphaAnimator = ObjectAnimator.ofFloat(mFullContainer, View.ALPHA, 0f, 1f);
AnimatorSet alphaSet = new AnimatorSet();
alphaSet.playTogether(scrimFader, alphaAnimator);
alphaSet.setDuration(DIALOG_ENTER_ANIMATION_MS);
alphaSet.setInterpolator(new LinearOutSlowInInterpolator());
alphaSet.start();
}
示例13: prepare
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1),
ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1),
ObjectAnimator.ofFloat(target, "translationX", target.getWidth() + target.getPaddingRight(), -48, 0),
ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1)
);
}
示例14: prepare
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
ViewGroup parent = (ViewGroup) target.getParent();
int distance = parent.getWidth() - parent.getLeft();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0),
ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f),
ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f),
ObjectAnimator.ofFloat(target, "translationX", 0, -42, distance)
);
}
示例15: prepare
import android.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 0),
ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth() / 4)
);
}