本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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();
}
}