当前位置: 首页>>代码示例>>Java>>正文


Java ChangeAnimationInfo类代码示例

本文整理汇总了Java中com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo的典型用法代码示例。如果您正苦于以下问题:Java ChangeAnimationInfo类的具体用法?Java ChangeAnimationInfo怎么用?Java ChangeAnimationInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ChangeAnimationInfo类属于com.h6ah4i.android.widget.advrecyclerview.animator.impl包,在下文中一共展示了ChangeAnimationInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateChangeAnimationForOldItem

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的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

示例2: onCreateChangeAnimationForNewItem

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的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

示例3: onAnimationEndedSuccessfully

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的package包/类
@Override
protected void onAnimationEndedSuccessfully(ChangeAnimationInfo info, RecyclerView.ViewHolder item) {
    final View view = item.itemView;
    ViewCompat.setAlpha(view, 1);
    ViewCompat.setTranslationX(view, 0);
    ViewCompat.setTranslationY(view, 0);
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:8,代码来源:SwipeDismissItemAnimator.java

示例4: onAnimationEndedBeforeStarted

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的package包/类
@Override
protected void onAnimationEndedBeforeStarted(ChangeAnimationInfo info, RecyclerView.ViewHolder item) {
    final View view = item.itemView;
    ViewCompat.setAlpha(view, 1);
    ViewCompat.setTranslationX(view, 0);
    ViewCompat.setTranslationY(view, 0);
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:8,代码来源:SwipeDismissItemAnimator.java

示例5: addPendingAnimation

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的package包/类
@Override
public boolean addPendingAnimation(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromX, int fromY, int toX, int toY) {
    final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView);
    final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView);
    final float prevAlpha = ViewCompat.getAlpha(oldHolder.itemView);

    endAnimation(oldHolder);

    final int deltaX = (int) (toX - fromX - prevTranslationX);
    final int deltaY = (int) (toY - fromY - prevTranslationY);

    // recover prev translation state after ending animation
    ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX);
    ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY);
    ViewCompat.setAlpha(oldHolder.itemView, prevAlpha);

    if (newHolder != null) {
        // carry over translation values
        endAnimation(newHolder);
        ViewCompat.setTranslationX(newHolder.itemView, -deltaX);
        ViewCompat.setTranslationY(newHolder.itemView, -deltaY);
        ViewCompat.setAlpha(newHolder.itemView, 0);
    }

    enqueuePendingAnimationInfo(new ChangeAnimationInfo(oldHolder, newHolder, fromX, fromY, toX, toY));

    return true;
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:29,代码来源:SwipeDismissItemAnimator.java

示例6: addPendingAnimation

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的package包/类
@Override
public boolean addPendingAnimation(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromX, int fromY, int toX, int toY) {
    final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView);
    final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView);
    final float prevAlpha = ViewCompat.getAlpha(oldHolder.itemView);

    endAnimation(oldHolder);

    final int deltaX = (int) (toX - fromX - prevTranslationX);
    final int deltaY = (int) (toY - fromY - prevTranslationY);

    // recover prev translation state after ending animation
    ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX);
    ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY);
    ViewCompat.setAlpha(oldHolder.itemView, prevAlpha);

    if (newHolder != null && newHolder.itemView != null) {
        // carry over translation values
        endAnimation(newHolder);
        ViewCompat.setTranslationX(newHolder.itemView, -deltaX);
        ViewCompat.setTranslationY(newHolder.itemView, -deltaY);
        ViewCompat.setAlpha(newHolder.itemView, 0);
    }

    enqueuePendingAnimationInfo(new ChangeAnimationInfo(oldHolder, newHolder, fromX, fromY, toX, toY));

    return true;
}
 
开发者ID:WriterOfAlicrow,项目名称:OpenCVTour,代码行数:29,代码来源:SwipeDismissItemAnimator.java

示例7: onAnimationCancel

import com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo; //导入依赖的package包/类
@Override
protected void onAnimationCancel(ChangeAnimationInfo info, RecyclerView.ViewHolder item) {
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:4,代码来源:SwipeDismissItemAnimator.java


注:本文中的com.h6ah4i.android.widget.advrecyclerview.animator.impl.ChangeAnimationInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。