zoukankan      html  css  js  c++  java
  • Android 闪烁动画

    import android.view.View;
    import android.view.animation.AlphaAnimation;
    import android.view.animation.Animation;
    import android.view.animation.LinearInterpolator;
    
    /*闪烁效果*/
    public class AlphaAnimationUtil {
    
        /**
         * 开启View闪烁效果
         * */
        public static void startFlick(View view ){
    
            if( null == view ){
                return;
            }
    
            Animation alphaAnimation = new AlphaAnimation( 1.0f, 0.5f );
            alphaAnimation.setDuration( 300 );
            alphaAnimation.setFillBefore(true);
            alphaAnimation.setInterpolator( new LinearInterpolator( ) );
            alphaAnimation.setRepeatCount( Animation.INFINITE );
            alphaAnimation.setRepeatMode( Animation.REVERSE );
            view.startAnimation( alphaAnimation );
        }
    
        /**
         * 取消View闪烁效果
         * */
        public static void stopFlick( View view ){
            if( null == view ){
                return;
            }
            view.clearAnimation( );
        }
    }
  • 相关阅读:
    day02-数据库操作
    day01-MySQL介绍
    3-socketserver
    1-多线程与多进程
    keyword模块
    math模块
    查看进程pid与ppid
    开启进程的两种方式
    进程理论
    进程
  • 原文地址:https://www.cnblogs.com/tangchun/p/9328131.html
Copyright © 2011-2022 走看看