當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。