Skip to content

Commit 62f2cb4

Browse files
committed
修改评论列表UI
1 parent 578a234 commit 62f2cb4

14 files changed

+1089
-933
lines changed

gen/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/com
2+
/.gitignore
204 Bytes
Loading
931 Bytes
Loading

res/layout/comment.xml

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,62 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:layout_width="match_parent"
4-
android:layout_height="match_parent"
5-
android:orientation="vertical"
6-
>
7-
8-
<RelativeLayout
9-
android:background="?attr/title_bar_bg"
10-
android:layout_width="match_parent"
11-
android:layout_height="wrap_content">
12-
<ImageButton
13-
android:layout_alignParentLeft="true"
14-
android:id="@+id/comment_return"
15-
style="@style/img_btn_style"
16-
android:src="@drawable/btn_back"
17-
/>
18-
<TextView
19-
android:layout_width="wrap_content"
20-
android:layout_height="wrap_content"
21-
android:layout_centerInParent="true"
22-
android:textSize="20sp"
23-
android:textColor="@color/white"
24-
android:text="评论列表" />
25-
</RelativeLayout>
26-
<com.handmark.pulltorefresh.library.PullToRefreshListView
27-
android:id="@+id/comment_Lv"
28-
android:divider="@color/transparent"
29-
android:layout_width="match_parent"
30-
android:layout_height="0dp"
31-
android:cacheColorHint="#00000000"
32-
android:layout_weight="1"
33-
/>
34-
<LinearLayout
35-
android:layout_gravity="bottom"
36-
android:background="@drawable/article_toolbar"
37-
android:paddingLeft="20.0dip"
38-
android:paddingTop="8.0dip"
39-
android:paddingRight="20.0dip"
40-
android:layout_width="fill_parent"
41-
android:layout_height="60.0dip">
42-
<TextView
43-
android:textSize="16.0sp"
44-
android:textColor="#ff999999"
45-
android:gravity="center_vertical"
46-
android:layout_gravity="center_vertical"
47-
android:background="@drawable/add_comment_bgd"
48-
android:paddingLeft="10.0dip"
49-
android:clickable="true"
50-
android:layout_width="fill_parent"
51-
android:layout_height="wrap_content"
52-
android:text="我来说两句"
53-
android:drawableLeft="@drawable/comment_write_icon"
54-
android:drawablePadding="10.0dip"
55-
android:onClick="onAddComment" />
56-
</LinearLayout>
57-
58-
</LinearLayout>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
android:background="@color/white"
7+
>
8+
9+
<RelativeLayout
10+
android:background="?attr/title_bar_bg"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content">
13+
<ImageButton
14+
android:layout_alignParentLeft="true"
15+
android:id="@+id/comment_return"
16+
style="@style/img_btn_style"
17+
android:src="@drawable/btn_back"
18+
/>
19+
<TextView
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:layout_centerInParent="true"
23+
android:textSize="20sp"
24+
android:textColor="@color/white"
25+
android:text="评论列表" />
26+
</RelativeLayout>
27+
<com.handmark.pulltorefresh.library.PullToRefreshListView
28+
android:id="@+id/comment_Lv"
29+
android:divider="@drawable/listview_divider_line"
30+
android:dividerHeight="1.0dip"
31+
android:layout_width="match_parent"
32+
android:layout_height="0dp"
33+
android:layout_weight="1"
34+
android:fadingEdge="none"
35+
android:paddingTop="5dp"
36+
android:paddingBottom="5dp"
37+
/>
38+
<LinearLayout
39+
android:layout_gravity="bottom"
40+
android:background="@drawable/article_toolbar"
41+
android:paddingLeft="20.0dip"
42+
android:paddingTop="8.0dip"
43+
android:paddingRight="20.0dip"
44+
android:layout_width="fill_parent"
45+
android:layout_height="60.0dip">
46+
<TextView
47+
android:textSize="16.0sp"
48+
android:textColor="#ff999999"
49+
android:gravity="center_vertical"
50+
android:layout_gravity="center_vertical"
51+
android:background="@drawable/add_comment_bgd"
52+
android:paddingLeft="10.0dip"
53+
android:clickable="true"
54+
android:layout_width="fill_parent"
55+
android:layout_height="wrap_content"
56+
android:text="我来说两句"
57+
android:drawableLeft="@drawable/comment_write_icon"
58+
android:drawablePadding="10.0dip"
59+
android:onClick="onAddComment" />
60+
</LinearLayout>
61+
62+
</LinearLayout>

res/layout/comment_item.xml

Lines changed: 44 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,44 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
3-
4-
<RelativeLayout
5-
xmlns:android="http://schemas.android.com/apk/res/android"
6-
android:layout_width="fill_parent"
7-
android:layout_height="wrap_content"
8-
android:background="@color/window_bg"
9-
>
10-
11-
<LinearLayout
12-
android:id="@+id/cutline"
13-
android:orientation="vertical"
14-
android:layout_width="fill_parent"
15-
android:layout_height="wrap_content">
16-
<ImageView android:layout_width="fill_parent" android:layout_height="1.1px" android:src="#ffadb4ba" />
17-
<ImageView android:layout_width="fill_parent" android:layout_height="1.1px" android:src="#ffffffff" />
18-
</LinearLayout>
19-
<RelativeLayout
20-
android:layout_width="fill_parent"
21-
android:layout_height="wrap_content"
22-
android:id="@+id/header"
23-
android:layout_below="@id/cutline"
24-
android:paddingLeft="5dp"
25-
android:paddingTop="5dp"
26-
>
27-
<LinearLayout
28-
android:layout_width="54dp"
29-
android:layout_height="54dp"
30-
android:id="@+id/headImageBox"
31-
android:background="@drawable/channel_icon_bg"
32-
>
33-
<ImageView
34-
android:id="@+id/comment_usr_icon"
35-
android:layout_width="50dp"
36-
android:layout_height="50dp"
37-
android:src="@drawable/head_default"
38-
android:layout_centerHorizontal="true"
39-
android:layout_centerVertical="true"
40-
android:scaleType="fitXY"
41-
/>
42-
</LinearLayout>
43-
<TextView
44-
android:id="@+id/nick"
45-
android:layout_width="wrap_content"
46-
android:layout_height="wrap_content"
47-
android:layout_marginLeft="60dp"
48-
android:textColor="@color/blue"
49-
/>
50-
<TextView
51-
android:id="@+id/comment_usr_nick"
52-
android:layout_width="wrap_content"
53-
android:layout_height="wrap_content"
54-
android:layout_marginLeft="60dp"
55-
android:textSize="16sp"
56-
android:text="zcloud"
57-
android:textColor="@color/gray"
58-
android:layout_marginTop="10dp"
59-
/>
60-
<TextView
61-
android:layout_width="wrap_content"
62-
android:layout_height="wrap_content"
63-
android:layout_marginRight="5dp"
64-
android:layout_below="@id/nick"
65-
android:textSize="10sp"
66-
android:textColor="@color/gray"
67-
android:text="string/minuteago"
68-
android:layout_alignParentRight="true"
69-
android:id="@+id/comment_minuteago"
70-
android:layout_marginTop="10dp"
71-
/>
72-
</RelativeLayout>
73-
<ImageView
74-
android:id="@+id/div_line"
75-
android:background="@drawable/channel_line"
76-
android:layout_width="fill_parent"
77-
android:layout_height="wrap_content"
78-
android:layout_marginTop="1.0dip"
79-
android:layout_below="@id/header" />
80-
81-
<RelativeLayout
82-
android:layout_width="fill_parent"
83-
android:layout_height="wrap_content"
84-
android:layout_below="@id/div_line"
85-
android:padding="5dp"
86-
>
87-
<TextView
88-
android:id="@+id/comment_content"
89-
android:layout_width="wrap_content"
90-
android:layout_height="wrap_content"
91-
android:textColor="@color/black"
92-
android:padding="5dp"
93-
/>
94-
</RelativeLayout>
95-
</RelativeLayout>
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:layout_width="fill_parent"
3+
android:layout_height="fill_parent" >
4+
5+
<ImageView
6+
android:id="@+id/usrportrait_iv"
7+
android:layout_width="50dp"
8+
android:layout_height="50dp"
9+
android:padding="5dp"
10+
android:src="@drawable/head_default" />
11+
12+
<LinearLayout
13+
android:layout_toRightOf="@id/usrportrait_iv"
14+
android:layout_width="wrap_content"
15+
android:layout_height="match_parent"
16+
android:orientation="vertical" >
17+
18+
<TextView
19+
android:id="@+id/usrname_tv"
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:padding="5dp"
23+
android:textColor="@color/blue"
24+
android:text="用户名" />
25+
26+
<TextView
27+
android:id="@+id/usrcomment_tv"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:padding="5dp"
31+
android:text="这里是用户评论" />
32+
33+
<TextView
34+
android:id="@+id/usr_timeago_tv"
35+
android:layout_width="wrap_content"
36+
android:layout_height="wrap_content"
37+
android:textSize="12sp"
38+
android:textColor="@color/dark_gray"
39+
android:padding="5dp"
40+
android:text="几分钟前" />
41+
42+
</LinearLayout>
43+
44+
</RelativeLayout>

res/layout/comment_menu.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:layout_width="fill_parent"
3+
android:layout_height="fill_parent"
4+
android:orientation="horizontal" >
5+
<EditText
6+
android:id="@+id/comment_context_et"
7+
android:textSize="16.0sp"
8+
android:textColor="@color/black"
9+
android:ellipsize="none"
10+
android:background="@null"
11+
android:layout_weight="1"
12+
android:layout_width="0dp"
13+
android:layout_height="wrap_content"
14+
android:maxLines="3"
15+
android:lines="3"
16+
android:singleLine="false"
17+
android:text="写下评论" />
18+
19+
<Button
20+
android:id="@+id/post_btn"
21+
android:layout_width="wrap_content"
22+
android:layout_height="wrap_content"
23+
android:text="评论" />
24+
25+
</LinearLayout>

0 commit comments

Comments
 (0)