PhoneTabSwitcherLayout.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:ChromeLikeTabSwitcher 作者:
/**
 * Creates and returns an animation listener, which allows to adapt the pivot of a specific
 * tab, when an animation, which reverted an overshoot, has been ended.
 *
 * @param item
 *         The item, which corresponds to the tab, whose pivot should be adapted, as an instance
 *         of the class {@link AbstractItem}. The item may not be null
 * @param listener
 *         The listener, which should be notified about the animation's progress, as an instance
 *         of the type {@link AnimatorListener} or null, if no listener should be notified
 * @return The listener, which has been created, as an instance of the type {@link
 * AnimatorListener}. The listener may not be null
 */
@NonNull
private AnimatorListener createRevertOvershootAnimationListener(
        @NonNull final AbstractItem item, @Nullable final AnimatorListener listener) {
    return new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(final Animator animation) {
            super.onAnimationEnd(animation);
            getArithmetics().setPivot(Axis.DRAGGING_AXIS, item,
                    getArithmetics().getPivot(Axis.DRAGGING_AXIS, item, DragState.NONE));
            getArithmetics().setPivot(Axis.ORTHOGONAL_AXIS, item,
                    getArithmetics().getPivot(Axis.DRAGGING_AXIS, item, DragState.NONE));

            if (listener != null) {
                listener.onAnimationEnd(animation);
            }
        }

    };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号