项目介绍
本次项目在上一次类微信界面的设计上,增加了用recyclerview实现的模拟微信聊天联系人列表,其中从列表跳转到联系内容的部分使用了activity的跳转。
设计
列表界面
用一个xml来设计列表的界面,这里采用了最简单的单个textview作为标题模式。
<?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="50dp"
xmlns:tools="http://schemas.android.com/tools"
android:layout_margin="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:gravity="center"
android:text="TextView" />
</LinearLayout>
联系内容界面
显示联系内容的界面新建两个activity来实现,在activity2.xml文件作为被跳转的布局文件用来显示联系内容。
activity_1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns: