Android即时通讯--仿QQ即时聊天:(二)闪屏页及登录页面的实现
来源:互联网 发布:迪卡侬14.9背包知乎 编辑:程序博客网 时间:2024/05/22 13:21
1、闪屏页
在每一个Android应用程序中一般都会有一个闪屏页,用来完成展示产品LOGO、检查版本更新、打广告等操作。在这个项目中,只是简单的展示一下产品的LOGO。效果图如下
闪屏页的代码
public class SplashActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_splash);/** * 在子线程中做一些操作,之后跳转到登录界面 */ThreadUtils.runInSubThread(new Runnable() {public void run() {try {Thread.sleep(3000);} catch (InterruptedException e) {// TODO Auto-generated catch blocke.printStackTrace();}startActivity(new Intent(getApplicationContext(),LoginActivity.class));}});}}
2、登录页面
布局文件如下
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#D4D0C8" tools:context="com.itcast.im.wh9.MainActivity2" > <TableLayout android:layout_width="300dp" android:layout_height="wrap_content" android:layout_centerInParent="true" > <!-- 图标 --> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> <!-- 账号输入 --> <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="账号" android:textSize="22sp" /> <EditText android:text="101" android:id="@+id/account" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:singleLine="true" /> </TableRow> <!-- 密码输入 --> <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="密码" android:textSize="22sp" /> <EditText android:id="@+id/password" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:inputType="textPassword" android:singleLine="true" android:text="test" /> </TableRow> <!-- 登录 --> <Button android:id="@+id/login" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:gravity="center" android:text="登录" android:textSize="22sp" /> </TableLayout></RelativeLayout>先从布局开始,避免直接上逻辑报错影响心情,哈哈^_^,相信但凡有一点Android功底的童鞋对这些布局根本不屑一顾,下一篇开始实现登录的逻辑,不要错过哦!!!
0 0
- Android即时通讯--仿QQ即时聊天:(二)闪屏页及登录页面的实现
- Android即时通讯--仿QQ即时聊天:(五)聊天模块
- Android即时通讯--仿QQ即时聊天:(三)核心代码抽取与登录逻辑
- Android即时通讯--仿QQ即时聊天:(一)初识Socket
- Android即时通讯--仿QQ即时聊天:(四)好友列表的处理
- winform中socket实现即时通讯(仿qq聊天)
- 仿QQ聊天(4)—简单的聊天页面实现
- TIM简单的即时通信以及仿QQ聊天页面布局
- 【Android即时通讯】Android 高仿微信的即时聊天DEMO
- Android学习之仿QQ聊天界面的实现
- Android仿QQ实现聊天功能
- 仿QQ聊天(2)—主布局及侧滑菜单的实现
- Android学习笔记(一)——仿qq聊天的welcome界面登陆的实现
- 仿QQ聊天(3)—好友列表的实现
- Android 基于xmpp协议,smack包,openfire服务端的高仿QQ的即时通讯实现【2】创建连接,登录openfire服务端
- Android中实现帐号密码登录及进行内存缓存逻辑(仿QQ)
- Android初学者仿QQ聊天软件APP (一) 登录界面
- 即时聊天web即时通讯
- GCD之dispatch_group_t
- 机器学习中precision和accuracy区别
- ImageView.ScaleType设置图解
- CLayer的相关知识
- ubuntu14.04计划任务无法执行
- Android即时通讯--仿QQ即时聊天:(二)闪屏页及登录页面的实现
- android Application类的详细介绍
- 职业规划
- 1019 General Palindromic Number
- ios 9.2xcode7.2下批量打渠道包
- 关于fork()函数父子进程之间的问题
- 算法导论第三版习题6.3
- Java类文件结构(Class文件)
- CM给hive添加自定义jar包