java类android.view.animation.AnticipateOvershootInterpolator的实例源码

ClassDescInterpolatorAnticipateOvershoot.java 文件源码 项目:itsnat_droid 阅读 19 收藏 0 点赞 0 评论 0
@Override
public boolean isAttributeIgnored(AnticipateOvershootInterpolator resource, String namespaceURI, String name)
{
    if (super.isAttributeIgnored(resource,namespaceURI,name))
        return true;
    return NamespaceUtil.XMLNS_ANDROID.equals(namespaceURI) && (name.equals("tension") || name.equals("extraTension"));
}
TestSetupAssetLayoutAnimations2.java 文件源码 项目:itsnat_droid 阅读 19 收藏 0 点赞 0 评论 0
private static void initInterpolatorAnticipateOvershootTest(TestActivity act, View rootView,InflatedLayout layout)
{
    TextView textView = getTextView(rootView,R.id.antOverInterpolatorTestId1);
    Animation animation = getAnimation(act,layout);

    AnticipateOvershootInterpolator interpolator = (AnticipateOvershootInterpolator)getInterpolator(
            R.anim.test_interpolator_anticipateovershoot_compiled,
            "@assets:anim/res/anim/test_interpolator_anticipateovershoot_asset.xml",act,layout);

    animation.setInterpolator(interpolator);
    textView.startAnimation(animation);

    Assert.assertEquals((Float)TestUtil.getField(interpolator,AnticipateOvershootInterpolator.class,"mTension"),3.0f * 2.0f);
}
SlideItemAnimator.java 文件源码 项目:FlexibleAdapter 阅读 22 收藏 0 点赞 0 评论 0
protected ViewPropertyAnimatorCompat animateRemoveImpl(ViewHolder holder) {
    final View view = holder.itemView;
    ViewCompat.animate(view).cancel();
    return ViewCompat.animate(view)
                     .translationX(Utils.getScreenDimensions(holder.itemView.getContext()).x)
                     .setInterpolator(new AnticipateOvershootInterpolator());
}
UndoBarController.java 文件源码 项目:Stacks-Flashcards 阅读 19 收藏 0 点赞 0 评论 0
private static Animation outToBottomAnimation(
        final android.view.animation.Animation.AnimationListener animationlistener) {
    final TranslateAnimation translateanimation = new TranslateAnimation(2,
            0F, 2, 0F, 2, 0F, 2, 1F);
    translateanimation.setDuration(500L);
    translateanimation.setInterpolator(new AnticipateOvershootInterpolator(
            1.0f));
    translateanimation.setAnimationListener(animationlistener);
    return translateanimation;
}
UndoBarController.java 文件源码 项目:SimpleAppLock 阅读 18 收藏 0 点赞 0 评论 0
private static Animation outToBottomAnimation(
        final android.view.animation.Animation.AnimationListener animationlistener) {
    final TranslateAnimation translateanimation = new TranslateAnimation(2,
            0F, 2, 0F, 2, 0F, 2, 1F);
    translateanimation.setDuration(500L);
    translateanimation.setInterpolator(new AnticipateOvershootInterpolator(
            1.0f));
    translateanimation.setAnimationListener(animationlistener);
    return translateanimation;
}
AnimationController.java 文件源码 项目:itheima 阅读 17 收藏 0 点赞 0 评论 0
private static void setEffect(Animation animation, int interpolatorType, long durationMillis, long delayMillis) {
    switch (interpolatorType) {
        case 0:
            animation.setInterpolator(new LinearInterpolator());
            break;
        case 1:
            animation.setInterpolator(new AccelerateInterpolator());
            break;
        case 2:
            animation.setInterpolator(new DecelerateInterpolator());
            break;
        case 3:
            animation.setInterpolator(new AccelerateDecelerateInterpolator());
            break;
        case 4:
            animation.setInterpolator(new BounceInterpolator());
            break;
        case 5:
            animation.setInterpolator(new OvershootInterpolator());
            break;
        case 6:
            animation.setInterpolator(new AnticipateInterpolator());
            break;
        case 7:
            animation.setInterpolator(new AnticipateOvershootInterpolator());
            break;
        default:
            break;
    }
    animation.setDuration(durationMillis);
    animation.setStartOffset(delayMillis);
}
MainActivity.java 文件源码 项目:itheima 阅读 14 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    imageView = (ImageView) findViewById(R.id.imageView1);

    btn01 = (Button) findViewById(R.id.button1);
    btn01.setOnClickListener(new MyOnClickListener(InterpolatorType.Accelerate));

    btn02 = (Button) findViewById(R.id.button2);
    btn02.setOnClickListener(new MyOnClickListener(InterpolatorType.Decelerate));

    btn03 = (Button) findViewById(R.id.button3);
    btn03.setOnClickListener(new MyOnClickListener(InterpolatorType.AccelerateDecelerate));

    btn04 = (Button) findViewById(R.id.button4);
    btn04.setOnClickListener(new MyOnClickListener(InterpolatorType.LinearInterpolator));

    btn05 = (Button) findViewById(R.id.button5);
    btn05.setOnClickListener(new MyOnClickListener(InterpolatorType.BounceInterpolator));

    btn06 = (Button) findViewById(R.id.button6);
    btn06.setOnClickListener(new MyOnClickListener(InterpolatorType.AnticipateInterpolator));

    btn07 = (Button) findViewById(R.id.button7);
    btn07.setOnClickListener(new MyOnClickListener(InterpolatorType.AnticipateOvershootInterpolator));

    btn08 = (Button) findViewById(R.id.button8);
    btn08.setOnClickListener(new MyOnClickListener(InterpolatorType.CycleInterpolator));

    btn09 = (Button) findViewById(R.id.button9);
    btn09.setOnClickListener(new MyOnClickListener(InterpolatorType.OvershootInterpolator));
}
SlideItemAnimator.java 文件源码 项目:RecyclerViewLib 阅读 22 收藏 0 点赞 0 评论 0
protected ViewPropertyAnimatorCompat animateRemoveImpl(ViewHolder holder) {
    final View view = holder.itemView;
    ViewCompat.animate(view).cancel();
    return ViewCompat.animate(view)
            .translationX(DisplayUtils.getScreenDimensions(holder.itemView.getContext()).x)
            .setInterpolator(new AnticipateOvershootInterpolator());
}
ColorRow.java 文件源码 项目:tzPalette 阅读 21 收藏 0 点赞 0 评论 0
public View getView(int position, View convertView, ViewGroup parent)
{
    View cellView;
    ColorCell colorView;

    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    cellView = inflater.inflate(R.layout.color_item, parent, false);

    if (animFadeInViewWhenAddNew && mNewlyAddedPosition == position)
    {
        cellView.setAlpha(0);
        cellView.setScaleX(.2f);
        cellView.setScaleY(.2f);
        cellView.animate().setInterpolator(new AnticipateOvershootInterpolator()).alpha(1).scaleX(1).scaleY(1).start();

        mNewlyAddedPosition = -1;
    }

    int cellSize = parent.getHeight();

    cellView.setMinimumHeight(cellSize);
    cellView.setMinimumWidth(cellSize);

    if (mCurSel == position)
    {
        cellView.setScaleX(1.2f);
        cellView.setScaleY(1.2f);
    }

    colorView = (ColorCell)cellView.findViewById(R.id.item_color);
    colorView.setMinimumHeight(cellSize - cellView.getPaddingTop() - cellView.getPaddingBottom());
    colorView.setMinimumWidth(cellSize - cellView.getPaddingLeft() - cellView.getPaddingRight());
    colorView.setColor(mColors.get(position));

    return cellView;
}
StandardAnimations.java 文件源码 项目:UTubeTV 阅读 19 收藏 0 点赞 0 评论 0
public static void rubberClick(final View theView) {
  ObjectAnimator rotateAnim = ObjectAnimator.ofFloat(theView, "rotationY", 60f);
  ObjectAnimator rotateBack = ObjectAnimator.ofFloat(theView, "rotationY", 0f);
  ObjectAnimator scaleXDown = ObjectAnimator.ofFloat(theView, "scaleX", .4f);
  ObjectAnimator scaleYDown = ObjectAnimator.ofFloat(theView, "scaleY", .4f);
  ObjectAnimator scaleXBack = ObjectAnimator.ofFloat(theView, "scaleX", 1f);
  ObjectAnimator scaleYBack = ObjectAnimator.ofFloat(theView, "scaleY", 1f);

  AnimatorSet bouncer = new AnimatorSet();
  bouncer.setInterpolator(new AnticipateOvershootInterpolator());
  bouncer.play(scaleXDown).with(scaleYDown);
  bouncer.play(scaleXBack).with(scaleYBack);
  bouncer.play(scaleXBack).after(scaleXDown);
  bouncer.play(rotateAnim).after(scaleXBack);
  bouncer.play(rotateBack).after(rotateAnim);

  ObjectAnimator fadeOut = ObjectAnimator.ofFloat(theView, "alpha", 0f);
  ObjectAnimator fadeBack = ObjectAnimator.ofFloat(theView, "alpha", 1f);
  fadeOut.setDuration(250);
  fadeBack.setDuration(250);
  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.play(bouncer).before(fadeOut);
  animatorSet.play(fadeBack).after(fadeOut);
  animatorSet.start();

  //    theView.animate().scaleX(.8f).scaleY(.8f).setDuration(200).setInterpolator(new AnticipateOvershootInterpolator()).withEndAction(new Runnable() {
  //      @Override
  //      public void run() {
  //        theView.animate().setDuration(100).scaleX(1.0f).scaleY(1.0f).setInterpolator(new AnticipateOvershootInterpolator()).start();
  //      }
  //    });
}


问题


面经


文章

微信
公众号

扫码关注公众号