本文整理汇总了Java中com.nineoldandroids.animation.AnimatorSet.playTogether方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorSet.playTogether方法的具体用法?Java AnimatorSet.playTogether怎么用?Java AnimatorSet.playTogether使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nineoldandroids.animation.AnimatorSet
的用法示例。
在下文中一共展示了AnimatorSet.playTogether方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillOpenClosingAnimations
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Filling arrays of animations to build Set of Closing / Opening animations
*/
private void fillOpenClosingAnimations(boolean isCloseAnimation, List<Animator> textAnimations, List<Animator> imageAnimations, int wrapperPosition) {
AnimatorSet textAnimatorSet = new AnimatorSet();
Animator textAppearance = isCloseAnimation ?
AnimatorUtils.alfaDisappear(mTextWrapper.getChildAt(wrapperPosition))
: AnimatorUtils.alfaAppear(mTextWrapper.getChildAt(wrapperPosition));
Animator textTranslation = isCloseAnimation ?
AnimatorUtils.translationRight(mTextWrapper.getChildAt(wrapperPosition), mContext.getResources().getDimension(R.dimen.text_right_translation))
: AnimatorUtils.translationLeft(mTextWrapper.getChildAt(wrapperPosition), mContext.getResources().getDimension(R.dimen.text_right_translation));
textAnimatorSet.playTogether(textAppearance, textTranslation);
textAnimations.add(textAnimatorSet);
Animator imageRotation = isCloseAnimation ?
wrapperPosition == 0 ? AnimatorUtils.rotationCloseToRight(mMenuWrapper.getChildAt(wrapperPosition)) : AnimatorUtils.rotationCloseVertical(mMenuWrapper.getChildAt(wrapperPosition))
: wrapperPosition == 0 ? AnimatorUtils.rotationOpenFromRight(mMenuWrapper.getChildAt(wrapperPosition)) : AnimatorUtils.rotationOpenVertical(mMenuWrapper.getChildAt(wrapperPosition));
imageAnimations.add(imageRotation);
}
示例2: onExpandAnimator
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
public void onExpandAnimator(AnimatorSet animatorSet) {
int count = this.contentView.getChildCount();
for(int i = 0; i < count; ++i) {
View rootView = this.contentView.getChildAt(i);
ImageView iconIv = (ImageView)ABViewUtil.obtainView(rootView, com.wangjie.rapidfloatingactionbutton.R.id.rfab__content_label_list_icon_iv);
if(null == iconIv) {
return;
}
ObjectAnimator animator = new ObjectAnimator();
animator.setTarget(iconIv);
animator.setFloatValues(new float[]{45.0F, 0.0F});
animator.setPropertyName("rotation");
animator.setInterpolator(this.mOvershootInterpolator);
//animator.setStartDelay((long)(count * i * 20));
animatorSet.playTogether(new Animator[]{animator});
}
}
示例3: undo
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Performs the undo animation and restores the original state for given {@link android.view.View}.
*
* @param view the parent {@code View} which contains both primary and undo {@code View}s.
*/
public void undo(@NonNull final View view) {
int position = AdapterViewUtil.getPositionForView(getListViewWrapper(), view);
mUndoPositions.remove(position);
View primaryView = mCallback.getPrimaryView(view);
View undoView = mCallback.getUndoView(view);
primaryView.setVisibility(View.VISIBLE);
ObjectAnimator undoAlphaAnimator = ObjectAnimator.ofFloat(undoView, ALPHA, 1f, 0f);
ObjectAnimator primaryAlphaAnimator = ObjectAnimator.ofFloat(primaryView, ALPHA, 0f, 1f);
ObjectAnimator primaryXAnimator = ObjectAnimator.ofFloat(primaryView, TRANSLATION_X, primaryView.getWidth(), 0f);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(undoAlphaAnimator, primaryAlphaAnimator, primaryXAnimator);
animatorSet.addListener(new UndoAnimatorListener(undoView));
animatorSet.start();
mCallback.onUndo(view, position);
}
示例4: flingView
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Flings given {@link android.view.View} out of sight.
*
* @param view the parent {@link android.view.View}.
* @param position the position of the item in the {@link android.widget.ListAdapter} corresponding to the {@code View}.
* @param flingToRight {@code true} if the {@code View} should be flinged to the right, {@code false} if it should be flinged to the left.
*/
private void flingView(@NonNull final View view, final int position, final boolean flingToRight) {
if (mViewWidth < 2) {
mViewWidth = mListViewWrapper.getListView().getWidth();
}
View swipeView = getSwipeView(view);
ObjectAnimator xAnimator = ObjectAnimator.ofFloat(swipeView, TRANSLATION_X, flingToRight ? mViewWidth : -mViewWidth);
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(swipeView, ALPHA, 0);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(xAnimator, alphaAnimator);
animatorSet.setDuration(mAnimationTime);
animatorSet.addListener(new FlingAnimatorListener(view, position));
animatorSet.start();
}
示例5: animateView
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Animates given View.
*
* @param view the View that should be animated.
*/
private void animateView(final int position, @NonNull final View view, @NonNull final Animator[] animators) {
if (mAnimationStartMillis == -1) {
mAnimationStartMillis = SystemClock.uptimeMillis();
}
ViewHelper.setAlpha(view, 0);
AnimatorSet set = new AnimatorSet();
set.playTogether(animators);
set.setStartDelay(calculateAnimationDelay(position));
set.setDuration(mAnimationDurationMillis);
set.start();
mAnimators.put(view.hashCode(), set);
}
示例6: startBlurImageAppearAnimator
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startBlurImageAppearAnimator(){
if(!enableBlurBackground || mBlurImage == null) return;
AnimatorSet set = new AnimatorSet();
if(enableBackgroundZoom){
set.playTogether(
ObjectAnimator.ofFloat(mBlurImage, "alpha", 0.8f, 1f),
ObjectAnimator.ofFloat(mBlurImage, "scaleX", 1f, mZoomRatio),
ObjectAnimator.ofFloat(mBlurImage, "scaleY", 1f, mZoomRatio)
);
}
else{
set.playTogether(
ObjectAnimator.ofFloat(mBlurImage, "alpha", 0f, 1f)
);
}
set.addListener(mGlobalListener);
set.addListener(mGlobalAppearingAnimators);
set.setDuration(mBlurDuration);
set.start();
}
示例7: buildScaleUpAnimation
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* A helper method to build scale up animation;
*
* @param target
* @param targetScaleX
* @param targetScaleY
* @return
*/
private AnimatorSet buildScaleUpAnimation(View target, float targetScaleX, float targetScaleY) {
AnimatorSet scaleUp = new AnimatorSet();
scaleUp.playTogether(
ObjectAnimator.ofFloat(target, "scaleX", targetScaleX),
ObjectAnimator.ofFloat(target, "scaleY", targetScaleY)
);
if (mUse3D) {
scaleUp.playTogether(ObjectAnimator.ofFloat(target, "rotationY", 0));
}
scaleUp.setDuration(250);
return scaleUp;
}
示例8: onCollapseAnimator
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
public void onCollapseAnimator(AnimatorSet animatorSet) {
int count = this.contentView.getChildCount();
for(int i = 0; i < count; ++i) {
View rootView = this.contentView.getChildAt(i);
ImageView iconIv = (ImageView)ABViewUtil.obtainView(rootView, com.wangjie.rapidfloatingactionbutton.R.id.rfab__content_label_list_icon_iv);
if(null == iconIv) {
return;
}
ObjectAnimator animator = new ObjectAnimator();
animator.setTarget(iconIv);
animator.setFloatValues(new float[]{0.0F, 45.0F});
animator.setPropertyName("rotation");
animator.setInterpolator(this.mOvershootInterpolator);
//animator.setStartDelay((long)(count * i * 20));
animatorSet.playTogether(new Animator[]{animator});
}
}
示例9: onExpandAnimator
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void onExpandAnimator(AnimatorSet animatorSet) {
int count = contentView.getChildCount();
for (int i = 0; i < count; i++) {
View rootView = contentView.getChildAt(i);
ImageView iconIv = ABViewUtil.obtainView(rootView, R.id.rfab__content_label_list_icon_iv);
if (null == iconIv) {
return;
}
ObjectAnimator animator = new ObjectAnimator();
animator.setTarget(iconIv);
animator.setFloatValues(45f, 0);
animator.setPropertyName("rotation");
animator.setInterpolator(mOvershootInterpolator);
animator.setStartDelay((count * i) * 20);
animatorSet.playTogether(animator);
}
}
开发者ID:wangjiegulu,项目名称:RapidFloatingActionButton,代码行数:19,代码来源:RapidFloatingActionContentLabelList.java
示例10: openMenu
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* show the reside menu;
*/
public void openMenu(int direction){
if (isInDisableDirection(direction))
throw new IllegalArgumentException("You have set this direction disable, " +
"but now you want to open menu in this direction.");
setScaleDirection(direction);
isOpened = true;
AnimatorSet scaleDown_activity = buildScaleDownAnimation(viewActivity, 0.5f, 0.5f);
AnimatorSet scaleDown_shadow = buildScaleDownAnimation(imageViewShadow,
0.5f + shadowAdjustScaleX, 0.5f + shadowAdjustScaleY);
AnimatorSet alpha_menu = buildMenuAnimation(scrollViewMenu, 1.0f);
scaleDown_shadow.addListener(animationListener);
scaleDown_activity.playTogether(scaleDown_shadow);
scaleDown_activity.playTogether(alpha_menu);
scaleDown_activity.start();
}
示例11: getPullDownAnimIn
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
public Animator getPullDownAnimIn(View view) {
ObjectAnimator in = ObjectAnimator.ofFloat(view, "translationY", -view.getMeasuredHeight(), 0);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0.6f, 1);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0.6f, 1);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
in.setDuration(ANIMATION_DURATION);
scaleY.setDuration(ANIMATION_DURATION);
scaleX.setDuration(ANIMATION_DURATION);
set.setDuration(ANIMATION_DURATION);
set.playTogether(scaleY, scaleX, in);
return set;
}
示例12: getPullUpAnimIn
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private Animator getPullUpAnimIn(View view) {
ObjectAnimator in = ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0);
// ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "rotationX", 20, 0);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 0.6f, 1);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 0.6f, 1f);
AnimatorSet set = new AnimatorSet();
set.setInterpolator(new DecelerateInterpolator());
in.setDuration(ANIMATION_DURATION);
scaleY.setDuration(ANIMATION_DURATION);
scaleX.setDuration(ANIMATION_DURATION);
set.setDuration(ANIMATION_DURATION);
set.playTogether(scaleY, scaleX, in);
return set;
}
示例13: createTranslationAnimations
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* 创建移动动画
*
* @param view
* @param startX
* @param endX
* @param startY
* @param endY
* @return
*/
private AnimatorSet createTranslationAnimations(View view, float startX,
float endX, float startY, float endY) {
ObjectAnimator animX = ObjectAnimator.ofFloat(view, "translationX",
startX, endX);
ObjectAnimator animY = ObjectAnimator.ofFloat(view, "translationY",
startY, endY);
AnimatorSet animSetXY = new AnimatorSet();
animSetXY.playTogether(animX, animY);
return animSetXY;
}
示例14: setOpenCloseAnimation
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Creates Open / Close AnimatorSet
*/
private AnimatorSet setOpenCloseAnimation(boolean isCloseAnimation) {
List<Animator> textAnimations = new ArrayList<>();
List<Animator> imageAnimations = new ArrayList<>();
if (isCloseAnimation) {
for (int i = getItemCount() - 1; i >= 0; i--) {
fillOpenClosingAnimations(true, textAnimations, imageAnimations, i);
}
} else {
for (int i = 0; i < getItemCount(); i++) {
fillOpenClosingAnimations(false, textAnimations, imageAnimations, i);
}
}
AnimatorSet textCloseAnimatorSet = new AnimatorSet();
textCloseAnimatorSet.playSequentially(textAnimations);
AnimatorSet imageCloseAnimatorSet = new AnimatorSet();
imageCloseAnimatorSet.playSequentially(imageAnimations);
AnimatorSet animatorFullSet = new AnimatorSet();
animatorFullSet.playTogether(imageCloseAnimatorSet, textCloseAnimatorSet);
animatorFullSet.setDuration(mAnimationDurationMilis);
animatorFullSet.addListener(mCloseOpenAnimatorListener);
animatorFullSet.setStartDelay(0);
animatorFullSet.setInterpolator(new HesitateInterpolator());
return animatorFullSet;
}
示例15: restoreCurrentViewTranslation
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Animates the pending {@link android.view.View} back to its original position.
*/
private void restoreCurrentViewTranslation() {
if (mCurrentView == null) {
return;
}
ObjectAnimator xAnimator = ObjectAnimator.ofFloat(mSwipingView, TRANSLATION_X, 0);
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(mSwipingView, ALPHA, 1);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(xAnimator, alphaAnimator);
animatorSet.setDuration(mAnimationTime);
animatorSet.addListener(new RestoreAnimatorListener(mCurrentView, mCurrentPosition));
animatorSet.start();
}