<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns: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"tools:context=".weixinFragment"><!-- TODO: Update blank fragment layout --><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="微信界面"android:textSize="30sp"/></LinearLayout>
interface2.xml 设置通讯录界面
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns: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"tools:context=".tongxunluFragment"><!-- TODO: Update blank fragment layout --><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="通讯录界面"android:textSize="30sp"/></LinearLayout>
interface3.xml 设置发现界面
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns: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"tools:context=".faxianFragment"><!-- TODO: Update blank fragment layout --><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="发现界面"android:textSize="30sp"/></LinearLayout>
interface4.xml 设置我界面
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns: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"tools:context=".woFragment"><!-- TODO: Update blank fragment layout --><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="我界面"android:textSize="30sp"/></LinearLayout>
weixinFragment 将结尾选中区域改成interface1
packagecom.example.wechat;importandroid.os.Bundle;importandroidx.fragment.app.Fragment;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;/**
* A simple {@link Fragment} subclass.
* Use the factory method to
* create an instance of this fragment.
*/publicclass weixinFragment extendsFragment{publicweixinFragment(){// Required empty public constructor}@OverridepublicViewonCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){// Inflate the layout for this fragmentreturn inflater.inflate(R.layout.interface1, container,false);}}
tongxunluFragment 将结尾选中区域改成interface2
packagecom.example.wechat;importandroid.os.Bundle;importandroidx.fragment.app.Fragment;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;/**
* A simple {@link Fragment} subclass.
* Use the factory method to
* create an instance of this fragment.
*/publicclass tongxunluFragment extendsFragment{publictongxunluFragment(){// Required empty public constructor}@OverridepublicViewonCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){// Inflate the layout for this fragmentreturn inflater.inflate(R.layout.interface2, container,false);}}
faxianFragment 将结尾选中区域改成interface3
packagecom.example.wechat;importandroid.os.Bundle;importandroidx.fragment.app.Fragment;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;/**
* A simple {@link Fragment} subclass.
* Use the factory method to
* create an instance of this fragment.
*/publicclass faxianFragment extendsFragment{publicfaxianFragment(){// Required empty public constructor}@OverridepublicViewonCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){// Inflate the layout for this fragmentreturn inflater.inflate(R.layout.interface3, container,false);}}
woFragment 将结尾选中区域改成interface4
packagecom.example.wechat;importandroid.os.Bundle;importandroidx.fragment.app.Fragment;importandroid.view.LayoutInflater;importandroid.view.View;importandroid.view.ViewGroup;/**
* A simple {@link Fragment} subclass.
* Use the factory method to
* create an instance of this fragment.
*/publicclass woFragment extendsFragment{publicwoFragment(){// Required empty public constructor}@OverridepublicViewonCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){// Inflate the layout for this fragmentreturn inflater.inflate(R.layout.interface4, container,false);}}