package org.zsx.android.api.animator;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.tools.Lib_Class_ShowCodeUtil;

import org.zsx.android.api.R;
import org.zsx.android.api._BaseActivity;

public class AlphaAnimation_Activity extends _BaseActivity implements
        OnClickListener {
    private ImageView imageIV1;
    private ImageView imageIV2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bitmap_alpha_animation);
        findViewById(R.id.global_btn1).setOnClickListener(this);
        findViewById(R.id.global_btn2).setOnClickListener(this);
        imageIV1 = (ImageView) findViewById(R.id.global_imageview1);
        imageIV2 = (ImageView) findViewById(R.id.global_imageview2);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.global_btn1:
                switch (v.getId()) {
                    case R.id.global_btn1:
                        imageIV1.startAnimation(AnimationUtils.loadAnimation(this,
                                R.anim.anim_alpha));
                        break;
                    case R.id.global_btn2:
                        //透明度从1~0
                        AlphaAnimation animation = new AlphaAnimation(1, 0);
                        //动画时长1000毫秒
                        animation.setDuration(1000);
                        //动画结束时停留在动画结束的时刻
                        animation.setFillAfter(true);
                        //动画延迟400毫秒开始
                        animation.setStartOffset(400);
                        //重复3次动画
                        animation.setRepeatCount(3);
                        imageIV2.startAnimation(animation);
                        break;
                }
                break;
        }
    }

    @Override
    protected void _showCodeInit(Lib_Class_ShowCodeUtil showCode) {
        showCode.setShowXML(R.layout.bitmap_alpha_animation, R.anim.anim_alpha);
    }
}

@@ -1091,96 +1091,8 @@
 n1:%0A
-                switch (v.getId()) %7B%0A                    case R.id.global_btn1:%0A        
     
@@ -1186,24 +1186,16 @@
         
-      
-  
 R.anim.a
@@ -1219,32 +1219,24 @@
             
-        
 break;%0A     
@@ -1238,32 +1238,24 @@
             
-      
-  
 case R.id.gl
@@ -1281,24 +1281,16 @@
         
-        
 //%E9%80%8F%E6%98%8E%E5%BA%A6%E4%BB%8E1~
@@ -1307,24 +1307,16 @@
         
-     
-   
 AlphaAni
@@ -1372,32 +1372,24 @@
             
-        
 //%E5%8A%A8%E7%94%BB%E6%97%B6%E9%95%BF1000%E6%AF%AB%E7%A7%92
@@ -1401,32 +1401,24 @@
             
-     
-   
 animation.se
@@ -1446,32 +1446,24 @@
             
-        
 //%E5%8A%A8%E7%94%BB%E7%BB%93%E6%9D%9F%E6%97%B6%E5%81%9C%E7%95%99%E5%9C%A8%E5%8A%A8%E7%94%BB
@@ -1480,32 +1480,24 @@
             
-    
-    
 animation.se
@@ -1526,32 +1526,24 @@
             
-        
 //%E5%8A%A8%E7%94%BB%E5%BB%B6%E8%BF%9F400%E6%AF%AB%E7%A7%92%E5%BC%80
@@ -1556,32 +1556,24 @@
             
-    
-    
 animation.se
@@ -1607,24 +1607,16 @@
         
-        
 //%E9%87%8D%E5%A4%8D3%E6%AC%A1%E5%8A%A8%E7%94%BB
@@ -1628,32 +1628,24 @@
             
-   
-     
 animation.se
@@ -1661,24 +1661,16 @@
 unt(3);%0A
-        
         
@@ -1717,57 +1717,8 @@
 n);%0A
-                        break;%0A                %7D%0A
     

fix bugs