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


Java AlphaAnimation.setAnimationListener方法代码示例

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


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

示例1: setImgBackGround

import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
private void setImgBackGround() {
    String[] images = getResources().getStringArray(R.array.splash_background);
    int position = new Random().nextInt(images.length - 1) % (images.length);

    Glide.with(this)
            .load(images[position])
            .into(mImgBackGround);

    String path = SpUtil.getString(this, "path");
    Glide.with(this)
            .load(path)
            .asBitmap()
            .error(R.drawable.def_avatar)
            .into(new SimpleTarget<Bitmap>() {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    mCircleImageView.setImageBitmap(resource);
                }
            });

    //设置图像的透明度
    AlphaAnimation animation = new AlphaAnimation(0.1f, 1.0f);
    animation.setDuration(800);
    mCircleImageView.startAnimation(animation);
    animation.setAnimationListener(this);
}
 
开发者ID:haihaio,项目名称:AmenEye,代码行数:27,代码来源:SplashActivity.java

示例2: fadeIn

import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
 * <p>对 View 做透明度变化的进场动画。</p>
 * <p>相关方法 {@link #fadeOut(View, int, Animation.AnimationListener, boolean)}</p>
 *
 * @param view            做动画的 View
 * @param duration        动画时长(毫秒)
 * @param listener        动画回调
 * @param isNeedAnimation 是否需要动画
 */
public static AlphaAnimation fadeIn(View view, int duration, Animation.AnimationListener listener, boolean isNeedAnimation) {
    if (view == null) {
        return null;
    }
    if (isNeedAnimation) {
        view.setVisibility(View.VISIBLE);
        AlphaAnimation alpha = new AlphaAnimation(0, 1);
        alpha.setInterpolator(new DecelerateInterpolator());
        alpha.setDuration(duration);
        alpha.setFillAfter(true);
        if (listener != null) {
            alpha.setAnimationListener(listener);
        }
        view.startAnimation(alpha);
        return alpha;
    } else {
        view.setAlpha(1);
        view.setVisibility(View.VISIBLE);
        return null;
    }
}
 
开发者ID:coopese,项目名称:qmui,代码行数:31,代码来源:QMUIViewHelper.java

示例3: animate

import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
private static void animate(View view, int duration, AnimationListener listener, float fromAlpha, float targetAlpha) {
	// Create new animation
	AlphaAnimation newAnimation = new AlphaAnimation(fromAlpha, targetAlpha);
	
	newAnimation.setDuration(duration);
	// Force fillAfter flag to be true
	newAnimation.setFillAfter(true);
	newAnimation.setAnimationListener(listener);
	// Start fading
	view.startAnimation(newAnimation);
	
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:13,代码来源:AlphaAnimator.java

示例4: getAlphaAnimation

import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
 * Gets a transparency gradient animation
 *
 * @param fromAlpha         Transparency at the beginning
 * @param toAlpha           Transparency at the end
 * @param durationMillis    duration
 * @param animationListener Animation monitor
 * @return A transparency gradient animation
 */
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis, Animation.AnimationListener animationListener) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setDuration(durationMillis);
    if (animationListener != null)
        alphaAnimation.setAnimationListener(animationListener);
    return alphaAnimation;
}
 
开发者ID:Jusenr,项目名称:androidtools,代码行数:17,代码来源:AnimationUtils.java

示例5: getAlphaAnimation

import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
 * 获取一个透明度渐变动画
 *
 * @param fromAlpha         开始时的透明度
 * @param toAlpha           结束时的透明度都
 * @param durationMillis    持续时间
 * @param animationListener 动画监听器
 * @return 一个透明度渐变动画
 */
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis, AnimationListener animationListener) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setDuration(durationMillis);
    if (animationListener != null) {
        alphaAnimation.setAnimationListener(animationListener);
    }
    return alphaAnimation;
}
 
开发者ID:RockyQu,项目名称:MVVMFrames,代码行数:18,代码来源:AnimationUtils.java


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