本文整理汇总了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