item_trolley.xml 5.27 KB
Newer Older
weijiguang committed
1 2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
wjg committed
3
    android:id="@+id/layout_item"
weijiguang committed
4 5 6 7
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:orientation="horizontal"
wjg committed
8 9 10 11
    android:paddingStart="@dimen/trolley_item_padding_left"
    android:paddingTop="@dimen/trolley_item_padding_top"
    android:paddingEnd="@dimen/trolley_item_padding_right"
    android:paddingBottom="@dimen/trolley_item_padding_bottom">
weijiguang committed
12
    <ToggleButton
wjg committed
13 14
        android:id="@+id/butn_state"
        style="@style/button_style"
wjg committed
15 16
        android:layout_width="@dimen/ic_checkbox"
        android:layout_height="@dimen/ic_checkbox"
wjg committed
17 18
        android:background="@drawable/sel_butn_check"
        android:checked="true"
wjg committed
19
        android:foreground="?selectableItemBackground"
wjg committed
20 21
        android:textOff=""
        android:textOn="" />
weijiguang committed
22
    <ImageView
wjg committed
23
        android:id="@+id/img_thumbnail"
wjg committed
24 25 26 27
        android:layout_width="@dimen/trolley_thum_size"
        android:layout_height="@dimen/trolley_thum_size"
        android:layout_marginLeft="@dimen/trolley_thum_margin"
        android:layout_marginRight="@dimen/trolley_thum_margin"
wjg committed
28
        android:scaleType="centerCrop" />
weijiguang committed
29 30 31 32 33 34 35 36 37 38
    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">
        <TextView
            android:id="@+id/txt_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="冰茶咖啡"
wjg committed
39
            android:textColor="@color/textPrimary"
wjg committed
40
            android:textSize="@dimen/ts_goods_item_name"
weijiguang committed
41 42 43 44 45
            android:textStyle="bold" />
        <TextView
            android:id="@+id/txt_options"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
wjg committed
46
            android:layout_marginTop="@dimen/trolley_options_margin_top"
weijiguang committed
47
            android:text="冰/无糖"
wjg committed
48
            android:textColor="@color/textSecondPrimary"
wjg committed
49
            android:textSize="@dimen/ts_goods_item_intro" />
weijiguang committed
50 51 52
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
wjg committed
53
            android:layout_marginTop="@dimen/trolley_price_margin_top"
wjg committed
54
            android:gravity="bottom"
weijiguang committed
55
            android:orientation="horizontal">
wjg committed
56
            <TextView
wjg committed
57
                android:id="@+id/ico_discount"
wjg committed
58 59 60
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="¥"
wjg committed
61 62 63
                android:textColor="@color/textPrimary"
                android:textSize="@dimen/ts_goods_item_discount"
                android:textStyle="bold" />
weijiguang committed
64
            <TextView
wjg committed
65
                android:id="@+id/txt_discount"
weijiguang committed
66 67 68
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="19.9"
wjg committed
69 70
                android:textColor="@color/textPrimary"
                android:textSize="@dimen/ts_goods_item_discount"
weijiguang committed
71
                android:textStyle="bold" />
wjg committed
72
            <TextView
wjg committed
73
                android:id="@+id/ico_price"
wjg committed
74 75
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
wjg committed
76
                android:layout_marginStart="@dimen/trolley_price_margin_left"
wjg committed
77
                android:text="¥"
wjg committed
78 79
                android:textColor="@color/textDisable"
                android:textSize="@dimen/ts_goods_item_price" />
weijiguang committed
80
            <TextView
wjg committed
81
                android:id="@+id/txt_price"
wjg committed
82
                android:layout_width="0dp"
weijiguang committed
83
                android:layout_height="wrap_content"
wjg committed
84
                android:layout_weight="1"
weijiguang committed
85
                android:text="29.9"
wjg committed
86 87
                android:textColor="@color/textDisable"
                android:textSize="@dimen/ts_goods_item_price" />
weijiguang committed
88 89 90 91 92
        </LinearLayout>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
wjg committed
93
        android:layout_marginStart="@dimen/trolley_oper_margin"
weijiguang committed
94 95 96 97
        android:gravity="center"
        android:orientation="horizontal">
        <Button
            android:id="@+id/butn_subtract"
wjg committed
98
            style="@style/button_style"
wjg committed
99 100
            android:layout_width="@dimen/ic_subtract_size"
            android:layout_height="@dimen/ic_subtract_size"
wjg committed
101
            android:background="@mipmap/jianhao"
wjg committed
102
            android:foreground="?selectableItemBackground" />
weijiguang committed
103 104 105 106
        <TextView
            android:id="@+id/txt_count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
wjg committed
107 108
            android:layout_marginLeft="@dimen/trolley_count_margin"
            android:layout_marginRight="@dimen/trolley_count_margin"
weijiguang committed
109
            android:text="1"
wjg committed
110
            android:textColor="@color/textPrimary"
wjg committed
111 112
            android:textSize="@dimen/ts_trolley_item_count"
            android:textStyle="bold" />
weijiguang committed
113 114
        <Button
            android:id="@+id/butn_add"
wjg committed
115
            style="@style/button_style"
wjg committed
116 117
            android:layout_width="@dimen/ic_add_size"
            android:layout_height="@dimen/ic_add_size"
wjg committed
118
            android:background="@mipmap/jiahao"
wjg committed
119
            android:foreground="?selectableItemBackground" />
weijiguang committed
120 121
    </LinearLayout>
</LinearLayout>