购物车订单布局

//activity_mian

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.bwie.test.yuekaomoni.MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="编辑"
        android:id="@+id/bianji"
        android:paddingLeft="380dp"
        android:textSize="24dp"
        android:layout_alignParentTop="true" />
    <ScrollView
        android:layout_below="@+id/bianji"
        android:layout_above="@+id/linear_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <!--购物车的二级列表-->
            <com.bwie.test.custom.CartExpanableListview
                android:id="@+id/expanable_listview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

            </com.bwie.test.custom.CartExpanableListview>

            <!--为你推荐-->
            <LinearLayout
                android:layout_marginTop="20dp"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="500dp">

            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <RelativeLayout
        android:visibility="gone"
        android:id="@+id/relative_progress"
        android:layout_above="@+id/linear_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ProgressBar
            android:layout_centerInParent="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/linear_layout"
        android:layout_alignParentBottom="true"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="50dp">

        <CheckBox
            android:layout_marginLeft="10dp"
            android:button="@null"
            android:background="@drawable/check_box_selector"
            android:id="@+id/check_all"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/text_total"
            android:text="合计:¥0.00"
            android:layout_weight="2"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />

        <TextView
            android:text="去结算(0)"
            android:background="#ff0000"
            android:textColor="#ffffff"
            android:gravity="center"
            android:id="@+id/text_buy"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent" />
    </LinearLayout>

    <LinearLayout
        android:visibility="invisible"
        android:id="@+id/linear8"
        android:layout_alignParentBottom="true"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="50dp">

        <CheckBox
            android:layout_marginLeft="10dp"
            android:button="@null"
            android:background="@drawable/check_box_selector"
            android:id="@+id/check_a"
            android:layout_width="30dp"
            android:layout_height="30dp" />

        <Button
            android:layout_marginLeft="80dp"
            android:id="@+id/but1"
            android:text="分享"
            android:layout_weight="2"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />

        <Button
            android:layout_marginLeft="3dp"
            android:id="@+id/but2"
            android:text="移入关注"
            android:layout_weight="3"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />

        <Button
            android:layout_marginLeft="3dp"
            android:id="@+id/but3"
            android:textColor="#f00"
            android:text="删除"
            android:layout_weight="2"
            android:layout_width="0dp"
            android:layout_height="wrap_content" />
    </LinearLayout>

</RelativeLayout>


//activity_mian2

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".Main2Activity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:orientation="horizontal"
        android:layout_alignParentTop="true"
        android:id="@+id/ding">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="26dp"
            android:onClick="huiqu2" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="确认订单"
            android:textSize="24dp"
            android:layout_marginLeft="220dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="订单中心"
            android:layout_marginLeft="180dp"
            android:onClick="dingdanzhongxin" />

    </LinearLayout>
    <TextView
        android:layout_below="@+id/ding"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#000"
        android:id="@+id/xian" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/tupian">

        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:id="@+id/maidongxidetupian" />

    </LinearLayout>

    <LinearLayout
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal">
        <TextView
            android:id="@+id/text_kuan"
            android:layout_width="0dp"
            android:layout_weight="2"
            android:text="实付款:"
            android:layout_marginLeft="120dp"
            android:layout_marginTop="13dp"
            android:textColor="#ff0000"
            android:layout_height="match_parent" />

        <TextView
            android:id="@+id/text_order"
            android:layout_width="0dp"
            android:layout_weight="2"
            android:text="立即下单"
            android:gravity="center"
            android:textColor="#fff"
            android:background="#ff0000"
            android:layout_height="match_parent" />

    </LinearLayout>
</RelativeLayout>


//activity_mian3

<?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:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Main3Activity">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24dp"
        android:textColor="#000"
        android:text="我的订单"
        android:layout_gravity="center"
        ></TextView>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#000" />

    <android.support.design.widget.TabLayout
        android:id="@+id/tab2"
        app:tabGravity="center"
        app:tabIndicatorColor="@color/colorhong"
        app:tabSelectedTextColor="@color/colorAccent"
        app:tabTextColor="@color/colorhei"
        android:layout_width="match_parent"
        android:layout_height="40dp" />

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/tab">
    </android.support.v4.view.ViewPager>

</LinearLayout>


//activity_mian4

<?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:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Main4Activity">
    <ImageView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@drawable/a"
        android:layout_marginTop="30dp"
        android:id="@+id/shuxing"
        android:layout_gravity="center" />

</LinearLayout>


//activity_mian5

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".Main5Activity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:id="@+id/lll3"
        android:layout_above="@+id/ll">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="20dp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20dp"
            android:text="商品详情"
            android:gravity="center"
            android:textColor="#000" />

    </LinearLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#000" />

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:id="@+id/shangpin" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/title2"
        android:textSize="24dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="5dp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/price2"
        android:textSize="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="5dp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/branprice2"
        android:textSize="20dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="5dp"
        android:textColor="#f00" />

    </LinearLayout>

    <LinearLayout
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/ll">

        <Button
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:text="购物车"
            android:gravity="center"
            android:background="#f00"
            android:textColor="#fff"
            android:onClick="gouwuche" />

        <Button
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:text="加入购物车"
            android:gravity="center"
            android:background="#f00"
            android:textColor="#fff"
            android:onClick="jiaru" />

    </LinearLayout>

</RelativeLayout>



//child_item_layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:padding="10dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:id="@+id/rel"
        android:layout_toLeftOf="@+id/text_delete"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <CheckBox
            android:layout_centerVertical="true"
            android:id="@+id/check_child"
            android:button="@null"
            android:background="@drawable/check_box_selector"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <ImageView
            android:id="@+id/image_good"
            android:layout_centerVertical="true"
            android:layout_toRightOf="@+id/check_child"
            android:layout_marginLeft="10dp"
            android:layout_width="80dp"
            android:layout_height="80dp" />

        <TextView
            android:id="@+id/text_title"
            android:layout_toRightOf="@+id/image_good"
            android:layout_marginLeft="10dp"
            android:layout_alignTop="@+id/image_good"
            android:maxLines="2"
            android:minLines="2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/text_price"
            android:layout_toRightOf="@+id/image_good"
            android:layout_marginLeft="10dp"
            android:layout_alignBottom="@+id/image_good"
            android:text="¥99.99"
            android:textColor="#ff0000"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <LinearLayout
            android:layout_alignParentRight="true"
            android:layout_alignBottom="@+id/image_good"
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/text_jian"
                android:text=""
                android:padding="5dp"
                android:background="@drawable/bian_kuang_line"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <TextView
                android:gravity="center"
                android:id="@+id/text_num"
                android:paddingLeft="10dp"
                android:paddingRight="10dp"
                android:background="@drawable/bian_kuang_line"
                android:layout_width="wrap_content"
                android:layout_height="match_parent" />

            <TextView
                android:id="@+id/text_add"
                android:text=""
                android:padding="5dp"
                android:background="@drawable/bian_kuang_line"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>
    </RelativeLayout>

    <TextView
        android:layout_marginLeft="3dp"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/rel"
        android:layout_alignBottom="@+id/rel"
        android:id="@+id/text_delete"
        android:background="#ff0000"
        android:text="删除"
        android:gravity="center"
        android:textColor="#ffffff"
        android:layout_width="50dp"
        android:layout_height="match_parent" />

</RelativeLayout>


//group_item_layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:gravity="center_vertical"
    android:padding="10dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <CheckBox
        android:button="@null"
        android:background="@drawable/check_box_selector"
        android:id="@+id/check_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_marginLeft="10dp"
        android:text="京东自营"
        android:id="@+id/text_group"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>


//ding

<?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="match_parent">

    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/lvvv"
        ></ListView>

</LinearLayout>


//dingdan

<?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="match_parent"
    android:orientation="horizontal">
    
    <LinearLayout
        android:paddingLeft="35dp"
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_weight="3"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:textColor="#000"
            android:id="@+id/dingtitile" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="3dp"
            android:id="@+id/dingprice"
            android:textColor="#f00"
            android:textSize="20dp"
            />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="3dp"
            android:id="@+id/dingtime" />

    </LinearLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/zhuangtai"
            android:layout_marginLeft="10dp"
            android:text="yi"
            />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="订单"
            android:id="@+id/dan" />

    </LinearLayout>

</LinearLayout>


drawable文件夹下//bian_kuang_line.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#ffffff" />
    <stroke
        android:width="0.1dp"
        android:color="#000000" />
</shape>


//check_box_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<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="@drawable/shopping_cart_none_check"/>
    <item android:drawable="@drawable/shopping_cart_none_check"/>
</selector>



//values文件夹下//colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="colorhui">#ccc</color>
    <color name="colorhei">#000</color>
    <color name="colorhong">#f00</color>
</resources>


//添加依赖

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
testCompile 'junit:junit:4.12'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.xhb:xbanner:1.2.2'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okio:okio:1.11.0'
compile 'com.orhanobut:logger:1.15'
compile 'com.android.support.test:runner:0.5'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile 'com.jcodecraeer:xrecyclerview:1.3.2'
compile files('libs/glide-3.7.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/gson-2.8.0.jar')


//添加方法

<application
    android:name="com.bwie.test.application.DashApplication"
</application>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值