校园助手APP--启动logo及导航页

本文介绍了校园助手APP中启动时的Logo页面和首次使用时的导航页面设计。Logo页面通过动画渐显技术实现,背景结合静态图片与动态Logo。导航页面参照微信风格,使用自定义容器模拟ViewPaper效果,而非直接使用ViewPaper组件。用户完成导航页最后一步操作后将进入登录界面,并记录应用已使用,后续启动将跳过导航页面。
摘要由CSDN通过智能技术生成

不知道为什么昨天发布的一篇博文没有显示出来,草稿箱都没有存档,只好重新写一篇。

介绍启动的logo页面和第一次使用时显示的导航页面。


logo页面的实现是采用新浪微博客户端开发教程里面的方法,一个背景图片,然后动画渐现一个logo图片。

public class LogoActivity extends Activity {
	
	Intent intent = null;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		//设置窗口为无标题栏,全屏
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		//标记为全屏
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.logo);

		//设置动画
		AlphaAnimation animation = new AlphaAnimation(0.2f, 1.0f);
		animation.setDuration(2000);//2S渐现

		ImageView img_logo = (ImageView) this.findViewById(R.id.img_logo);
		img_logo.setAnimation(animation);//将logo设置为动画显示

		
		UserInfo loginUser = SharedPreferencesUtil.getLoginUser(LogoActivity.this);
		boolean isUsed = SharedPreferencesUtil.getIsUsed(LogoActivity.this);
		
		//判断是否使用过
		if(isUsed){
			//判断是否有自动登录用户
			if(null == loginUser){//无自动登录用户则进入登录界面
				intent = new Intent(LogoActivity.this,LoginActivity.class);
			}else {//有自动登录用户则进入主界面
				intent = new Intent(LogoActivity.this,HomeActivity.class);
			}
		}else {
			intent = new Intent(LogoActivity.this,GuideActivity.class);
		}
//		intent = new Intent(LogoActivity.this, LoginActivity.class);
		
		
		//动画监听
		animation.setAnimationListener(new AnimationListener() {

			//动画结束时跳转
			public void onAnimationEnd(Animation animation) {

				startActivity(intent);
				LogoActivity.this.finish();
				overridePendingTransition(SwitchActivityAnim.rightIn(),SwitchActivityAnim.rightOut());
			}

			@Override
			public void onAnimationRepeat(Animation arg0) {
			}
			@Override
			public void onAnimationStart(Animation arg0) {
				startMainService();
			}
		});
		
	}
	
	// 启动主服务
	private void startMainService(){
		Intent service = new Intent(this, MainService.class);
		startService(service);
	}
	
}

界面文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_logo"
    android:gravity="center" 
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/img_logo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/logo" />

</LinearLayout>

现在先忽略所有的动画,后面会写一篇动画专题。

第一次启动时,logo动画完毕就会进入到导航页面。

导航页面是仿微信的导航页面,代码也是在网上找到的。

public class GuideActivity e
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值