码迷,mamicode.com
首页 > 移动开发 > 详细

我的android学习经历39

时间:2016-08-02 20:49:05      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:

关于像第一次进qq一样的那个渐变企鹅图的制作 渐变动画

package com.moonweather.app.activity;

import com.moonweather.app.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;

public class ShouyeActivity extends Activity {
	private ImageView ima;;
	
	protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.shouye);
        ima=(ImageView) findViewById(R.id.ima);
        AlphaAnimation alphaAnimation = new AlphaAnimation(0.3f, 1.0f);
        alphaAnimation.setDuration(3*1000);
        alphaAnimation.setRepeatCount(0);
        ima.startAnimation(alphaAnimation);
        alphaAnimation.setAnimationListener(new Animation.AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {
           
            }
            @Override
            public void onAnimationRepeat(Animation animation) {
            	
            }
            @Override
            public void onAnimationEnd(Animation animation) {
//这里可以写动画结束后的事件,比如说跳转
            	Intent intent=new Intent(ShouyeActivity.this,ChooseAreaActivity.class); 
            	startActivity(intent);
            	ShouyeActivity.this.finish();
            }
        });
    }
}

  

我的android学习经历39

标签:

原文地址:http://www.cnblogs.com/xujinghuan/p/5730494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!