當前位置: 首頁>>代碼示例>>Java>>正文


Java AlphaAnimation.setInterpolator方法代碼示例

本文整理匯總了Java中android.view.animation.AlphaAnimation.setInterpolator方法的典型用法代碼示例。如果您正苦於以下問題:Java AlphaAnimation.setInterpolator方法的具體用法?Java AlphaAnimation.setInterpolator怎麽用?Java AlphaAnimation.setInterpolator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.animation.AlphaAnimation的用法示例。


在下文中一共展示了AlphaAnimation.setInterpolator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: init

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private void init(Context context, View target) {
    this.context = context;
    this.target = target;
    fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);
    fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);
    this.isShown = false;
    if (this.target != null) {
        applyTo(this.target);
    } else {
        show();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:17,代碼來源:BottomRedPointView.java

示例3: ToolTip

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
public ToolTip(){
    /* default values */
    mTitle = "";
    mDescription = "";
    mBackgroundColor = Color.parseColor("#3498db");
    mTextColor = Color.parseColor("#FFFFFF");

    mEnterAnimation = new AlphaAnimation(0f, 1f);
    mEnterAnimation.setDuration(1000);
    mEnterAnimation.setFillAfter(true);
    mEnterAnimation.setInterpolator(new BounceInterpolator());
    mShadow = true;

    // TODO: exit animation
    mGravity = Gravity.CENTER;
}
 
開發者ID:AmulaySoftGroup,項目名稱:TaBeTa,代碼行數:17,代碼來源:ToolTip.java

示例4: init

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private void init(Context context, View target, int tabIndex) {
    this.context = context;
    this.target = target;
    this.targetTabIndex = tabIndex;
    this.badgePosition = 2;
    this.badgeMarginH = dipToPixels(5);
    this.badgeMarginV = this.badgeMarginH;
    this.badgeColor = R.color.he;
    setTypeface(Typeface.DEFAULT_BOLD);
    int paddingPixels = dipToPixels(5);
    setPadding(paddingPixels, 0, paddingPixels, 0);
    setTextColor(-1);
    fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);
    fadeOut = new AlphaAnimation(1.0f, 0.0f);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);
    this.isShown = false;
    if (this.target != null) {
        applyTo(this.target);
    } else {
        show();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:26,代碼來源:BadgeView.java

示例5: fadeInDisplay

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
public static void fadeInDisplay(final ImageView imageView, Drawable drawable) {
    AlphaAnimation fadeAnimation = new AlphaAnimation(0F, 1F);
    fadeAnimation.setDuration(300);
    fadeAnimation.setInterpolator(new DecelerateInterpolator());
    imageView.setImageDrawable(drawable);
    imageView.startAnimation(fadeAnimation);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:ImageAnimationHelper.java

示例6: animate

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
/**
 * Animates {@link ImageView} with "fade-in" effect
 *
 * @param imageView      {@link ImageView} which display image in
 * @param durationMillis The length of the animation in milliseconds
 */
public static void animate(View imageView, int durationMillis) {
	if (imageView != null) {
		AlphaAnimation fadeImage = new AlphaAnimation(0, 1);
		fadeImage.setDuration(durationMillis);
		fadeImage.setInterpolator(new DecelerateInterpolator());
		imageView.startAnimation(fadeImage);
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:FadeInBitmapDisplayer.java

示例7: startAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private AlphaAnimation startAlpha() {
	AlphaAnimation alpha = new AlphaAnimation(0, 1);
	alpha.setInterpolator(this, android.R.anim.accelerate_interpolator);
	alpha.setStartOffset(0);
	alpha.setDuration(1500);
	return alpha;
}
 
開發者ID:isuhao,項目名稱:QMark,代碼行數:8,代碼來源:WelcomeSnowActy.java

示例8: endAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private AlphaAnimation endAlpha(int startTime) {
	AlphaAnimation alpha = new AlphaAnimation(1, 0);
	alpha.setInterpolator(this, android.R.anim.decelerate_interpolator);
	alpha.setStartOffset(startTime - 300);
	alpha.setDuration(300);
	return alpha;
}
 
開發者ID:isuhao,項目名稱:QMark,代碼行數:8,代碼來源:WelcomeSnowActy.java

示例9: initAnimations

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private void initAnimations() {
  fadeOut = new AlphaAnimation(1, 0);
  fadeOut.setInterpolator(new AccelerateInterpolator());
  fadeOut.setDuration(300);
  slideDownTop = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down_top);
  slideDownTop.setInterpolator(new OvershootInterpolator(2.0f));
}
 
開發者ID:mapbox,項目名稱:mapbox-navigation-android,代碼行數:8,代碼來源:AlertView.java

示例10: animate

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
public static void animate(View imageView, int durationMillis) {
    if (imageView != null) {
        AlphaAnimation fadeImage = new AlphaAnimation(0.0f, 1.0f);
        fadeImage.setDuration((long) durationMillis);
        fadeImage.setInterpolator(new DecelerateInterpolator());
        imageView.startAnimation(fadeImage);
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:FadeInBitmapDisplayer.java

示例11: init

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private void init(Context context, View target, int tabIndex)
{

	this.context = context;
	this.target = target;
	this.targetTabIndex = tabIndex;

	// apply defaults
	badgePosition = DEFAULT_POSITION;
	badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP);
	badgeMarginV = badgeMarginH;
	badgeColor = DEFAULT_BADGE_COLOR;

	setTypeface(Typeface.DEFAULT_BOLD);
	int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP);
	setPadding(paddingPixels, 0, paddingPixels, 0);
	setTextColor(DEFAULT_TEXT_COLOR);

	fadeIn = new AlphaAnimation(0, 1);
	fadeIn.setInterpolator(new DecelerateInterpolator());
	fadeIn.setDuration(200);

	fadeOut = new AlphaAnimation(1, 0);
	fadeOut.setInterpolator(new AccelerateInterpolator());
	fadeOut.setDuration(200);

	isShown = false;

	if (this.target != null)
	{
		applyTo(this.target);
	}
	else
	{
		show();
	}

}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:39,代碼來源:BadgeView.java

示例12: animateViews

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
void animateViews(boolean animateTime) {
   if (!isLoaded) {
      final AlphaAnimation fade = new AlphaAnimation(0, 1);
      fade.setDuration(fadeDuration);
      fade.setInterpolator(new DecelerateInterpolator());

      if (titleVisible) {
         titleView.startAnimation(fade);
      }
      if (timeVisible && animateTime) {
         timeView.startAnimation(fade);
      }
      thumbnailView.startAnimation(fade);
   }
}
 
開發者ID:Codewaves,項目名稱:YouTube-Thumbnail-View,代碼行數:16,代碼來源:ThumbnailView.java

示例13: makeOpenCloseAnimation

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
    AnimationSet set = new AnimationSet(false);
    ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, 1, 0.5f, 1, 0.5f);
    scale.setInterpolator(DECELERATE_QUINT);
    scale.setDuration(220);
    set.addAnimation(scale);
    AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
    alpha.setInterpolator(DECELERATE_CUBIC);
    alpha.setDuration(220);
    set.addAnimation(alpha);
    return set;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:13,代碼來源:FragmentManagerImpl.java

示例14: getAnimationSetFromLeft

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
/**
 * 從左側進入,並帶有彈性的動畫
 *
 * @return
 */
public static AnimationSet getAnimationSetFromLeft() {
    AnimationSet animationSet = new AnimationSet(true);
    TranslateAnimation translateX1 = new TranslateAnimation(RELATIVE_TO_SELF, -1.0f, RELATIVE_TO_SELF, 0.1f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX1.setDuration(300);
    translateX1.setInterpolator(new DecelerateInterpolator());
    translateX1.setStartOffset(0);

    TranslateAnimation translateX2 = new TranslateAnimation(RELATIVE_TO_SELF, 0.1f, RELATIVE_TO_SELF, -0.1f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX2.setStartOffset(300);
    translateX2.setInterpolator(new DecelerateInterpolator());
    translateX2.setDuration(50);

    TranslateAnimation translateX3 = new TranslateAnimation(RELATIVE_TO_SELF, -0.1f, RELATIVE_TO_SELF, 0f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX3.setStartOffset(350);
    translateX3.setInterpolator(new DecelerateInterpolator());
    translateX3.setDuration(50);

    AlphaAnimation alphaAnimation = new AlphaAnimation(0.5f, 1.0f);
    alphaAnimation.setDuration(400);
    alphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());


    animationSet.addAnimation(translateX1);
    animationSet.addAnimation(translateX2);
    animationSet.addAnimation(translateX3);
    //animationSet.addAnimation(alphaAnimation);
    animationSet.setDuration(400);

    return animationSet;
}
 
開發者ID:nuptboyzhb,項目名稱:RecyclerViewAnimation,代碼行數:39,代碼來源:MyLayoutAnimationHelper.java

示例15: getAnimationSetFromRight

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
/**
 * 從右側進入,並帶有彈性的動畫
 *
 * @return
 */
public static AnimationSet getAnimationSetFromRight() {
    AnimationSet animationSet = new AnimationSet(true);
    TranslateAnimation translateX1 = new TranslateAnimation(RELATIVE_TO_SELF, 1.0f, RELATIVE_TO_SELF, -0.1f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX1.setDuration(300);
    translateX1.setInterpolator(new DecelerateInterpolator());
    translateX1.setStartOffset(0);

    TranslateAnimation translateX2 = new TranslateAnimation(RELATIVE_TO_SELF, -0.1f, RELATIVE_TO_SELF, 0.1f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX2.setStartOffset(300);
    translateX2.setInterpolator(new DecelerateInterpolator());
    translateX2.setDuration(50);

    TranslateAnimation translateX3 = new TranslateAnimation(RELATIVE_TO_SELF, 0.1f, RELATIVE_TO_SELF, 0f,
            RELATIVE_TO_SELF, 0, RELATIVE_TO_SELF, 0);
    translateX3.setStartOffset(350);
    translateX3.setInterpolator(new DecelerateInterpolator());
    translateX3.setDuration(50);

    AlphaAnimation alphaAnimation = new AlphaAnimation(0.5f, 1.0f);
    alphaAnimation.setDuration(400);
    alphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());


    animationSet.addAnimation(translateX1);
    animationSet.addAnimation(translateX2);
    animationSet.addAnimation(translateX3);
    animationSet.addAnimation(alphaAnimation);
    animationSet.setDuration(400);

    return animationSet;
}
 
開發者ID:nuptboyzhb,項目名稱:RecyclerViewAnimation,代碼行數:39,代碼來源:MyLayoutAnimationHelper.java


注:本文中的android.view.animation.AlphaAnimation.setInterpolator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。