当前位置: 首页>>代码示例>>Java>>正文


Java AnimatorSet.start方法代码示例

本文整理汇总了Java中com.nineoldandroids.animation.AnimatorSet.start方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorSet.start方法的具体用法?Java AnimatorSet.start怎么用?Java AnimatorSet.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nineoldandroids.animation.AnimatorSet的用法示例。


在下文中一共展示了AnimatorSet.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:sathishmscict,项目名称:ListViewAnimations,代码行数:23,代码来源:SwipeTouchListener.java

示例2: 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();
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:22,代码来源:BlurLayout.java

示例3: animateView

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void animateView(final ViewGroup parent, final View view) {
    if (mAnimationStartMillis == -1) {
        mAnimationStartMillis = System.currentTimeMillis();
    }

    ViewHelper.setAlpha(view, 0);

    Animator[] childAnimators;
    if (mDecoratedBaseAdapter instanceof AnimationAdapter) {
        childAnimators = ((AnimationAdapter) mDecoratedBaseAdapter).getAnimators(parent, view);
    } else {
        childAnimators = new Animator[0];
    }
    Animator[] animators = getAnimators(parent, view);
    Animator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

    AnimatorSet set = new AnimatorSet();
    set.playTogether(concatAnimators(childAnimators, animators, alphaAnimator));
    set.setStartDelay(calculateAnimationDelay());
    set.setDuration(getAnimationDurationMillis());
    set.start();

    mAnimators.put(view.hashCode(), set);
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:25,代码来源:AnimationAdapter.java

示例4: animateLoad

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void animateLoad() {
    ViewHelper.setTranslationY(this, 500);
    ViewHelper.setAlpha(this, 0);

    final Animator translateAnimator = ObjectAnimator.ofFloat(this, "translationY", 0);
    translateAnimator.setDuration(400);

    final Animator alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", 1);
    alphaAnimator.setStartDelay(200);
    alphaAnimator.setDuration(600);

    final AnimatorSet set = new AnimatorSet();
    set.playTogether(alphaAnimator, translateAnimator);
    set.setStartDelay(400);
    TransitionsTracker.track(set);

    set.start();
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:19,代码来源:FirstrunPager.java

示例5: swapImage

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void swapImage() {
    Log.d(TAG, "swapImage active=" + mActiveImageIndex);
    if(mActiveImageIndex == -1) {
        mActiveImageIndex = 1;
        animate(mImageViews[mActiveImageIndex]);
        return;
    }

    int inactiveIndex = mActiveImageIndex;
    mActiveImageIndex = (1 + mActiveImageIndex) % mImageViews.length;
    Log.d(TAG, "new active=" + mActiveImageIndex);

    final ImageView activeImageView = mImageViews[mActiveImageIndex];
    ViewHelper.setAlpha(activeImageView, 0.0f);
    ImageView inactiveImageView = mImageViews[inactiveIndex];

    animate(activeImageView);

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(mFadeInOutMs);
    animatorSet.playTogether(
            ObjectAnimator.ofFloat(inactiveImageView, "alpha", 1.0f, 0.0f),
            ObjectAnimator.ofFloat(activeImageView, "alpha", 0.0f, 1.0f)
    );
    animatorSet.start();
}
 
开发者ID:zpwan110,项目名称:Android-ParallaxHeaderViewPager-master,代码行数:27,代码来源:KenBurnsSupportView.java

示例6: springView

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * 反弹
 */
public void springView() {
    ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(this, "scaleX", 1f, 0.7f);
    ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(this, "scaleY", 0.7f, 1f);
    scaleYAnimator.setDuration(ANIMATION_DURATION / 4);
    scaleXAnimator.setDuration(ANIMATION_DURATION / 4);
    scaleXAnimator.setInterpolator(new AccelerateInterpolator(mFactor));
    scaleYAnimator.setInterpolator(new AccelerateInterpolator(mFactor));
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(ANIMATION_DURATION / 4);
    animatorSet.playTogether(scaleXAnimator, scaleYAnimator);
    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            upThrow();
        }
    });
    animatorSet.start();
}
 
开发者ID:SatanFu,项目名称:OpenUCLoading,代码行数:22,代码来源:LoadingView.java

示例7: 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);
}
 
开发者ID:KouChengjian,项目名称:PhoneMate,代码行数:21,代码来源:ViewAnimator.java

示例8: freeFall

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * 下落
 */
public void freeFall() {
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "translationY", 0, mDistance);
    ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(this, "scaleX", 1f, 0.7f);
    objectAnimator.setDuration(ANIMATION_DURATION);
    scaleYAnimator.setDuration(ANIMATION_DURATION);
    scaleYAnimator.setInterpolator(new AccelerateInterpolator(mFactor));
    objectAnimator.setInterpolator(new AccelerateInterpolator(mFactor));
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(ANIMATION_DURATION);
    animatorSet.playTogether(objectAnimator, scaleYAnimator);
    animatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            pressView();
        }
    });
    animatorSet.start();
}
 
开发者ID:SatanFu,项目名称:OpenUCLoading,代码行数:22,代码来源:LoadingView.java

示例9: nextAnimation

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void nextAnimation() {
    AnimatorSet anim = new AnimatorSet();
    if (scale) {
        anim.playTogether(ObjectAnimator.ofFloat(this, "scaleX", 1.5f, 1f),
                ObjectAnimator.ofFloat(this, "scaleY", 1.5f, 1f));
    } else {
        anim.playTogether(ObjectAnimator.ofFloat(this, "scaleX", 1, 1.5f),
                ObjectAnimator.ofFloat(this, "scaleY", 1, 1.5f));
    }
    anim.setDuration(10987);
    anim.addListener(this);
    anim.start();
    scale = !scale;
}
 
开发者ID:benchegnzhou,项目名称:MeiZi_App,代码行数:15,代码来源:VideoImageView.java

示例10: openMenu

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
 * Show the menu;
 */
public void openMenu(int direction) {

    setScaleDirection(direction);

    isOpened = true;
    AnimatorSet scaleDown_activity = buildScaleDownAnimation(viewActivity, mScaleValue, mScaleValue);
    AnimatorSet scaleDown_shadow = buildScaleDownAnimation(imageViewShadow,
            mScaleValue + shadowAdjustScaleX, mScaleValue + 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();
}
 
开发者ID:alicance,项目名称:MyScse-Client,代码行数:18,代码来源:ResideMenu.java

示例11: 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();
}
 
开发者ID:sathishmscict,项目名称:ListViewAnimations,代码行数:18,代码来源:SwipeTouchListener.java

示例12: getView

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
@NonNull
public View getView(final int position, @Nullable final View convertView, @NonNull final ViewGroup parent) {
    final View view = super.getView(position, convertView, parent);

    if (mInsertQueue.getActiveIndexes().contains(position)) {
        int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(ViewGroup.LayoutParams.MATCH_PARENT, View.MeasureSpec.AT_MOST);
        int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(ViewGroup.LayoutParams.WRAP_CONTENT, View.MeasureSpec.UNSPECIFIED);
        view.measure(widthMeasureSpec, heightMeasureSpec);

        int originalHeight = view.getMeasuredHeight();

        ValueAnimator heightAnimator = ValueAnimator.ofInt(1, originalHeight);
        heightAnimator.addUpdateListener(new HeightUpdater(view));

        Animator[] customAnimators = getAdditionalAnimators(view, parent);
        Animator[] animators = new Animator[customAnimators.length + 1];
        animators[0] = heightAnimator;
        System.arraycopy(customAnimators, 0, animators, 1, customAnimators.length);

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(animators);

        ViewHelper.setAlpha(view, 0);
        ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);

        AnimatorSet allAnimatorsSet = new AnimatorSet();
        allAnimatorsSet.playSequentially(animatorSet, alphaAnimator);

        allAnimatorsSet.setDuration(mInsertionAnimationDurationMs);
        allAnimatorsSet.addListener(new ExpandAnimationListener(position));
        allAnimatorsSet.start();
    }

    return view;
}
 
开发者ID:sathishmscict,项目名称:ListViewAnimations,代码行数:37,代码来源:AnimateAdditionAdapter.java

示例13: addAnimation

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void addAnimation(View view) {
    float[] vaules = new float[]{0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.5f, 0.6f, 0.65f, 0.7f, 0.8f, 0.7f, 0.65f, 0.6f, 0.5f};
    AnimatorSet set = new AnimatorSet();
    set.playTogether(ObjectAnimator.ofFloat(view, "scaleX", vaules), ObjectAnimator.ofFloat(view, "scaleY", vaules));
    set.setDuration(150);
    set.start();
}
 
开发者ID:1anc3r,项目名称:AirFree-Client,代码行数:8,代码来源:MusicAdapter.java

示例14: animation

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void animation(MenuVH menuVH) {

        ViewHelper.setAlpha(menuVH.itemView, 0);

        ViewHelper.setTranslationY(menuVH.itemView, 300);
        ObjectAnimator translationY = ObjectAnimator.ofFloat(menuVH.itemView, "translationY", 500, 0);
        translationY.setDuration(300);
        translationY.setInterpolator(new OvershootInterpolator(1.6f));
        ObjectAnimator alphaIn = ObjectAnimator.ofFloat(menuVH.itemView, "alpha", 0, 1);
        alphaIn.setDuration(100);
        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.playTogether(translationY, alphaIn);
        animatorSet.setStartDelay(30 * menuVH.getAdapterPosition());
        animatorSet.start();
    }
 
开发者ID:xiangyunwan,项目名称:AndroidSweetSheet-master,代码行数:16,代码来源:MenuRVAdapter.java

示例15: open

import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void open() {
    AnimatorSet animation = new AnimatorSet();
    animation.setDuration(Const.DURATION);
    animation.playTogether(
            ObjectAnimator.ofFloat(mView, "rotationX", 180f, 0f),
            ObjectAnimator.ofFloat(mView, "rotationY", 180f, 0f)
    );
    animation.start();
}
 
开发者ID:fanwucoder,项目名称:mvpChat,代码行数:10,代码来源:ArrowActionProvider.java


注:本文中的com.nineoldandroids.animation.AnimatorSet.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。