本文整理匯總了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();
}
}