浏览代码

优质评价添加完成

huyuguo 4 年之前
父节点
当前提交
9ad1e8d95a

+ 10 - 32
app/src/main/java/com/electric/chargingpile/adapter/ZhanCommentsAapter.java

@ -118,13 +118,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
118 118
119 119
        if (holder == null) {
120 120
            holder = new ViewHolder();
121
122
//            holder.tv_sname = (TextView) convertView
123
//                    .findViewById(R.id.tv);
124
//            holder.tv_stime = (TextView) convertView
125
//                    .findViewById(R.id.tv_time);
126
//            holder.tv_scontext = (TextView) convertView
127
//                    .findViewById(R.id.tv_comment);
128 121
            holder.tv_pname = (TextView) convertView.findViewById(R.id.tv_pname);
129 122
            holder.tv_pdelete = (TextView) convertView.findViewById(R.id.tv_pdelete);
130 123
            holder.tv_ptime = (TextView) convertView.findViewById(R.id.tv_ptime);
@ -136,14 +129,13 @@ public class ZhanCommentsAapter extends BaseAdapter {
136 129
            holder.lv_scomment = (ListView) convertView.findViewById(R.id.lv_scomment);
137 130
138 131
            holder.iv_picon = (ImageView) convertView.findViewById(R.id.iv_picon);
139
            holder.certified_icon = (ImageView)convertView.findViewById(R.id.certified_icon);
132
            holder.certified_icon = (ImageView) convertView.findViewById(R.id.certified_icon);
133
            holder.high_grade_comment_icon = (ImageView) convertView.findViewById(R.id.high_grade_comment_icon);
140 134
            holder.iv_pgrade = (ImageView) convertView.findViewById(R.id.iv_pgrade);
141 135
            holder.iv_commentPic = (ImageView) convertView.findViewById(R.id.iv_commentPic);
142 136
            holder.iv_level_img = (ImageView) convertView.findViewById(R.id.iv_level_img);
143 137
            holder.iv_pzan = (ImageView) convertView.findViewById(R.id.iv_pzan);
144
//            holder.ll_pinglunn = (LinearLayout) convertView.findViewById(R.id.ll_pinglunn);
145 138
            holder.ll_pzan = (LinearLayout) convertView.findViewById(R.id.ll_pzan);
146
//            holder.iv_havemessage = (ImageView) convertView.findViewById(R.id.iv_havemessage);
147 139
            holder.fl_ptag = (TagFlowLayout) convertView.findViewById(R.id.fl_ptag);
148 140
            holder.parent = (RelativeLayout) convertView.findViewById(R.id.parent);
149 141
@ -172,7 +164,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
172 164
                        holder.iv_level_img.setVisibility(View.GONE);
173 165
                    } else if (title.equals("V0")) {
174 166
                        holder.iv_level_img.setVisibility(View.GONE);
175
//                    holder.iv_level_img.setImageResource(R.drawable.icon_level_putong);
176 167
                    } else if (title.equals("V1")) {
177 168
                        holder.iv_level_img.setVisibility(View.VISIBLE);
178 169
                        holder.iv_level_img.setImageResource(R.drawable.icon_qingtong);
@ -210,13 +201,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
210 201
                //父级头像
211 202
                holder.iv_picon.setImageResource(R.drawable.icon_face2_0);
212 203
                final String pic_url = MainApplication.url + "/zhannew/uploadfile/" + datas.get(position).getString("userpic");
213
//                PicassoUtil.loadingNetImage(mContext,pic_url,holder.iv_picon);
214
//                Glide.with(MainApplication.context)
215
//                        .load(pic_url)
216
//                        .error(R.drawable.icon_face2_0)
217
//                        .placeholder(R.drawable.icon_face2_0)
218
//                        .into(holder.iv_picon);
219
220 204
                Picasso.with(MainApplication.context)
221 205
                        .load(pic_url)
222 206
                        .error(R.drawable.icon_face2_0)
@ -240,20 +224,24 @@ public class ZhanCommentsAapter extends BaseAdapter {
240 224
                String chexing = datas.get(position).getString("hascar");
241 225
                int isCertifiedOwner = datas.get(position).getInt("is_certified_owner");
242 226
                holder.tv_pcar.setText(CarTypeUtil.getCarType(chexing));
243
//                holder.tv_pcar.setText(carSeries);
244 227
                if (isCertifiedOwner == 1) {
245 228
                    holder.certified_icon.setVisibility(View.VISIBLE);
246 229
                } else {
247 230
                    holder.certified_icon.setVisibility(View.GONE);
248 231
                }
249 232
233
                String fine = datas.get(position).getString("fine");
234
                if ("1".equals(fine)) {
235
                    holder.high_grade_comment_icon.setVisibility(View.VISIBLE);
236
                } else {
237
                    holder.high_grade_comment_icon.setVisibility(View.GONE);
238
                }
239
250 240
                //父级回复
251 241
                holder.tv_preply.setOnClickListener(new View.OnClickListener() {
252 242
                    @Override
253 243
                    public void onClick(View v) {
254 244
                        MobclickAgent.onEvent(mContext, "0204", new HashMap<String, String>().put("type", "回复"));
255
//                        Toast.makeText(mContext,"!!!",Toast.LENGTH_SHORT).show();
256
//                        ZhanCommentFragment.lv_comment.smoothScrollToPosition(position);
257 245
                        NewZhanDetailsActivity.commentType = 2;
258 246
                        NewZhanDetailsActivity.et_comment.setFocusable(true);
259 247
                        NewZhanDetailsActivity.et_comment.setFocusableInTouchMode(true);
@ -282,14 +270,12 @@ public class ZhanCommentsAapter extends BaseAdapter {
282 270
                if (datas.get(position).getJSONArray("subcomments").length() == 0) {
283 271
                    holder.lv_scomment.setVisibility(View.GONE);
284 272
                    holder.tv_more.setVisibility(View.GONE);
285
//                    Log.i("childs_gone",datas.get(position).getJSONArray("subcomments").length()+"");
286 273
                } else {
287 274
                    holder.lv_scomment.setVisibility(View.VISIBLE);
288 275
                    if (Integer.parseInt(num) > 3) {
289 276
                        holder.tv_more.setVisibility(View.VISIBLE);
290 277
                        holder.tv_more.setText("共" + num + "条回复>");
291 278
                    }
292
//                    Log.i("childs_visible",datas.get(position).getJSONArray("subcomments").toString());
293 279
                    ArrayList<JSONObject> data = new ArrayList<JSONObject>();
294 280
                    JSONArray jsonArray = new JSONArray(datas.get(position).getJSONArray("subcomments").toString());
295 281
                    for (int j = 0; j < jsonArray.length(); j++) {
@ -297,8 +283,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
297 283
                                .opt(j);
298 284
                        data.add(jsonObject4);
299 285
                    }
300
//                    Log.d("comments_size==!",data.size()+"");
301
302 286
                    holder.lv_scomment.setAdapter(new ZhanSCommentsAdapter(data, mActivity, mContext, "1", String.valueOf(position)));
303 287
                }
304 288
                //父级评论标签
@ -388,7 +372,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
388 372
                            } catch (Exception e) {
389 373
                                e.printStackTrace();
390 374
                            }
391
//                            Log.e("zan_url",url);
392 375
                            OkHttpUtils.get()
393 376
                                    .url(url)
394 377
                                    .build()
@ -441,7 +424,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
441 424
                    final String url = MainApplication.url + "/zhannew/uploadfile/" + datas.get(position).getString("thumUrl");
442 425
                    final String file_url = MainApplication.url + "/zhannew/uploadfile/" + datas.get(position).getString("fileUrl");
443 426
                    final String[] s = {file_url};
444
//                    PicassoUtil.loadingNetImage(mContext,url,holder.iv_commentPic);
445 427
                    Picasso.with(MainApplication.context)
446 428
                            .load(url)
447 429
                            .into(holder.iv_commentPic);
@ -462,7 +444,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
462 444
                //设置删除
463 445
                String userid = datas.get(position).getString("userid");
464 446
                final String id = datas.get(position).getString("id");
465
//                Log.e("eeee", userid );
466 447
                holder.tv_pdelete.setVisibility(View.GONE);
467 448
                if (!MainApplication.isLogin()) {
468 449
                    holder.tv_pdelete.setVisibility(View.GONE);
@ -490,7 +471,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
490 471
491 472
                                                    @Override
492 473
                                                    public void onResponse(String response) {
493
//                                                        Log.e("eeee", response );
494 474
                                                        ZhanCommentFragment.dialog.cancel();
495 475
                                                        String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
496 476
                                                        if (rtnCode.equals("01")) {
@ -508,8 +488,6 @@ public class ZhanCommentsAapter extends BaseAdapter {
508 488
                                    public void onClick(View v) {
509 489
                                    }
510 490
                                }).show();
511
//                                String url = MainApplication.url+"/zhannew/basic/web/index.php/tpappcomments/delete-comments?id=23068&phone="+MainApplication.userPhone+"&password="+MainApplication.userPassword;
512
513 491
                            }
514 492
                        });
515 493
                    }
@ -525,7 +503,7 @@ public class ZhanCommentsAapter extends BaseAdapter {
525 503
526 504
    private class ViewHolder {
527 505
        TextView tv_pdelete, tv_pname, tv_sname, tv_ptime, tv_stime, tv_pcontext, tv_scontext, tv_preply, tv_pcar, tv_more, tv_pzan;
528
        ImageView iv_picon, certified_icon;
506
        ImageView iv_picon, certified_icon, high_grade_comment_icon;
529 507
        LinearLayout ll_pzan;
530 508
        ImageView iv_havemessage, iv_commentPic;
531 509
        ImageView iv_pgrade, iv_pzan, iv_level_img;

二进制
app/src/main/res/drawable-hdpi/high_grade_comment_icon.png


二进制
app/src/main/res/drawable-xhdpi/high_grade_comment_icon.png


二进制
app/src/main/res/drawable-xxhdpi/high_grade_comment_icon.png


二进制
app/src/main/res/drawable-xxxhdpi/high_grade_comment_icon.png


+ 77 - 54
app/src/main/res/layout/item_zhancomments.xml

@ -1,6 +1,7 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
4 5
    xmlns:zhy="http://schemas.android.com/tools"
5 6
    android:id="@+id/ll_zhan_comments"
6 7
    android:layout_width="match_parent"
@ -41,76 +42,98 @@
41 42
42 43
        </RelativeLayout>
43 44
44
45
        <TextView
46
            android:id="@+id/tv_pname"
47
            android:layout_width="wrap_content"
45
        <LinearLayout
46
            android:id="@+id/tv_info"
47
            android:layout_width="match_parent"
48 48
            android:layout_height="wrap_content"
49 49
            android:layout_alignTop="@+id/rl_icon"
50
            android:layout_gravity="center_vertical"
51 50
            android:layout_marginLeft="10dp"
52
            android:layout_toEndOf="@+id/rl_icon"
51
            android:layout_marginRight="15dp"
53 52
            android:layout_toRightOf="@+id/rl_icon"
54
            android:ellipsize="end"
55
            android:maxEms="8"
56
            android:singleLine="true"
57
            android:text="EV200车主"
58
            android:textAppearance="?android:attr/textAppearanceSmall"
59
            android:textColor="@color/ui_65"
60
            android:textSize="13sp" />
53
            android:orientation="horizontal">
61 54
62
        <ImageView
63
            android:id="@+id/certified_icon"
64
            android:layout_width="18dp"
65
            android:layout_height="18dp"
66
            android:layout_alignTop="@+id/tv_pname"
67
            android:layout_marginTop="2dp"
68
            android:layout_alignBottom="@+id/tv_pname"
69
            android:layout_marginLeft="5dp"
70
            android:layout_toRightOf="@+id/tv_pname"
71
            android:src="@drawable/certified_icon" />
55
            <LinearLayout
56
                android:layout_width="wrap_content"
57
                android:layout_height="wrap_content"
58
                android:orientation="vertical">
59
60
                <LinearLayout
61
                    android:layout_width="wrap_content"
62
                    android:layout_height="wrap_content"
63
                    android:orientation="horizontal">
64
65
                    <TextView
66
                        android:id="@+id/tv_pname"
67
                        android:layout_width="wrap_content"
68
                        android:layout_height="wrap_content"
69
                        android:ellipsize="end"
70
                        android:maxEms="8"
71
                        android:singleLine="true"
72
                        android:textAppearance="?android:attr/textAppearanceSmall"
73
                        android:textColor="@color/ui_65"
74
                        android:textSize="13sp"
75
                        tools:text="gin" />
76
77
                    <ImageView
78
                        android:id="@+id/certified_icon"
79
                        android:layout_width="18dp"
80
                        android:layout_height="18dp"
81
                        android:layout_marginLeft="5dp"
82
                        android:layout_marginTop="2dp"
83
                        android:src="@drawable/certified_icon" />
84
85
                    <TextView
86
                        android:id="@+id/tv_pcar"
87
                        android:layout_width="match_parent"
88
                        android:layout_height="wrap_content"
89
                        android:layout_marginLeft="5dp"
90
                        android:layout_marginRight="5dp"
91
                        android:ellipsize="end"
92
                        android:singleLine="true"
93
                        android:textAppearance="?android:attr/textAppearanceSmall"
94
                        android:textColor="#888888"
95
                        android:textSize="13sp"
96
                        tools:text="本田CR-V" />
97
                </LinearLayout>
98
99
                <ImageView
100
                    android:id="@+id/iv_pgrade"
101
                    android:layout_width="wrap_content"
102
                    android:layout_height="wrap_content"
103
                    android:layout_marginTop="5dp"
104
                    android:src="@drawable/icon_5xing"
105
                    android:textAppearance="?android:attr/textAppearanceSmall" />
106
            </LinearLayout>
72 107
73
        <TextView
74
            android:id="@+id/tv_pcar"
75
            android:layout_width="match_parent"
76
            android:layout_height="wrap_content"
77
            android:layout_alignTop="@+id/tv_pname"
78
            android:layout_gravity="center_vertical"
79
            android:layout_marginLeft="5dp"
80
            android:layout_marginRight="5dp"
81
            android:layout_toLeftOf="@+id/iv_pgrade"
82
            android:layout_toRightOf="@+id/certified_icon"
83
            android:ellipsize="end"
84
            android:singleLine="true"
85
            android:text="北京市"
86
            android:textAppearance="?android:attr/textAppearanceSmall"
87
            android:textColor="#888888"
88
            android:textSize="13sp" />
108
            <TextView
109
                android:layout_width="wrap_content"
110
                android:layout_height="wrap_content"
111
                android:layout_weight="1" />
112
113
            <ImageView
114
                android:id="@+id/high_grade_comment_icon"
115
                android:layout_width="42dp"
116
                android:layout_height="42dp"
117
                android:layout_alignParentRight="true"
118
                android:src="@drawable/high_grade_comment_icon"
119
                android:visibility="gone"
120
                tools:visibility="visible" />
121
        </LinearLayout>
89 122
90
        <ImageView
91
            android:id="@+id/iv_pgrade"
92
            android:layout_width="wrap_content"
93
            android:layout_height="wrap_content"
94
            android:layout_alignTop="@+id/tv_pname"
95
            android:layout_alignParentRight="true"
96
            android:layout_gravity="center_vertical"
97
            android:layout_marginRight="15dp"
98
            android:src="@drawable/icon_5xing"
99
            android:textAppearance="?android:attr/textAppearanceSmall" />
100 123
101 124
        <TextView
102 125
            android:id="@+id/tv_pcontext"
103 126
            android:layout_width="wrap_content"
104 127
            android:layout_height="wrap_content"
105
            android:layout_below="@+id/tv_pname"
106
            android:layout_alignStart="@+id/tv_pname"
107
            android:layout_alignLeft="@+id/tv_pname"
128
            android:layout_below="@+id/tv_info"
129
            android:layout_alignStart="@+id/tv_info"
130
            android:layout_alignLeft="@+id/tv_info"
108 131
            android:layout_marginTop="10dp"
109 132
            android:layout_marginRight="15dp"
110
            android:text=""
111 133
            android:textAppearance="?android:attr/textAppearanceSmall"
112 134
            android:textSize="15sp"
113
            android:visibility="visible" />
135
            android:visibility="visible"
136
            tools:text="打扫房间临时冻结疯狂老爹设计费枯鲁杜鹃时空裂缝坚实的考虑放假" />
114 137
115 138
        <com.zhy.view.flowlayout.TagFlowLayout
116 139
            android:id="@+id/fl_ptag"