本文整理汇总了Java中android.view.animation.AlphaAnimation.setFillAfter方法的典型用法代码示例。如果您正苦于以下问题:Java AlphaAnimation.setFillAfter方法的具体用法?Java AlphaAnimation.setFillAfter怎么用?Java AlphaAnimation.setFillAfter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.AlphaAnimation
的用法示例。
在下文中一共展示了AlphaAnimation.setFillAfter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: startAlphaAnimation
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
public static void startAlphaAnimation(View v, long duration, int visibility) {
AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
? new AlphaAnimation(0f, 1f)
: new AlphaAnimation(1f, 0f);
alphaAnimation.setDuration(duration);
alphaAnimation.setFillAfter(true);
v.startAnimation(alphaAnimation);
}
示例3: startAlpha
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
* alpha
*/
private void startAlpha() {
AlphaAnimation aa = new AlphaAnimation(1, 0);
aa.setFillAfter(false); // 设置动画结束后是否停留在当前位置
aa.setDuration(1000);
content.startAnimation(aa);
}
示例4: setAlpha
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
private static void setAlpha(View view, float alpha) {
// Set the alpha appropriately (setAlpha is API >= 11, this technique works on all API levels).
AlphaAnimation alphaAnimation = new AlphaAnimation(alpha, alpha);
alphaAnimation.setDuration(0);
alphaAnimation.setFillAfter(true);
view.startAnimation(alphaAnimation);
}
示例5: 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);
// make it instant
alphaAnimation.setDuration(0);
alphaAnimation.setFillAfter(true);
view.startAnimation(alphaAnimation);
}
}
示例6: startAlphaAnimation
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
public static void startAlphaAnimation (View v, long duration, int visibility) {
AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
? new AlphaAnimation(0f, 1f)
: new AlphaAnimation(1f, 0f);
alphaAnimation.setDuration(duration);
alphaAnimation.setFillAfter(true);
v.startAnimation(alphaAnimation);
}
示例7: getAlphaAnimation
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
* 透明度 Alpha
*/
public static Animation getAlphaAnimation(float fromAlpha, float toAlpha,
long durationMillis) {
AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha);
alpha.setDuration(durationMillis);
alpha.setFillAfter(true);
return alpha;
}
示例8: animate
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
private static void animate(View view, int duration, AnimationListener listener, float fromAlpha, float targetAlpha) {
// Create new animation
AlphaAnimation newAnimation = new AlphaAnimation(fromAlpha, targetAlpha);
newAnimation.setDuration(duration);
// Force fillAfter flag to be true
newAnimation.setFillAfter(true);
newAnimation.setAnimationListener(listener);
// Start fading
view.startAnimation(newAnimation);
}
示例9: startAlphaAnimation
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
private void startAlphaAnimation(View v, long duration, int visibility) {
AlphaAnimation alphaAnimation = (visibility == View.VISIBLE)
? new AlphaAnimation(0f, 1f)
: new AlphaAnimation(1f, 0f);
alphaAnimation.setDuration(duration);
alphaAnimation.setFillAfter(true);
v.startAnimation(alphaAnimation);
}
示例10: 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(@IdRes 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;
}
示例11: 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;
}
示例12: setAlpha
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
* 设置透明度
*/
@SuppressLint("NewApi")
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;
}
示例13: 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;
}
示例14: setAlpha
import android.view.animation.AlphaAnimation; //导入方法依赖的package包/类
/**
* 设置透明度
*/
@SuppressLint("NewApi")
public BaseRvViewHolder 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: 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;
}