|
|
@ -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;
|