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


Java AlphaAnimation.setDuration方法代碼示例

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


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

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

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

示例3: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public ViewHolder setAlpha(int viewId, float value)
{
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
    {
        getView(viewId).setAlpha(value);
    } else
    {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:lanyan520,項目名稱:Idea-ChainSelector,代碼行數:17,代碼來源:ViewHolder.java

示例4: applyAlphaAnimation

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static void applyAlphaAnimation(View view, float alpha) {
    if (isPostHoneycomb()) {
        view.setAlpha(alpha);
    } else {
        AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha);
        alphaAnimation.setDuration(0);
        alphaAnimation.setFillAfter(true);
        view.startAnimation(alphaAnimation);
    }
}
 
開發者ID:yhyzgn,項目名稱:Widgets,代碼行數:12,代碼來源:ExpandTextView.java

示例5: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
/**
 * Add an action to set the alpha of a view. Can be called multiple times.
 * Alpha between 0-1.
 */
public BaseViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:bigjelly,項目名稱:ShaddockVideoPlayer,代碼行數:17,代碼來源:BaseViewHolder.java

示例6: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@Override
public HelperViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:14,代碼來源:HelperViewHolder.java

示例7: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public ViewHolderHelper setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:14,代碼來源:ViewHolderHelper.java

示例8: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public BaseRecyclerHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:zuoni1018,項目名稱:CoordinatorLayoutExample-master,代碼行數:14,代碼來源:BaseRecyclerHolder.java

示例9: showView

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
private void showView(View v) {
	if(Build.VERSION.SDK_INT>=11){
		v.setAlpha(1);
	}else{
		AlphaAnimation anim = new AlphaAnimation(0, 1);
		anim.setDuration(0);
		anim.setFillAfter(true);
		v.startAnimation(anim);
	}
}
 
開發者ID:PacktPublishing,項目名稱:Expert-Android-Programming,代碼行數:11,代碼來源:StickyScrollView.java

示例10: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@Override
public EasyLVHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:EasyLVHolder.java

示例11: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
public BaseViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:zwmlibs,項目名稱:BookReader-master,代碼行數:12,代碼來源:BaseViewHolder.java

示例12: AlbumsAdapter

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
public AlbumsAdapter(Activity activity, ArrayList<Track> data){
    this.data = data;
    this.activity = activity;

    listAq = new AQuery(activity);

    fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setDuration(100);
    fadeIn.setInterpolator(new DecelerateInterpolator());
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:11,代碼來源:AlbumsAdapter.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,項目名稱:letv,代碼行數:13,代碼來源:FragmentManagerImpl.java

示例14: setAlpha

import android.view.animation.AlphaAnimation; //導入方法依賴的package包/類
@SuppressLint("NewApi")
public ViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
 
開發者ID:huashengzzz,項目名稱:SmartChart,代碼行數:14,代碼來源:ViewHolder.java

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


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