购物车布局
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context="com.example.newshoppcart.view.ShoppCartActivity">
<RelativeLayout
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="50dp">
<ImageView
android:layout_centerVertical="true"
android:id="@+id/detail_image_back"
android:padding="5dp"
android:src="@drawable/leftjiantou"
android:layout_width="40dp"
android:layout_height="40dp" />
<TextView
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="18sp"
android:padding="10dp"
android:text="购物车" />
</RelativeLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:layout_below="@+id/text_title"
android:layout_above="@+id/linear_bottom"
android:id="@+id/smart_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<com.example.newshoppcart.view.custom.MyExpanableView
android:id="@+id/my_expanable_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
</com.example.newshoppcart.view.custom.MyExpanableView>
</ScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<RelativeLayout
android:layout_above="@+id/linear_bottom"
android:layout_below="@+id/text_title"
android:id="@+id/relative_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
<LinearLayout
android:id="@+id/linear_bottom"
android:layout_alignParentBottom="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dp">
<CheckBox
android:button="@null"
android:background="@drawable/check_box_selector"
android:layout_marginLeft="10dp"
android:id="@+id/cart_check_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="5dp"
android:text="全选"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:textSize="20sp"
android:layout_marginLeft="10dp"
android:id="@+id/text_total"
android:text="合计:¥0.00"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
<TextView
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:id="@+id/text_buy"
android:gravity="center"
android:background="#ff0000"
android:textColor="#ffffff"
android:text="去结算(0)"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
全选用到的背景shape
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/shopping_cart_checked"/>
<item android:state_checked="false" android:drawable