Code example for AlphaAnimation

Methods: setAnimationListener, setDuration, setRepeatMode

0
 
        this.addView(this.ivButton);
        this.addView(this.ivEffect);
 
        // Khoi tao alpha animation. 
        this.alphaAnim = new AlphaAnimation(0.00f, 1.00f);
        this.alphaAnim.setDuration(500);
        this.alphaAnim.setRepeatMode(Animation.REVERSE);
        //this.alphaAnim.setRepeatCount(Animation.INFINITE); 
        this.alphaAnim.setAnimationListener(new Animation.AnimationListener() {
            @Override 
            public void onAnimationStart(Animation animation) {
                // To change body of implemented methods use File | Settings | File Templates. 
 
            } 
 
            @Override 
            public void onAnimationEnd(Animation animation) {
                // Dua button ve trang thai ban dau (khong co effect). 
                // Kich hoat effect cho button tai day. 
                if (!flagTouchDown) {