本文整理匯總了Java中android.support.v4.view.ViewPropertyAnimatorCompat.setInterpolator方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewPropertyAnimatorCompat.setInterpolator方法的具體用法?Java ViewPropertyAnimatorCompat.setInterpolator怎麽用?Java ViewPropertyAnimatorCompat.setInterpolator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.ViewPropertyAnimatorCompat
的用法示例。
在下文中一共展示了ViewPropertyAnimatorCompat.setInterpolator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
public void start() {
if (!this.mIsStarted) {
Iterator i$ = this.mAnimators.iterator();
while (i$.hasNext()) {
ViewPropertyAnimatorCompat animator = (ViewPropertyAnimatorCompat) i$.next();
if (this.mDuration >= 0) {
animator.setDuration(this.mDuration);
}
if (this.mInterpolator != null) {
animator.setInterpolator(this.mInterpolator);
}
if (this.mListener != null) {
animator.setListener(this.mProxyListener);
}
animator.start();
}
this.mIsStarted = true;
}
}
示例2: animateToVisibility
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
public void animateToVisibility(int visibility) {
if (this.mVisibilityAnim != null) {
this.mVisibilityAnim.cancel();
}
if (visibility == 0) {
if (getVisibility() != 0) {
ViewCompat.setAlpha(this, 0.0f);
}
ViewPropertyAnimatorCompat anim = ViewCompat.animate(this).alpha(1.0f);
anim.setDuration(200);
anim.setInterpolator(sAlphaInterpolator);
anim.setListener(this.mVisAnimListener.withFinalVisibility(anim, visibility));
anim.start();
return;
}
anim = ViewCompat.animate(this).alpha(0.0f);
anim.setDuration(200);
anim.setInterpolator(sAlphaInterpolator);
anim.setListener(this.mVisAnimListener.withFinalVisibility(anim, visibility));
anim.start();
}
示例3: createAnimatorToHeadView
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
public void createAnimatorToHeadView(final View v, final float angle)
{
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
viewPropertyAnimatorCompat.setDuration(200);
viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
viewPropertyAnimatorCompat.rotationX(90);
viewPropertyAnimatorCompat.start();
viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
@Override
public void onAnimationUpdate(View view) {
float height = ViewCompat.getTranslationY(mChildView);
mHeadLayout.setPivotX(mHeadLayout.getWidth() / 2);
mHeadLayout.setPivotY(height);
}
});
}
示例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 (mMaterialHeaderView != null) {
mMaterialHeaderView.onComplete(MaterialRefreshLayout.this);
} else if (mSunLayout != null) {
mSunLayout.onComplete(MaterialRefreshLayout.this);
}
if (refreshListener != null) {
refreshListener.onfinish();
}
}
isRefreshing = false;
progressValue = 0;
}
示例5: onCreateAnimation
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
@Override
protected void onCreateAnimation(MoveAnimationInfo info) {
final View view = info.holder.itemView;
final int deltaX = info.toX - info.fromX;
final int deltaY = info.toY - info.fromY;
if (deltaX != 0) {
ViewCompat.animate(view).translationX(0);
}
if (deltaY != 0) {
ViewCompat.animate(view).translationY(0);
}
final ViewPropertyAnimatorCompat animator = ViewCompat.animate(view);
animator.setDuration(getDuration());
animator.setInterpolator(MOVE_INTERPOLATOR);
startActiveItemAnimation(info, info.holder, animator);
}
開發者ID:fabricethilaw,項目名稱:expandable-recyclerview-with-gridlayout,代碼行數:21,代碼來源:SwipeDismissItemAnimator.java
示例6: 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);
}
示例7: 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;
}
示例8: start
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
public final void start()
{
if (this.mIsStarted) {
return;
}
Iterator localIterator = this.mAnimators.iterator();
while (localIterator.hasNext())
{
ViewPropertyAnimatorCompat localViewPropertyAnimatorCompat = (ViewPropertyAnimatorCompat)localIterator.next();
if (this.mDuration >= 0L) {
localViewPropertyAnimatorCompat.setDuration(this.mDuration);
}
if (this.mInterpolator != null) {
localViewPropertyAnimatorCompat.setInterpolator(this.mInterpolator);
}
if (this.mListener != null) {
localViewPropertyAnimatorCompat.setListener(this.mProxyListener);
}
localViewPropertyAnimatorCompat.start();
}
this.mIsStarted = true;
}
示例9: 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);
}
示例10: 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();
}
});
}
示例11: 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;
}
示例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(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();
}
});
}
示例13: 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();
}
示例14: 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();
}
});
}
示例15: animateToVisibility
import android.support.v4.view.ViewPropertyAnimatorCompat; //導入方法依賴的package包/類
public void animateToVisibility(int i)
{
if (mVisibilityAnim != null)
{
mVisibilityAnim.cancel();
}
if (i == 0)
{
if (getVisibility() != 0)
{
ViewCompat.setAlpha(this, 0.0F);
}
ViewPropertyAnimatorCompat viewpropertyanimatorcompat = ViewCompat.animate(this).alpha(1.0F);
viewpropertyanimatorcompat.setDuration(200L);
viewpropertyanimatorcompat.setInterpolator(sAlphaInterpolator);
viewpropertyanimatorcompat.setListener(mVisAnimListener.withFinalVisibility(viewpropertyanimatorcompat, i));
viewpropertyanimatorcompat.start();
return;
} else
{
ViewPropertyAnimatorCompat viewpropertyanimatorcompat1 = ViewCompat.animate(this).alpha(0.0F);
viewpropertyanimatorcompat1.setDuration(200L);
viewpropertyanimatorcompat1.setInterpolator(sAlphaInterpolator);
viewpropertyanimatorcompat1.setListener(mVisAnimListener.withFinalVisibility(viewpropertyanimatorcompat1, i));
viewpropertyanimatorcompat1.start();
return;
}
}