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