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


Java ViewPropertyAnimatorListenerAdapter类代码示例

本文整理汇总了Java中android.support.v4.view.ViewPropertyAnimatorListenerAdapter的典型用法代码示例。如果您正苦于以下问题:Java ViewPropertyAnimatorListenerAdapter类的具体用法?Java ViewPropertyAnimatorListenerAdapter怎么用?Java ViewPropertyAnimatorListenerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setImageDrawable

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
/**
 * change the image with a fade
 *
 * @param drawable
 * @param fadeDuration
 */
public static void setImageDrawable(final ImageView imageView, final Drawable drawable, final int fadeDuration) {
    final float alpha = ViewCompat.getAlpha(imageView);
    final ImageView viewToAnimate = imageView;

    fadeOut(viewToAnimate, fadeDuration, new ViewPropertyAnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(View view) {
            super.onAnimationEnd(view);
            //change the image when alpha=0

            imageView.setImageDrawable(drawable);

            //then fade to alpha=1
            fadeIn(viewToAnimate, alpha, fadeDuration, new ViewPropertyAnimatorListenerAdapter());
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:MaterialViewPagerImageHelper.java

示例2: onDispose

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
@Override
protected void onDispose() {
    animator.setListener(new ViewPropertyAnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(final View view) {
            try {
                animationCancelAction.accept(view);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    animator.cancel();
    animator.setListener(null);
}
 
开发者ID:0ximDigital,项目名称:Rx2Animations,代码行数:17,代码来源:AnimationDisposable.java

示例3: hideLabel

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
/**
 * Hide the label
 */
private void hideLabel(boolean animate) {
    if (animate) {
        float scale = mEditText.getTextSize() / mLabel.getTextSize();
        ViewCompat.setScaleX(mLabel, 1f);
        ViewCompat.setScaleY(mLabel, 1f);
        ViewCompat.setTranslationY(mLabel, 0f);

        ViewCompat.animate(mLabel)
                .translationY(mLabel.getHeight())
                .setDuration(ANIMATION_DURATION)
                .scaleX(scale)
                .scaleY(scale)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mLabel.setVisibility(INVISIBLE);
                        mEditText.setHint(mHint);
                    }
                })
                .setInterpolator(mInterpolator).start();
    } else {
        mLabel.setVisibility(INVISIBLE);
        mEditText.setHint(mHint);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:29,代码来源:FloatLabelLayout.java

示例4: animateIn

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
private void animateIn(final CardView view) {
    if (animInProgress)
        return;
    animInProgress = true;
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view).translationX(shownPosX)
            .setInterpolator(interpolator).withLayer()
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view1) {
                    super.onAnimationEnd(view1);
                    animInProgress = false;
                    if (currentPos > 400)
                        animateIn(view);
                    else animateOut(view);
                }
            })
            .start();
}
 
开发者ID:architjn,项目名称:SharePanel,代码行数:20,代码来源:SlideHideBehaviour.java

示例5: animateOut

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
private void animateOut(final CardView view) {
    if (animInProgress)
        return;
    animInProgress = true;
    view.setVisibility(View.VISIBLE);
    ViewCompat.animate(view).translationX(hiddenPosX)
            .setInterpolator(interpolator).withLayer()
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view1) {
                    super.onAnimationEnd(view1);
                    animInProgress = false;
                    if (currentPos > 400)
                        animateIn(view);
                    else animateOut(view);
                }
            })
            .start();
}
 
开发者ID:architjn,项目名称:SharePanel,代码行数:20,代码来源:SlideHideBehaviour.java

示例6: dismiss

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
public void dismiss() {
    ViewCompat.animate(container)
            .alpha(0f)
            .setDuration(container.getResources().getInteger(android.R.integer.config_mediumAnimTime))
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view) {
                    super.onAnimationEnd(view);
                    ViewParent parent = view.getParent();
                    if (parent instanceof ViewGroup) {
                        ((ViewGroup) parent).removeView(view);
                    }
                    if (listener != null) {
                        listener.onDismissed();
                    }
                }
            }).start();

}
 
开发者ID:florent37,项目名称:TutoShowcase,代码行数:20,代码来源:TutoShowcase.java

示例7: revealFragmentContainerLollipop

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void revealFragmentContainerLollipop(final View clickedView,
                                             final FrameLayout fragmentContainer) {
    prepareCircularReveal(clickedView, fragmentContainer);

    ViewCompat.animate(clickedView)
            .scaleX(0)
            .scaleY(0)
            .alpha(0)
            .setInterpolator(mInterpolator)
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view) {
                    fragmentContainer.setVisibility(View.VISIBLE);
                    clickedView.setVisibility(View.GONE);
                }
            })
            .start();

    fragmentContainer.setVisibility(View.VISIBLE);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.play(mCircularReveal).with(mColorChange);
    animatorSet.start();
}
 
开发者ID:vanpersie9987,项目名称:android-topeka,代码行数:25,代码来源:QuizActivity.java

示例8: showProgress

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
private void showProgress() {
    mIntroduction.setVisibility(View.GONE);
    if (mResults.getVisibility() == View.VISIBLE) {
        mHidingResult = true;
        ViewCompat.animate(mResults)
                .alpha(0.f)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mHidingResult = false;
                        view.setVisibility(View.INVISIBLE);
                    }
                });
    }
    if (mProgress.getVisibility() == View.INVISIBLE) {
        mProgress.setVisibility(View.VISIBLE);
        ViewCompat.setAlpha(mProgress, 0.f);
        ViewCompat.animate(mProgress)
                .alpha(1.f)
                .setListener(null)
                .start();
    }
}
 
开发者ID:GoogleCloudPlatform,项目名称:android-docs-samples,代码行数:24,代码来源:MainActivity.java

示例9: showResults

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
private void showResults() {
    mIntroduction.setVisibility(View.GONE);
    if (mProgress.getVisibility() == View.VISIBLE) {
        ViewCompat.animate(mProgress)
                .alpha(0.f)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        view.setVisibility(View.INVISIBLE);
                    }
                });
    }
    if (mHidingResult) {
        ViewCompat.animate(mResults).cancel();
    }
    if (mResults.getVisibility() == View.INVISIBLE) {
        mResults.setVisibility(View.VISIBLE);
        ViewCompat.setAlpha(mResults, 0.01f);
        ViewCompat.animate(mResults)
                .alpha(1.f)
                .setListener(null)
                .start();
    }
}
 
开发者ID:GoogleCloudPlatform,项目名称:android-docs-samples,代码行数:25,代码来源:MainActivity.java

示例10: animateActionButton

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
public void animateActionButton() {
    if (View.VISIBLE == mActionButton.getVisibility()) {
        ViewCompat.animate(mActionButton).scaleX(0.0F).scaleY(0.0F).alpha(0.0F)
                .setInterpolator(INTERPOLATOR).withLayer()
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    public void onAnimationEnd(View view) {
                        mActionButton.setVisibility(View.GONE);
                        animateActionButton();
                    }
                })
                .start();
    } else {
        setActionButtonColor();
        mActionButton.setVisibility(View.VISIBLE);
        ViewCompat.animate(mActionButton).scaleX(1.0F).scaleY(1.0F).alpha(1.0F)
                .setInterpolator(INTERPOLATOR).withLayer().setListener(null)
                .start();
    }
}
 
开发者ID:StephaneBg,项目名称:ScoreIt,代码行数:20,代码来源:ScoreItActivity.java

示例11: hideLabel

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
private void hideLabel(boolean animate) {
    if (animate) {
        float scale = mEditText.getTextSize() / mLabel.getTextSize();
        ViewCompat.setScaleX(mLabel, 1f);
        ViewCompat.setScaleY(mLabel, 1f);
        ViewCompat.setTranslationY(mLabel, 0f);
        ViewCompat.animate(mLabel)
                .translationY(mLabel.getHeight())
                .setDuration(ANIMATION_DURATION)
                .scaleX(scale)
                .scaleY(scale)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mLabel.setVisibility(INVISIBLE);
                        mEditText.setHint(mHint);
                    }
                })
                .setInterpolator(mInterpolator).start();
    } else {
        mLabel.setVisibility(INVISIBLE);
        mEditText.setHint(mHint);
    }
}
 
开发者ID:JonnyXDA,项目名称:WGSB,代码行数:25,代码来源:FloatLabelLayout.java

示例12: _hideSkipTip

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
/**
 * 隐藏跳转提示
 */
private void _hideSkipTip() {
    if (mLlSkipLayout.getVisibility() == GONE) {
        return;
    }
    ViewCompat.animate(mLlSkipLayout).translationX(-mLlSkipLayout.getWidth()).alpha(0).setDuration(500)
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(View view) {
                    mLlSkipLayout.setVisibility(GONE);
                }
            }).start();
    mSkipPosition = INVALID_VALUE;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:IjkPlayerView.java

示例13: fadeOut

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
public static void fadeOut(View view, int fadeDuration, ViewPropertyAnimatorListenerAdapter listener) {
    //fade to alpha=0
    ViewCompat.animate(view)
        .alpha(0)
        .setDuration(fadeDuration)
        .withLayer()
        .setInterpolator(new DecelerateInterpolator())
        .setListener(listener);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:MaterialViewPagerImageHelper.java

示例14: fadeIn

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
public static void fadeIn(View view, float alpha, int fadeDuration, ViewPropertyAnimatorListenerAdapter listener) {
    //fade to alpha=0
    ViewCompat.animate(view)
        .alpha(alpha)
        .setDuration(fadeDuration)
        .withLayer()
        .setInterpolator(new AccelerateInterpolator())
        .setListener(listener);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:MaterialViewPagerImageHelper.java

示例15: hideLabel

import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; //导入依赖的package包/类
/**
 * Hide the label
 */
private void hideLabel(boolean animate) {
    if (animate) {
        float scale = mEditText.getTextSize() / mLabel.getTextSize();
        ViewCompat.setScaleX(mLabel, 1f);
        ViewCompat.setScaleY(mLabel, 1f);
        ViewCompat.setTranslationY(mLabel, 0f);

        ViewCompat.animate(mLabel)
                .translationY(mLabel.getHeight())
                .setDuration(ANIMATION_DURATION)
                .scaleX(scale)
                .scaleY(scale)
                .setListener(new ViewPropertyAnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(View view) {
                        mLabel.setVisibility(INVISIBLE);
                        mEditText.setHint(mHint);
                    }
                })
                .setInterpolator(mInterpolator)
                .start();
    } else {
        mLabel.setVisibility(INVISIBLE);
        mEditText.setHint(mHint);
    }
}
 
开发者ID:betroy,项目名称:xifan,代码行数:30,代码来源:FloatLabelLayout.java


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