新浪微博android版,新浪微博Android版 登录之Logo欢迎页

1、登录步骤

Logo ----> Login -----> Main

2、代码

2.1 Logo的实现

xml:

android:gravity="center"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:id="@+id/fscreen"

>

android:id="@+id/logo_bg"

android:src="@drawable/logo_bg"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

/>

Code:

package com.itcast.ui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.widget.ImageView; /**  * 欢迎页  * @author tomatos.to  *  */ public class LogoActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 全屏显示 // 1.去标题 this.requestWindowFeature(Window.FEATURE_NO_TITLE); // 2.全屏设置 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.log); ImageView iv = (ImageView) findViewById(R.id.logo_bg); // 设置淡入淡出的动画效果 AlphaAnimation aa = new AlphaAnimation(0.1f, 1.0f); // 设置动画的持续时间为3s aa.setDuration(3000); // 开始播放动画 iv.startAnimation(aa); // 当动画执行完后,启动LoginActivity aa.setAnimationListener(new AnimationListener() { @Override public void onAnimationEnd(Animation animation) { Intent it = new Intent(LogoActivity.this, LoginActivity.class); startActivity(it); } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } }); } }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值