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


Java ViewPropertyAnimatorCompat.setListener方法代码示例

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


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

示例1: show

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
/**
 * @param animate whether to animate the change
 * @return this, to allow builder pattern
 */
public T show(boolean animate) {
    mIsHidden = false;
    if (isWeakReferenceValid()) {
        TextView textView = mTextViewRef.get();
        if (animate) {
            textView.setScaleX(0);
            textView.setScaleY(0);
            textView.setVisibility(View.VISIBLE);
            ViewPropertyAnimatorCompat animatorCompat = ViewCompat.animate(textView);
            animatorCompat.cancel();
            animatorCompat.setDuration(mAnimationDuration);
            animatorCompat.scaleX(1).scaleY(1);
            animatorCompat.setListener(null);
            animatorCompat.start();
        } else {
            textView.setScaleX(1);
            textView.setScaleY(1);
            textView.setVisibility(View.VISIBLE);
        }
    }
    return getSubInstance();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:BadgeItem.java

示例2: 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;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:ViewPropertyAnimatorCompatSet.java

示例3: 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();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:ScrollingTabContainerView.java

示例4: setupAnimatorToVisibility

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public ViewPropertyAnimatorCompat setupAnimatorToVisibility(int visibility, long duration) {
    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(duration);
        anim.setListener(this.mVisAnimListener.withFinalVisibility(anim, visibility));
        return anim;
    }
    anim = ViewCompat.animate(this).alpha(0.0f);
    anim.setDuration(duration);
    anim.setListener(this.mVisAnimListener.withFinalVisibility(anim, visibility));
    return anim;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:AbsActionBarView.java

示例5: 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;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:23,代码来源:ViewPropertyAnimatorCompatSet.java

示例6: setupAnimatorToVisibility

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public ViewPropertyAnimatorCompat setupAnimatorToVisibility(int paramInt, long paramLong)
{
  if (this.mVisibilityAnim != null) {
    this.mVisibilityAnim.cancel();
  }
  if (paramInt == 0)
  {
    if (getVisibility() != 0) {
      ViewCompat.setAlpha(this, 0.0F);
    }
    ViewPropertyAnimatorCompat localViewPropertyAnimatorCompat2 = ViewCompat.animate(this).alpha(1.0F);
    localViewPropertyAnimatorCompat2.setDuration(paramLong);
    localViewPropertyAnimatorCompat2.setListener(this.mVisAnimListener.withFinalVisibility(localViewPropertyAnimatorCompat2, paramInt));
    return localViewPropertyAnimatorCompat2;
  }
  ViewPropertyAnimatorCompat localViewPropertyAnimatorCompat1 = ViewCompat.animate(this).alpha(0.0F);
  localViewPropertyAnimatorCompat1.setDuration(paramLong);
  localViewPropertyAnimatorCompat1.setListener(this.mVisAnimListener.withFinalVisibility(localViewPropertyAnimatorCompat1, paramInt));
  return localViewPropertyAnimatorCompat1;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:21,代码来源:AbsActionBarView.java

示例7: setupAnimatorToVisibility

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
public ViewPropertyAnimatorCompat setupAnimatorToVisibility(int i, long l)
{
    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(l);
        viewpropertyanimatorcompat.setListener(mVisAnimListener.withFinalVisibility(viewpropertyanimatorcompat, i));
        return viewpropertyanimatorcompat;
    } else
    {
        ViewPropertyAnimatorCompat viewpropertyanimatorcompat1 = ViewCompat.animate(this).alpha(0.0F);
        viewpropertyanimatorcompat1.setDuration(l);
        viewpropertyanimatorcompat1.setListener(mVisAnimListener.withFinalVisibility(viewpropertyanimatorcompat1, i));
        return viewpropertyanimatorcompat1;
    }
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:25,代码来源:AbsActionBarView.java

示例8: show

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
/**
 * @param animate whether to animate the change
 * @return this, to allow builder pattern
 */
public BadgeItem show(boolean animate) {
    mIsHidden = false;
    if (isWeakReferenceValid()) {
        TextView textView = mTextViewRef.get();
        if (animate) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                textView.setScaleX(0);
                textView.setScaleY(0);
            }
            textView.setVisibility(View.VISIBLE);
            ViewPropertyAnimatorCompat animatorCompat = ViewCompat.animate(textView);
            animatorCompat.cancel();
            animatorCompat.setDuration(mAnimationDuration);
            animatorCompat.scaleX(1).scaleY(1);
            animatorCompat.setListener(null);
            animatorCompat.start();
        } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                textView.setScaleX(1);
                textView.setScaleY(1);
            }
            textView.setVisibility(View.VISIBLE);
        }
    }
    return this;
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:31,代码来源:BadgeItem.java

示例9: createClearSubscription

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
private Subscription createClearSubscription(final ViewPropertyAnimatorCompat animator) {
    return new ClearSubscription(() -> {
        animator.setListener(new ViewPropertyAnimatorListenerAdapter() {

            @Override
            public void onAnimationCancel(final View view) {
                onAnimationCancelAction.call(view);
            }
        });
        animator.cancel();
        animator.setListener(null);
    });
}
 
开发者ID:0ximDigital,项目名称:RxAnimations,代码行数:14,代码来源:AnimateOnSubscribe.java

示例10: 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;
    }
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:29,代码来源:ScrollingTabContainerView.java

示例11: startActiveItemAnimation

import android.support.v4.view.ViewPropertyAnimatorCompat; //导入方法依赖的package包/类
protected void startActiveItemAnimation(T info, RecyclerView.ViewHolder holder, ViewPropertyAnimatorCompat animator) {
    animator.setListener(new BaseAnimatorListener(this, info, holder, animator));
    addActiveAnimationTarget(holder);
    animator.start();
}
 
开发者ID:fabricethilaw,项目名称:expandable-recyclerview-with-gridlayout,代码行数:6,代码来源:BaseItemAnimationManager.java


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