一、activity_main2.xml
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.bwei.MoNiSan_20180915.Main2Activity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15">
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/f_recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#ffffff">
<CheckBox
android:id="@+id/f_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
/>
<TextView
android:id="@+id/qx_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="全选"
android:layout_toRightOf="@id/f_checkbox"
android:layout_centerVertical="true"
/>
<TextView
android:id="@+id/f_price"
android:layout_marginLeft="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="总价:0.0"
android:textSize="18sp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/qx_tv"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#aaa"
android:layout_marginTop="5dp"
android:text="去结算"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>
</LinearLayout>
二、R.layout.three_item.xml
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#dddddd">
<CheckBox
android:id="@+id/z_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
/>
<TextView
android:id="@+id/z_text"
android:layout_toRightOf="@id/z_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="商家"
/>
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/z_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
</LinearLayout>
三、R.layout.three_z_item.xml
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/up_cb"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.facebook.drawee.view.SimpleDraweeView
android:src="@mipmap/ic_launcher"
android:id="@+id/show2_ima"
android:layout_width="80dp"
android:layout_height="80dp"/>
</LinearLayout>
<LinearLayout
android:layout_marginLeft="10dp"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/show2_text"
android:text="商品标题"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/show_price"
android:layout_alignParentLeft="true"
android:text="优惠价:¥99.99"
android:textColor="@android:color/holo_red_light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<include
layout="@layout/btnzu"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#999999"/>
</LinearLayout>
四、加减器——btnzu.xml
<RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center">
<Button
android:id="@+id/zu_btn_del"
android:layout_width="40dp"
android:layout_height="40dp"
android:text="-"/>
<EditText
android:id="@+id/zu_ed"
android:layout_width="30dp"
android:layout_height="40dp"
android:layout_alignBaseline="@+id/zu_btn_del"
android:layout_alignBottom="@+id/zu_btn_del"
android:layout_centerHorizontal="true"
android:background="@null"/>
<Button
android:id="@+id/zu_btn_add"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="81dp"
android:text="+"/>