当前位置: 首页>>代码示例>>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;未经允许,请勿转载。