本文整理匯總了Java中android.support.v4.view.ViewPropertyAnimatorCompat.translationX方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewPropertyAnimatorCompat.translationX方法的具體用法?Java ViewPropertyAnimatorCompat.translationX怎麽用?Java ViewPropertyAnimatorCompat.translationX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.ViewPropertyAnimatorCompat
的用法示例。
在下文中一共展示了ViewPropertyAnimatorCompat.translationX方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBindRadioGroupedViewHolder
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
@Override
public void onBindRadioGroupedViewHolder(SecondViewHolder holder, int position, List<Object> payloads) {
{
setDefaults(holder, position);
}
{
MyPayload payload = null;
for (Object itrPayload : payloads) {
if (itrPayload != null && itrPayload instanceof MyPayload) {
payload = (MyPayload) itrPayload;
break;
}
}
if (payload != null) {
ViewPropertyAnimatorCompat animator = ViewCompat
.animate(holder.getIcon())
.setInterpolator(new LinearOutSlowInInterpolator())
.setDuration(500);
int diff = payload.calcDiffY();
if (diff == 0) {
ViewCompat.setTranslationX(holder.getIcon(), holder.getIcon().getMeasuredWidth() * -1);
animator = animator
.translationX(0);
} else {
ViewCompat.setTranslationY(holder.getIcon(), diff);
animator = animator
.translationY(0);
}
animator.start();
}
}
}
示例2: 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
示例3: 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