本文整理匯總了Java中android.support.v4.view.ViewPropertyAnimatorCompat.alpha方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewPropertyAnimatorCompat.alpha方法的具體用法?Java ViewPropertyAnimatorCompat.alpha怎麽用?Java ViewPropertyAnimatorCompat.alpha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.ViewPropertyAnimatorCompat
的用法示例。
在下文中一共展示了ViewPropertyAnimatorCompat.alpha方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: animateTitle
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
private void animateTitle(float finalScale, float finalAlpha) {
if (type == Type.TABLET) {
return;
}
ViewPropertyAnimatorCompat titleAnimator = ViewCompat.animate(titleView)
.setDuration(ANIMATION_DURATION)
.scaleX(finalScale)
.scaleY(finalScale);
titleAnimator.alpha(finalAlpha);
titleAnimator.start();
}
示例2: animateTitle
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
private void animateTitle(int padding, float scale, float alpha) {
if (type == Type.TABLET && isTitleless) {
return;
}
setTopPaddingAnimated(iconView.getPaddingTop(), padding);
ViewPropertyAnimatorCompat titleAnimator = ViewCompat.animate(titleView)
.setDuration(ANIMATION_DURATION)
.scaleX(scale)
.scaleY(scale);
titleAnimator.alpha(alpha);
titleAnimator.start();
}
示例3: onCreateAnimation
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
@Override
protected void onCreateAnimation(AddAnimationInfo info) {
final ViewPropertyAnimatorCompat animator = ViewCompat.animate(info.holder.itemView);
animator.alpha(1);
animator.setDuration(getDuration());
startActiveItemAnimation(info, info.holder, animator);
}
開發者ID:fabricethilaw,項目名稱:expandable-recyclerview-with-gridlayout,代碼行數:10,代碼來源:SwipeDismissItemAnimator.java
示例4: onCreateChangeAnimationForOldItem
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
@Override
protected void onCreateChangeAnimationForOldItem(ChangeAnimationInfo info) {
final ViewPropertyAnimatorCompat animator = ViewCompat.animate(info.oldHolder.itemView);
animator.setDuration(getDuration());
animator.translationX(info.toX - info.fromX);
animator.translationY(info.toY - info.fromY);
animator.alpha(0);
startActiveItemAnimation(info, info.oldHolder, animator);
}
開發者ID:fabricethilaw,項目名稱:expandable-recyclerview-with-gridlayout,代碼行數:12,代碼來源:SwipeDismissItemAnimator.java
示例5: onCreateChangeAnimationForNewItem
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
@Override
protected void onCreateChangeAnimationForNewItem(ChangeAnimationInfo info) {
final ViewPropertyAnimatorCompat animator = ViewCompat.animate(info.newHolder.itemView);
animator.translationX(0);
animator.translationY(0);
animator.setDuration(getDuration());
animator.alpha(1);
startActiveItemAnimation(info, info.newHolder, animator);
}
開發者ID:fabricethilaw,項目名稱:expandable-recyclerview-with-gridlayout,代碼行數:12,代碼來源:SwipeDismissItemAnimator.java
示例6: applyToTaskView
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
/**
* Applies this transform to a view.
*/
public void applyToTaskView(View v, int duration, Interpolator interp, boolean allowLayers,
boolean allowShadows, ViewPropertyAnimatorUpdateListener updateCallback) {
// Check to see if any properties have changed, and update the task view
if (duration > 0) {
ViewPropertyAnimatorCompat anim = ViewCompat.animate(v);
boolean requiresLayers = false;
// Animate to the final state
if (hasTranslationYChangedFrom(v.getTranslationY())) {
anim.translationY(translationY);
}
if (allowShadows && hasTranslationZChangedFrom(ViewCompat.getTranslationZ(v))) {
anim.translationZ(translationZ);
}
if (hasScaleChangedFrom(v.getScaleX())) {
anim.scaleX(scale)
.scaleY(scale);
requiresLayers = true;
}
if (hasAlphaChangedFrom(v.getAlpha())) {
// Use layers if we animate alpha
anim.alpha(alpha);
requiresLayers = true;
}
if (requiresLayers && allowLayers) {
anim.withLayer();
}
if (updateCallback != null) {
anim.setUpdateListener(updateCallback);
} else {
anim.setUpdateListener(null);
}
anim.setStartDelay(startDelay)
.setDuration(duration)
.setInterpolator(interp)
.start();
} else {
// Set the changed properties
if (hasTranslationYChangedFrom(v.getTranslationY())) {
v.setTranslationY(translationY);
}
if (allowShadows && hasTranslationZChangedFrom(ViewCompat.getTranslationZ(v))) {
ViewCompat.setTranslationZ(v, translationZ);
}
if (hasScaleChangedFrom(v.getScaleX())) {
v.setScaleX(scale);
v.setScaleY(scale);
}
if (hasAlphaChangedFrom(v.getAlpha())) {
v.setAlpha(alpha);
}
}
}