AlphaAnimation - litonghui/TechBlog GitHub Wiki
Android SplashActivity 渐变闪屏
RelativeLayout splash_id;
splash_id = (RelativeLayout) findViewById(R.id.splash_id);
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
aa.setDuration(3000);
splash_id.startAnimation(aa);
aa.setAnimationListener(new AnimationListener()
{
@Override
public void onAnimationEnd(Animation arg0) {
Intent it = new Intent(SplashActivity.this, MainActivity.class);
startActivity(it);
finish();
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) {}
});