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