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


Java ViewPropertyAnimatorCompat.translationY方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewPropertyAnimatorCompat.translationY方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPropertyAnimatorCompat.translationY方法的具体用法?Java ViewPropertyAnimatorCompat.translationY怎么用?Java ViewPropertyAnimatorCompat.translationY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewPropertyAnimatorCompat的用法示例。


在下文中一共展示了ViewPropertyAnimatorCompat.translationY方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: finishRefreshing

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void finishRefreshing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();

        if (mMaterialHeaderView != null) {
            mMaterialHeaderView.onComplete(MaterialRefreshLayout.this);
        } else if (mSunLayout != null) {
            mSunLayout.onComplete(MaterialRefreshLayout.this);
        }

        if (refreshListener != null) {
            refreshListener.onfinish();
        }
    }
    isRefreshing = false;
    progressValue = 0;
}
 
开发者ID:smuyyh,项目名称:SprintNBA,代码行数:23,代码来源:MaterialRefreshLayout.java

示例2: finishRefreshing

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void finishRefreshing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();

        if (materialHeadView != null) {
            materialHeadView.onComlete(MaterialRefreshLayout.this);
        }

        if (refreshListener != null) {
            refreshListener.onfinish();
        }
    }
    isRefreshing = false;
    progressValue = 0;
    setProgressValue(0);
}
 
开发者ID:duguju,项目名称:MousePaintYzz,代码行数:22,代码来源:MaterialRefreshLayout.java

示例3: finishRefreshing

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void finishRefreshing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();

        if (mMaterialHeaderView != null) {
            mMaterialHeaderView.onComlete(MaterialRefreshLayout.this);
        } else if (mSunLayout != null) {
            mSunLayout.onComlete(MaterialRefreshLayout.this);
        }

        if (refreshListener != null) {
            refreshListener.onfinish();
        }
    }
    isRefreshing = false;
    progressValue = 0;
}
 
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:23,代码来源:MaterialRefreshLayout.java

示例4: finishRefreshing

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void finishRefreshing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();

        if (materialHeadView != null) {
            materialHeadView.onComlete(PulltoRefreshLayout.this);
        }

        if (refreshListener != null) {
            refreshListener.onfinish();
        }
    }
    isRefreshing = false;
    progressValue = 0;
    setProgressValue(0);
}
 
开发者ID:skyxin888,项目名称:PulltoRefreshLayout,代码行数:22,代码来源:PulltoRefreshLayout.java

示例5: 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();
        }
    }
}
 
开发者ID:S64,项目名称:android-radiobutton-extended,代码行数:38,代码来源:SecondAdapter.java

示例6: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(v);
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:16,代码来源:PerseiLayout.java

示例7: closeMenuing

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
private void closeMenuing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();
    }
    isOpenMenu = false;
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:12,代码来源:PerseiLayout.java

示例8: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(250);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(v);
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:smuyyh,项目名称:SprintNBA,代码行数:16,代码来源:MaterialRefreshLayout.java

示例9: 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

示例10: 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

示例11: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(mDecelerateInterpolator);
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
}
 
开发者ID:nukc,项目名称:LoadMoreLayout,代码行数:8,代码来源:LoadMoreLayout.java

示例12: createAnimatorTranslationY

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(200);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(View view) {
            float height = Math.abs(ViewCompat.getTranslationY(v));
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
 
开发者ID:skyxin888,项目名称:PulltoRefreshLayout,代码行数:16,代码来源:PulltoRefreshLayout.java

示例13: 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);
        }
    }
}
 
开发者ID:jzhu1224,项目名称:DeckView,代码行数:57,代码来源:DeckChildViewTransform.java


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