zoukankan      html  css  js  c++  java
  • 仿IPhone 长按图标删除应用,图标抖动效果

    仿IPhone 长按图标删除应用,图标抖动效果

    使用ValueAnimator类实现,长点击图标,图标抖动的效果,可以自己规定抖动的程度大小。

    由于Animator类是在android3.0之后才加上去的,所以,为了兼容3.0以下的机子,就导入了nineoldandroid.jar包,实现兼容。

    工程源代码:

    点击下载

    抖动另一种实现方式:

    private Animation rotateAnimation() {
            Animation rotate = new RotateAnimation(-2.0f,
                                              2.0f,
                                              Animation.RELATIVE_TO_SELF,
                                              0.5f,
                                              Animation.RELATIVE_TO_SELF,
                                              0.5f);
    
             rotate.setRepeatMode(Animation.REVERSE);
            rotate.setRepeatCount(Animation.INFINITE);
            rotate.setDuration(60);
            rotate.setInterpolator(new AccelerateDecelerateInterpolator());
    
            return rotate;
        }

    开始抖动:

    view.startAnimation(rotateAnimation);

    停止抖动:

    view.clearAnimation();
  • 相关阅读:
    P1052 过河
    P1004 方格取数
    自定义事件
    自定义单选,多选按钮
    构造函数+原型的js混合模式
    图标
    格式化
    时间 ---- 时间简史
    居中
    插入DOM元素
  • 原文地址:https://www.cnblogs.com/owner/p/3903125.html
Copyright © 2011-2022 走看看