item_goods.xml 5.5 KB
Newer Older
wjg committed
1 2 3 4 5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout_item"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
wjg committed
6
    android:foreground="@null"
wjg committed
7
    android:gravity="center_vertical"
wjg committed
8 9
    android:orientation="horizontal"
    android:paddingVertical="@dimen/goods_padding_ver">
wjg committed
10
    <RelativeLayout
wjg committed
11 12
        android:layout_width="@dimen/goods_thum_size"
        android:layout_height="@dimen/goods_thum_size"
wjg committed
13
        android:layout_marginEnd="@dimen/goods_thum_margin_right">
wjg committed
14 15 16 17 18 19 20 21 22 23
        <ImageView
            android:id="@+id/img_thumbnail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop" />
        <ImageView
            android:id="@+id/img_recommend"
            android:layout_width="@dimen/ic_recommend"
            android:layout_height="@dimen/ic_recommend"
            android:layout_alignParentEnd="true"
wjg committed
24
            android:layout_margin="@dimen/goods_recommend_margin"
wjg committed
25 26
            android:src="@mipmap/aixin_2x"
            android:visibility="gone" />
wjg committed
27
    </RelativeLayout>
wjg committed
28
    <LinearLayout
wjg committed
29
        android:id="@+id/layout_right"
wjg committed
30 31 32 33
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="bottom"
wjg committed
34 35
        android:orientation="vertical"
        android:paddingEnd="@dimen/goods_padding_right">
wjg committed
36 37 38 39 40 41
        <TextView
            android:id="@+id/txt_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="冰茶咖啡"
            android:textColor="@color/textPrimary"
wjg committed
42
            android:textSize="@dimen/ts_goods_item_name"
wjg committed
43 44 45 46 47
            android:textStyle="bold" />
        <LinearLayout
            android:id="@+id/layout_tags"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
wjg committed
48
            android:layout_marginTop="@dimen/goods_tag_margin_top"
wjg committed
49 50 51 52 53 54
            android:gravity="center_vertical"
            android:orientation="horizontal" />
        <TextView
            android:id="@+id/txt_intro"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
wjg committed
55
            android:layout_marginTop="@dimen/goods_desc_margin_top"
wjg committed
56 57
            android:ellipsize="end"
            android:lines="1"
wjg committed
58
            android:text=""
wjg committed
59
            android:textColor="@color/textSecondPrimary"
wjg committed
60
            android:textSize="@dimen/ts_goods_item_intro" />
wjg committed
61
        <RelativeLayout
wjg committed
62
            android:id="@+id/layout_butns"
wjg committed
63 64
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
wjg committed
65
            android:layout_marginTop="@dimen/goods_butns_margin_top">
wjg committed
66
            <TextView
wjg committed
67
                android:id="@+id/ico_discount"
wjg committed
68 69
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
wjg committed
70
                android:layout_alignParentBottom="true"
wjg committed
71 72
                android:src="@drawable/ms__arrow"
                android:text="¥"
wjg committed
73 74 75
                android:textColor="@color/textPrimary"
                android:textSize="@dimen/ts_goods_item_discount"
                android:textStyle="bold" />
wjg committed
76
            <TextView
wjg committed
77
                android:id="@+id/txt_discount"
wjg committed
78 79
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
wjg committed
80
                android:layout_alignParentBottom="true"
wjg committed
81
                android:layout_marginEnd="@dimen/goods_price_margin"
wjg committed
82
                android:layout_toRightOf="@id/ico_discount"
wjg committed
83
                android:text="19.9"
wjg committed
84 85
                android:textColor="@color/textPrimary"
                android:textSize="@dimen/ts_goods_item_discount"
wjg committed
86 87
                android:textStyle="bold" />

wjg committed
88
            <TextView
wjg committed
89
                android:id="@+id/ico_price"
wjg committed
90 91
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
wjg committed
92
                android:layout_alignParentBottom="true"
wjg committed
93
                android:layout_toEndOf="@id/txt_discount"
wjg committed
94 95
                android:text="¥"
                android:textColor="@color/textSecondPrimary"
wjg committed
96
                android:textSize="@dimen/ts_goods_item_price" />
wjg committed
97
            <TextView
wjg committed
98
                android:id="@+id/txt_price"
wjg committed
99
                android:layout_width="wrap_content"
wjg committed
100
                android:layout_height="wrap_content"
wjg committed
101
                android:layout_alignParentBottom="true"
wjg committed
102
                android:layout_toEndOf="@id/ico_price"
wjg committed
103 104
                android:text="29.9"
                android:textColor="@color/textSecondPrimary"
wjg committed
105
                android:textSize="@dimen/ts_goods_item_price" />
wjg committed
106

wjg committed
107 108 109 110
            <TextView
                android:id="@+id/txt_sellout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
wjg committed
111 112
                android:layout_alignParentEnd="true"
                android:layout_alignParentBottom="true"
wjg committed
113
                android:text="已售罄"
wjg committed
114
                android:textColor="@color/textSecondPrimary"
wjg committed
115
                android:textSize="@dimen/ts_goods_item_sellout"
wjg committed
116
                android:visibility="gone" />
wjg committed
117 118 119
            <Button
                android:id="@+id/butn_add"
                style="@style/button_style"
wjg committed
120 121
                android:layout_width="@dimen/ic_add_size"
                android:layout_height="@dimen/ic_add_size"
wjg committed
122
                android:layout_alignParentEnd="true"
wjg committed
123
                android:background="@mipmap/jiahao" />
wjg committed
124
        </RelativeLayout>
wjg committed
125 126
    </LinearLayout>
</LinearLayout>