td>
|
|
|
108
|
|
|
|
109
|
private void initDialog() {
|
|
|
110
|
chatRecommendBean = (ChatRecommendBean) getArguments().getSerializable(ARG_BEAN);
|
|
|
111
|
commentBean = (CommentBean)getArguments().getSerializable(ARG_COMMENT_BEAN);
|
|
|
112
|
|
|
|
113
|
allComments = dialog.findViewById(R.id.allComments);
|
|
|
114
|
bCommentContent = dialog.findViewById(R.id.bCommentContent);
|
|
|
115
|
bPublish = dialog.findViewById(R.id.bPublish);
|
|
|
116
|
allCommentTitle = dialog.findViewById(R.id.allCommentTitle);
|
|
|
117
|
loadingView = dialog.findViewById(R.id.loadingView);
|
|
|
118
|
loadingIndicator = dialog.findViewById(R.id.loadingIndicator);
|
|
|
119
|
noDataView = dialog.findViewById(R.id.noDataView);
|
|
|
120
|
|
|
|
121
|
commentHeadImage = dialog.findViewById(R.id.commentHeadImage);
|
|
|
122
|
commentNickName = dialog.findViewById(R.id.commentNickName);
|
|
|
123
|
commentAddDate = dialog.findViewById(R.id.commentAddDate);
|
|
|
124
|
commentContent = dialog.findViewById(R.id.commentContent);
|
|
|
125
|
|
|
|
126
|
showLoading();
|
|
|
127
|
xRefreshView = dialog.findViewById(R.id.xRefreshView);
|
|
|
128
|
xRefreshView.setPullRefreshEnable(false);
|
|
|
129
|
xRefreshView.setPullLoadEnable(true);
|
|
|
130
|
xRefreshView.setPinnedTime(0);
|
|
|
131
|
recyclerView = dialog.findViewById(R.id.recyclerView);
|
|
|
132
|
recyclerView.setHasFixedSize(true);
|
|
|
133
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
|
134
|
((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
|
|
|
135
|
|
|
|
136
|
commentAdapter = new CommentAdapter();
|
|
|
137
|
recyclerView.setAdapter(commentAdapter);
|
|
|
138
|
|
|
|
139
|
xRefreshView.setXRefreshViewListener(new XRefreshView.SimpleXRefreshListener() {
|
|
|
140
|
@Override
|
|
|
141
|
public void onRefresh(boolean isPullDown) {
|
|
|
142
|
}
|
|
|
143
|
|
|
|
144
|
@Override
|
|
|
145
|
public void onLoadMore(boolean isSilence) {
|
|
|
146
|
requestData();
|
|
|
147
|
}
|
|
|
148
|
});
|
|
|
149
|
|
|
|
150
|
allCommentTitle.setText("全部回复 " + commentBean.replyNums);
|
|
|
151
|
|
|
|
152
|
if (TextUtils.isEmpty(commentBean.headImgFromUser)) {
|
|
|
153
|
Picasso.with(getContext())
|
|
|
154
|
.load(R.drawable.icon_face2_0)
|
|
|
155
|
.placeholder(R.drawable.icon_face2_0)
|
|
|
156
|
.error(R.drawable.icon_face2_0)
|
|
|
157
|
.transform(new CircleTransform())
|
|
|
158
|
.into(commentHeadImage);
|
|
|
159
|
} else {
|
|
|
160
|
Picasso.with(getContext())
|
|
|
161
|
.load("http://cdz.evcharge.cc/zhannew/uploadfile/" + commentBean.headImgFromUser)
|
|
|
162
|
.placeholder(R.drawable.icon_face2_0)
|
|
|
163
|
.error(R.drawable.icon_face2_0)
|
|
|
164
|
.transform(new CircleTransform())
|
|
|
165
|
.into(commentHeadImage);
|
|
|
166
|
}
|
|
|
167
|
|
|
|
168
|
commentNickName.setText(commentBean.nickNameFromUser);
|
|
|
169
|
commentAddDate.setText(commentBean.addDate);
|
|
|
170
|
commentContent.setText(commentBean.content);
|
|
|
171
|
requestData();
|
|
|
172
|
}
|
|
|
173
|
|
|
|
174
|
private void showLoading() {
|
|
|
175
|
loadingIndicator.show();
|
|
|
176
|
loadingView.setVisibility(View.VISIBLE);
|
|
|
177
|
}
|
|
|
178
|
|
|
|
179
|
private void hideLoading() {
|
|
|
180
|
loadingIndicator.hide();
|
|
|
181
|
loadingView.setVisibility(View.GONE);
|
|
|
182
|
}
|
|
|
183
|
|
|
|
184
|
private void initListener() {
|
|
|
185
|
allComments.setOnClickListener(this);
|
|
|
186
|
dialog.findViewById(R.id.allCommentsClose).setOnClickListener(this);
|
|
|
187
|
dialog.findViewById(R.id.bWriteComment).setOnClickListener(this);
|
|
|
188
|
bPublish.setOnClickListener(this);
|
|
|
189
|
}
|
|
|
190
|
|
|
|
191
|
@Override
|
|
|
192
|
public void onClick(View view) {
|
|
|
193
|
switch (view.getId()) {
|
|
|
194
|
case R.id.bWriteComment: // 写评论
|
|
|
195
|
CommonDialogFragment commonDialogFragment = CommonDialogFragment.newInstance(bCommentContent.getText().toString(), "@" + commentBean.nickNameFromUser, CommonDialogFragment.DialogTypeComment);
|
|
|
196
|
commonDialogFragment.show(getChildFragmentManager(), "CommonDialogFragment");
|
|
|
197
|
commonDialogFragment.setOnCommonDialogFragmentListener(new CommonDialogFragment.OnCommonDialogFragmentListener() {
|
|
|
198
|
@Override
|
|
|
199
|
public void updateComment(String comment) {
|
|
|
200
|
bCommentContent.setText(comment);
|
|
|
201
|
if (comment.length() > 0) {
|
|
|
202
|
bPublish.setTextColor(Color.parseColor("#00EDB2"));
|
|
|
203
|
} else {
|
|
|
204
|
bPublish.setTextColor(Color.parseColor("#7e7e7e"));
|
|
|
205
|
}
|
|
|
206
|
}
|
|
|
207
|
|
|
|
208
|
@Override
|
|
|
209
|
public void publish() {
|
|
|
210
|
if (bCommentContent.getText().toString().length() > 0) {
|
|
|
211
|
publishReply();
|
|
|
212
|
}
|
|
|
213
|
}
|
|
|
214
|
|
|
|
215
|
@Override
|
|
|
216
|
public void updateReply(String reply) {
|
|
|
217
|
}
|
|
|
218
|
|
|
|
219
|
@Override
|
|
|
220
|
public void reply() {
|
|
|
221
|
|
|
|
222
|
}
|
|
|
223
|
});
|
|
|
224
|
break;
|
|
|
225
|
case R.id.bPublish:
|
|
|
226
|
if (bCommentContent.getText().toString().length() > 0) {
|
|
|
227
|
publishReply();
|
|
|
228
|
}
|
|
|
229
|
break;
|
|
|
230
|
case R.id.allCommentsClose:
|
|
|
231
|
dialog.dismiss();
|
|
|
232
|
break;
|
|
|
233
|
}
|
|
|
234
|
}
|
|
|
235
|
|
|
|
236
|
private void publishReply() {
|
|
|
237
|
if (!MainApplication.isLogin()) {
|
|
|
238
|
startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
|
|
|
239
|
ToastUtil.showToast(getActivity().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
|
|
|
240
|
return;
|
|
|
241
|
}
|
|
|
242
|
|
|
|
243
|
String url = MainApplication.urlNew + "/topic/comments/publish.do";
|
|
|
244
|
final Map<String, String> map = new HashMap<>();
|
|
|
245
|
map.put("targetId", chatRecommendBean.targetId + "");
|
|
|
246
|
map.put("targetType", chatRecommendBean.targetType + "");
|
|
|
247
|
map.put("userId", MainApplication.userId );
|
|
|
248
|
map.put("toUserId", chatRecommendBean.addUserId + "");
|
|
|
249
|
map.put("level", "2");
|
|
|
250
|
map.put("content", bCommentContent.getText().toString());
|
|
|
251
|
map.put("parentId", commentBean.id + "");
|
|
|
252
|
|
|
|
253
|
CommonParams.addCommonParams(map);
|
|
|
254
|
|
|
|
255
|
OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
|
|
|
256
|
@Override
|
|
|
257
|
public void onError(Call call, Exception e) {
|
|
|
258
|
ToastUtil.showToast(getContext(), e.getMessage(), Toast.LENGTH_SHORT);
|
|
|
259
|
}
|
|
|
260
|
|
|
|
261
|
@Override
|
|
|
262
|
public void onResponse(String response) {
|
|
|
263
|
Log.d(TAG, "onResponse: " + response);
|
|
|
264
|
String code = JsonUtils.getKeyResult(response, "code");
|
|
|
265
|
String desc = JsonUtils.getKeyResult(response, "desc");
|
|
|
266
|
if ("1000".equals(code)) {
|
|
|
267
|
commentAdapter.clearData();
|
|
|
268
|
requestData();
|
|
|
269
|
commentBean.replyNums ++;
|
|
|
270
|
allCommentTitle.setText("全部回复 " + commentBean.replyNums);
|
|
|
271
|
if (chatContentReplyListDialogFragmentListener != null) {
|
|
|
272
|
chatContentReplyListDialogFragmentListener.updateCommentNum(commentBean.replyNums);
|
|
|
273
|
}
|
|
|
274
|
|
|
|
275
|
bCommentContent.setText("");
|
|
|
276
|
bPublish.setTextColor(Color.parseColor("#7e7e7e"));
|
|
|
277
|
|
|
|
278
|
} else if ("8010".equals(code)) {
|
|
|
279
|
startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
|
|
|
280
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
281
|
} else {
|
|
|
282
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
283
|
}
|
|
|
284
|
}
|
|
|
285
|
});
|
|
|
286
|
}
|
|
|
287
|
|
|
|
288
|
|
|
|
289
|
private void requestData() {
|
|
|
290
|
List<CommentBean> beans = commentAdapter.getCurrentData();
|
|
|
291
|
String url = MainApplication.urlNew + "/topic/comments/detail.do";
|
|
|
292
|
Map<String, String> map = new HashMap<>();
|
|
|
293
|
map.put("limit", "20");
|
|
|
294
|
map.put("targetId", chatRecommendBean.targetId + "");
|
|
|
295
|
map.put("targetType", chatRecommendBean.targetType + "");
|
|
|
296
|
map.put("parentId", commentBean.id + "");
|
|
|
297
|
if (beans.size() == 0) {
|
|
|
298
|
page = 1;
|
|
|
299
|
} else {
|
|
|
300
|
page = beans.size() / 10 + beans.size() % 10 == 0 ? 0 : 1;
|
|
|
301
|
}
|
|
|
302
|
map.put("page", page + "");
|
|
|
303
|
|
|
|
304
|
if (page == 1) {
|
|
|
305
|
map.put("commentsId", "0");
|
|
|
306
|
} else {
|
|
|
307
|
CommentBean bean = beans.get(beans.size() - 1);
|
|
|
308
|
map.put("commentsId", bean.commentsId + "");
|
|
|
309
|
}
|
|
|
310
|
|
|
|
311
|
CommonParams.addCommonParams(map);
|
|
|
312
|
|
|
|
313
|
OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
|
|
|
314
|
@Override
|
|
|
315
|
public void onError(Call call, Exception e) {
|
|
|
316
|
hideLoading();
|
|
|
317
|
if (page == 1) {
|
|
|
318
|
xRefreshView.stopRefresh();
|
|
|
319
|
} else {
|
|
|
320
|
page--;
|
|
|
321
|
xRefreshView.stopLoadMore();
|
|
|
322
|
}
|
|
|
323
|
ToastUtil.showToast(getContext(), "加载失败,请重试", Toast.LENGTH_SHORT);
|
|
|
324
|
}
|
|
|
325
|
|
|
|
326
|
@Override
|
|
|
327
|
public void onResponse(String s) {
|
|
|
328
|
Log.d(TAG, "onResponse: " + s);
|
|
|
329
|
|
|
|
330
|
hideLoading();
|
|
|
331
|
String code = JsonUtils.getKeyResult(s, "code");
|
|
|
332
|
if ("1000".equals(code)) {
|
|
|
333
|
String data = JsonUtils.getKeyResult(s, "data");
|
|
|
334
|
List<CommentBean> allBeans = (List<CommentBean>) JsonUtils.parseToObjectList(data, CommentBean.class);
|
|
|
335
|
List<CommentBean> beans = new ArrayList<>();
|
|
|
336
|
if (allBeans.size() > 1) {
|
|
|
337
|
for (int i = 1; i < allBeans.size(); i++) {
|
|
|
338
|
beans.add(allBeans.get(i));
|
|
|
339
|
}
|
|
|
340
|
}
|
|
|
341
|
if (page == 1) {
|
|
|
342
|
if (beans.size() == 0) {
|
|
|
343
|
noDataView.setVisibility(View.VISIBLE);
|
|
|
344
|
} else {
|
|
|
345
|
noDataView.setVisibility(View.GONE);
|
|
|
346
|
commentAdapter.setData(beans);
|
|
|
347
|
}
|
|
|
348
|
} else {
|
|
|
349
|
if (beans.size() > 0) {
|
|
|
350
|
commentAdapter.addData(beans);
|
|
|
351
|
}
|
|
|
352
|
}
|
|
|
353
|
|
|
|
354
|
if (beans.size() < 20) {
|
|
|
355
|
xRefreshView.setLoadComplete(true);
|
|
|
356
|
}
|
|
|
357
|
xRefreshView.stopLoadMore();
|
|
|
358
|
|
|
|
359
|
} else {
|
|
|
360
|
String desc = JsonUtils.getKeyResult(s, "desc");
|
|
|
361
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
362
|
xRefreshView.stopLoadMore();
|
|
|
363
|
}
|
|
|
364
|
|
|
|
365
|
}
|
|
|
366
|
});
|
|
|
367
|
}
|
|
|
368
|
|
|
|
369
|
private class CommentHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
|
|
370
|
private CommentBean bean;
|
|
|
371
|
private String replyContent = "";
|
|
|
372
|
private int position;
|
|
|
373
|
private TextView content;
|
|
|
374
|
private ImageView headImage;
|
|
|
375
|
private TextView nickName;
|
|
|
376
|
private TextView addDate;
|
|
|
377
|
private ImageView likeIcon;
|
|
|
378
|
private TextView likeLabel;
|
|
|
379
|
private ConstraintLayout likeView;
|
|
|
380
|
private TextView deleteComment;
|
|
|
381
|
|
|
|
382
|
public CommentHolder(LayoutInflater layoutInflater, ViewGroup parent) {
|
|
|
383
|
super(layoutInflater.inflate(R.layout.list_item_reply, parent, false));
|
|
|
384
|
|
|
|
385
|
initView();
|
|
|
386
|
initListener();
|
|
|
387
|
}
|
|
|
388
|
|
|
|
389
|
private void initView() {
|
|
|
390
|
content = itemView.findViewById(R.id.content);
|
|
|
391
|
headImage = itemView.findViewById(R.id.headImage);
|
|
|
392
|
nickName = itemView.findViewById(R.id.nickName);
|
|
|
393
|
addDate = itemView.findViewById(R.id.addDate);
|
|
|
394
|
likeIcon = itemView.findViewById(R.id.likeIcon);
|
|
|
395
|
likeLabel = itemView.findViewById(R.id.likeLabel);
|
|
|
396
|
likeView = itemView.findViewById(R.id.likeView);
|
|
|
397
|
deleteComment = itemView.findViewById(R.id.deleteComment);
|
|
|
398
|
}
|
|
|
399
|
|
|
|
400
|
private void initListener() {
|
|
|
401
|
likeView.setOnClickListener(this);
|
|
|
402
|
deleteComment.setOnClickListener(this);
|
|
|
403
|
}
|
|
|
404
|
|
|
|
405
|
@Override
|
|
|
406
|
public void onClick(View view) {
|
|
|
407
|
switch (view.getId()) {
|
|
|
408
|
case R.id.likeView:
|
|
|
409
|
doLike();
|
|
|
410
|
break;
|
|
|
411
|
case R.id.deleteComment: // 删除评论操作
|
|
|
412
|
deleteComment();
|
|
|
413
|
break;
|
|
|
414
|
}
|
|
|
415
|
}
|
|
|
416
|
|
|
|
417
|
private void bindView(CommentBean bean, int position) {
|
|
|
418
|
this.bean = bean;
|
|
|
419
|
this.position = position;
|
|
|
420
|
content.setText(bean.content);
|
|
|
421
|
nickName.setText(bean.nickNameFromUser);
|
|
|
422
|
addDate.setText(bean.addDate);
|
|
|
423
|
if (bean.likeFlg == 1) {
|
|
|
424
|
likeIcon.setImageResource(R.drawable.like_red_icon);
|
|
|
425
|
} else {
|
|
|
426
|
likeIcon.setImageResource(R.drawable.like_small_icon);
|
|
|
427
|
}
|
|
|
428
|
if (bean.likeNums > 0) {
|
|
|
429
|
likeLabel.setText(bean.likeNums > 999 ? "999+" : bean.likeNums + "");
|
|
|
430
|
} else {
|
|
|
431
|
likeLabel.setText("");
|
|
|
432
|
}
|
|
|
433
|
|
|
|
434
|
if (TextUtils.isEmpty(bean.headImgFromUser)) {
|
|
|
435
|
Picasso.with(getContext())
|
|
|
436
|
.load(R.drawable.icon_face2_0)
|
|
|
437
|
.placeholder(R.drawable.icon_face2_0)
|
|
|
438
|
.error(R.drawable.icon_face2_0)
|
|
|
439
|
.transform(new CircleTransform())
|
|
|
440
|
.into(headImage);
|
|
|
441
|
} else {
|
|
|
442
|
Picasso.with(getContext())
|
|
|
443
|
.load("http://cdz.evcharge.cc/zhannew/uploadfile/" + bean.headImgFromUser)
|
|
|
444
|
.placeholder(R.drawable.icon_face2_0)
|
|
|
445
|
.error(R.drawable.icon_face2_0)
|
|
|
446
|
.transform(new CircleTransform())
|
|
|
447
|
.into(headImage);
|
|
|
448
|
}
|
|
|
449
|
|
|
|
450
|
if (MainApplication.userId.equals(bean.userId + "")) {
|
|
|
451
|
deleteComment.setVisibility(View.VISIBLE);
|
|
|
452
|
} else {
|
|
|
453
|
deleteComment.setVisibility(View.GONE);
|
|
|
454
|
}
|
|
|
455
|
}
|
|
|
456
|
|
|
|
457
|
/**
|
|
|
458
|
* 点赞操作
|
|
|
459
|
*/
|
|
|
460
|
private void doLike() {
|
|
|
461
|
String url = MainApplication.urlNew + "/topic/like.do";
|
|
|
462
|
Map<String, String> map = new HashMap<>();
|
|
|
463
|
map.put("targetId", bean.id + "");
|
|
|
464
|
map.put("targetType", "26");
|
|
|
465
|
map.put("flag", "1");
|
|
|
466
|
map.put("authorId", bean.userId + "");
|
|
|
467
|
CommonParams.addCommonParams(map);
|
|
|
468
|
|
|
|
469
|
OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
|
|
|
470
|
@Override
|
|
|
471
|
public void onError(Call call, Exception e) {
|
|
|
472
|
ToastUtil.showToast(getContext(), "点赞失败,请重试", Toast.LENGTH_SHORT);
|
|
|
473
|
}
|
|
|
474
|
|
|
|
475
|
@Override
|
|
|
476
|
public void onResponse(String res) {
|
|
|
477
|
String code = JsonUtils.getKeyResult(res, "code");
|
|
|
478
|
String desc = JsonUtils.getKeyResult(res, "desc");
|
|
|
479
|
if ("1000".equals(code)) {
|
|
|
480
|
bean.likeFlg = 1;
|
|
|
481
|
bean.likeNums += 1;
|
|
|
482
|
commentAdapter.notifyItemChanged(position);
|
|
|
483
|
} else {
|
|
|
484
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
485
|
}
|
|
|
486
|
}
|
|
|
487
|
});
|
|
|
488
|
}
|
|
|
489
|
|
|
|
490
|
private void deleteComment() {
|
|
|
491
|
if (!MainApplication.isLogin()) {
|
|
|
492
|
startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
|
|
|
493
|
ToastUtil.showToast(getActivity().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
|
|
|
494
|
return;
|
|
|
495
|
}
|
|
|
496
|
|
|
|
497
|
String url = MainApplication.urlNew + "/topic/del.do";
|
|
|
498
|
final Map<String, String> map = new HashMap<>();
|
|
|
499
|
map.put("targetId", bean.id + "");
|
|
|
500
|
map.put("targetType", "25");
|
|
|
501
|
map.put("userId", bean.userId + "");
|
|
|
502
|
CommonParams.addCommonParams(map);
|
|
|
503
|
OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
|
|
|
504
|
@Override
|
|
|
505
|
public void onError(Call call, Exception e) {
|
|
|
506
|
ToastUtil.showToast(getContext(), e.getMessage(), Toast.LENGTH_SHORT);
|
|
|
507
|
}
|
|
|
508
|
|
|
|
509
|
@Override
|
|
|
510
|
public void onResponse(String response) {
|
|
|
511
|
String code = JsonUtils.getKeyResult(response, "code");
|
|
|
512
|
String desc = JsonUtils.getKeyResult(response, "desc");
|
|
|
513
|
if ("1000".equals(code)) {
|
|
|
514
|
commentAdapter.removeData(position);
|
|
|
515
|
commentAdapter.notifyItemRemoved(position);
|
|
|
516
|
if (commentBean.replyNums > 0) {
|
|
|
517
|
commentBean.replyNums--;
|
|
|
518
|
}
|
|
|
519
|
allCommentTitle.setText("全部回复 " + commentBean.replyNums);
|
|
|
520
|
if (chatContentReplyListDialogFragmentListener != null) {
|
|
|
521
|
chatContentReplyListDialogFragmentListener.updateCommentNum(commentBean.replyNums);
|
|
|
522
|
}
|
|
|
523
|
} else if ("8010".equals(code)) {
|
|
|
524
|
startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
|
|
|
525
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
526
|
} else {
|
|
|
527
|
ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
|
|
|
528
|
}
|
|
|
529
|
}
|
|
|
530
|
});
|
|
|
531
|
}
|
|
|
532
|
}
|
|
|
533
|
|
|
|
534
|
private class CommentAdapter extends RecyclerView.Adapter<CommentHolder> {
|
|
|
535
|
private static final String TAG = "CommentAdapter";
|
|
|
536
|
private List<CommentBean> beans;
|
|
|
537
|
|
|
|
538
|
public CommentAdapter() {
|
|
|
539
|
this.beans = new ArrayList<>();
|
|
|
540
|
}
|
|
|
541
|
|
|
|
542
|
@Override
|
|
|
543
|
public CommentHolder onCreateViewHolder(ViewGroup parent, int i) {
|
|
|
544
|
LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
|
|
|
545
|
return new CommentHolder(layoutInflater, parent);
|
|
|
546
|
}
|
|
|
547
|
|
|
|
548
|
@Override
|
|
|
549
|
public void onBindViewHolder(CommentHolder commentHolder, int i) {
|
|
|
550
|
CommentBean bean = beans.get(i);
|
|
|
551
|
commentHolder.bindView(bean, i);
|
|
|
552
|
}
|
|
|
553
|
|
|
|
554
|
@Override
|
|
|
555
|
public int getItemCount() {
|
|
|
556
|
return beans.size();
|
|
|
557
|
}
|
|
|
558
|
|
|
|
559
|
public void setData(List<CommentBean> beans) {
|
|
|
560
|
this.beans.clear();
|
|
|
561
|
this.beans.addAll(beans);
|
|
|
562
|
notifyDataSetChanged();
|
|
|
563
|
}
|
|
|
564
|
|
|
|
565
|
public void addData(List<CommentBean> beans) {
|
|
|
566
|
int size = this.beans.size();
|
|
|
567
|
this.beans.addAll(beans);
|
|
|
568
|
notifyItemRangeChanged(size, beans.size());
|
|
|
569
|
}
|
|
|
570
|
|
|
|
571
|
public void clearData() {
|
|
|
572
|
beans.clear();
|
|
|
573
|
}
|
|
|
574
|
|
|
|
575
|
public void removeData(int position) {
|
|
|
576
|
if (position < beans.size()) {
|
|
|
577
|
beans.remove(position);
|
|
|
578
|
}
|
|
|
579
|
|
|
|
580
|
}
|
|
|
581
|
|
|
|
582
|
public List<CommentBean> getCurrentData() {
|
|
|
583
|
return beans;
|
|
|
584
|
}
|
|
|
585
|
|
|
|
586
|
}
|
|
|
587
|
|
|
|
588
|
public interface OnChatContentReplyListDialogFragmentListener {
|
|
|
589
|
void updateCommentNum(int num);
|
|
|
590
|
}
|
|
|
591
|
|
|
|
592
|
public void setOnCommonDialogFragmentListener(OnChatContentReplyListDialogFragmentListener listener) {
|
|
|
593
|
this.chatContentReplyListDialogFragmentListener = listener;
|
|
|
594
|
}
|
|
|
595
|
}
|
|
|
@ -41,11 +41,12 @@
|
|
41
|
41
|
android:textSize="15sp"
|
|
42
|
42
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
43
|
43
|
app:layout_constraintEnd_toEndOf="parent"
|
|
44
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
44
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
45
|
tools:background="#ff0000" />
|
|
45
|
46
|
|
|
46
|
47
|
<TextView
|
|
47
|
48
|
android:id="@+id/titleTextView"
|
|
48
|
|
android:layout_width="wrap_content"
|
|
|
49
|
android:layout_width="0dp"
|
|
49
|
50
|
android:layout_height="0dp"
|
|
50
|
51
|
android:layout_marginStart="8dp"
|
|
51
|
52
|
android:layout_marginEnd="8dp"
|
|
|
@ -57,6 +58,7 @@
|
|
57
|
58
|
app:layout_constraintEnd_toStartOf="@+id/shareTextView"
|
|
58
|
59
|
app:layout_constraintStart_toEndOf="@+id/backImageView"
|
|
59
|
60
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
61
|
tools:background="#00ff00"
|
|
60
|
62
|
tools:text="TextView" />
|
|
61
|
63
|
</android.support.constraint.ConstraintLayout>
|
|
62
|
64
|
|
|
|
@ -116,4 +118,60 @@
|
|
116
|
118
|
app:layout_constraintRight_toRightOf="parent"
|
|
117
|
119
|
app:layout_constraintTop_toBottomOf="@+id/navBar" />
|
|
118
|
120
|
|
|
|
121
|
<RelativeLayout
|
|
|
122
|
android:id="@+id/rl_point"
|
|
|
123
|
android:layout_width="80dp"
|
|
|
124
|
android:layout_height="80dp"
|
|
|
125
|
android:layout_marginTop="100dp"
|
|
|
126
|
android:background="@drawable/icon_point_bg"
|
|
|
127
|
android:visibility="gone"
|
|
|
128
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
129
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
130
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
131
|
|
|
|
132
|
<LinearLayout
|
|
|
133
|
android:layout_width="wrap_content"
|
|
|
134
|
android:layout_height="wrap_content"
|
|
|
135
|
android:layout_centerInParent="true"
|
|
|
136
|
android:orientation="vertical">
|
|
|
137
|
|
|
|
138
|
<LinearLayout
|
|
|
139
|
android:layout_width="wrap_content"
|
|
|
140
|
android:layout_height="wrap_content"
|
|
|
141
|
android:layout_gravity="center_horizontal">
|
|
|
142
|
|
|
|
143
|
<TextView
|
|
|
144
|
android:layout_width="wrap_content"
|
|
|
145
|
android:layout_height="wrap_content"
|
|
|
146
|
android:text="+"
|
|
|
147
|
android:textColor="@color/white"
|
|
|
148
|
android:textSize="16sp" />
|
|
|
149
|
|
|
|
150
|
<TextView
|
|
|
151
|
android:id="@+id/tv_point"
|
|
|
152
|
android:layout_width="wrap_content"
|
|
|
153
|
android:layout_height="wrap_content"
|
|
|
154
|
android:layout_marginLeft="2dp"
|
|
|
155
|
android:text="20"
|
|
|
156
|
android:textColor="@color/white"
|
|
|
157
|
android:textSize="19sp" />
|
|
|
158
|
|
|
|
159
|
|
|
|
160
|
</LinearLayout>
|
|
|
161
|
|
|
|
162
|
<TextView
|
|
|
163
|
android:layout_width="wrap_content"
|
|
|
164
|
android:layout_height="wrap_content"
|
|
|
165
|
android:layout_gravity="center_horizontal"
|
|
|
166
|
android:layout_marginTop="2dp"
|
|
|
167
|
android:text="充电币"
|
|
|
168
|
android:textColor="@color/white"
|
|
|
169
|
android:textSize="13sp" />
|
|
|
170
|
|
|
|
171
|
|
|
|
172
|
</LinearLayout>
|
|
|
173
|
|
|
|
174
|
|
|
|
175
|
</RelativeLayout>
|
|
|
176
|
|
|
119
|
177
|
</android.support.constraint.ConstraintLayout>
|
|
|
@ -235,5 +235,60 @@
|
|
235
|
235
|
app:layout_constraintVertical_bias="0.35000002" />
|
|
236
|
236
|
|
|
237
|
237
|
</android.support.constraint.ConstraintLayout>
|
|
|
238
|
<RelativeLayout
|
|
|
239
|
android:id="@+id/rl_point"
|
|
|
240
|
android:layout_width="80dp"
|
|
|
241
|
android:layout_height="80dp"
|
|
|
242
|
android:layout_marginTop="100dp"
|
|
|
243
|
android:background="@drawable/icon_point_bg"
|
|
|
244
|
android:visibility="gone"
|
|
|
245
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
246
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
247
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
248
|
|
|
|
249
|
<LinearLayout
|
|
|
250
|
android:layout_width="wrap_content"
|
|
|
251
|
android:layout_height="wrap_content"
|
|
|
252
|
android:layout_centerInParent="true"
|
|
|
253
|
android:orientation="vertical">
|
|
|
254
|
|
|
|
255
|
<LinearLayout
|
|
|
256
|
android:layout_width="wrap_content"
|
|
|
257
|
android:layout_height="wrap_content"
|
|
|
258
|
android:layout_gravity="center_horizontal">
|
|
|
259
|
|
|
|
260
|
<TextView
|
|
|
261
|
android:layout_width="wrap_content"
|
|
|
262
|
android:layout_height="wrap_content"
|
|
|
263
|
android:text="+"
|
|
|
264
|
android:textColor="@color/white"
|
|
|
265
|
android:textSize="16sp" />
|
|
|
266
|
|
|
|
267
|
<TextView
|
|
|
268
|
android:id="@+id/tv_point"
|
|
|
269
|
android:layout_width="wrap_content"
|
|
|
270
|
android:layout_height="wrap_content"
|
|
|
271
|
android:layout_marginLeft="2dp"
|
|
|
272
|
android:text="20"
|
|
|
273
|
android:textColor="@color/white"
|
|
|
274
|
android:textSize="19sp" />
|
|
|
275
|
|
|
|
276
|
|
|
|
277
|
</LinearLayout>
|
|
|
278
|
|
|
|
279
|
<TextView
|
|
|
280
|
android:layout_width="wrap_content"
|
|
|
281
|
android:layout_height="wrap_content"
|
|
|
282
|
android:layout_gravity="center_horizontal"
|
|
|
283
|
android:layout_marginTop="2dp"
|
|
|
284
|
android:text="充电币"
|
|
|
285
|
android:textColor="@color/white"
|
|
|
286
|
android:textSize="13sp" />
|
|
|
287
|
|
|
|
288
|
|
|
|
289
|
</LinearLayout>
|
|
|
290
|
|
|
|
291
|
|
|
|
292
|
</RelativeLayout>
|
|
238
|
293
|
|
|
239
|
294
|
</android.support.constraint.ConstraintLayout>
|
|
|
@ -46,6 +46,7 @@
|
|
46
|
46
|
app:layout_constraintLeft_toLeftOf="parent" />
|
|
47
|
47
|
|
|
48
|
48
|
<ImageView
|
|
|
49
|
android:visibility="gone"
|
|
49
|
50
|
android:id="@+id/moreIcon"
|
|
50
|
51
|
android:layout_width="wrap_content"
|
|
51
|
52
|
android:layout_height="match_parent"
|
|
|
@ -360,6 +361,60 @@
|
|
360
|
361
|
</android.support.constraint.ConstraintLayout>
|
|
361
|
362
|
|
|
362
|
363
|
</android.support.constraint.ConstraintLayout>
|
|
363
|
|
|
|
364
|
364
|
</android.support.constraint.ConstraintLayout>
|
|
|
365
|
<RelativeLayout
|
|
|
366
|
android:id="@+id/rl_point"
|
|
|
367
|
android:layout_width="80dp"
|
|
|
368
|
android:layout_height="80dp"
|
|
|
369
|
android:layout_marginTop="100dp"
|
|
|
370
|
android:background="@drawable/icon_point_bg"
|
|
|
371
|
android:visibility="gone"
|
|
|
372
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
373
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
374
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
375
|
|
|
|
376
|
<LinearLayout
|
|
|
377
|
android:layout_width="wrap_content"
|
|
|
378
|
android:layout_height="wrap_content"
|
|
|
379
|
android:layout_centerInParent="true"
|
|
|
380
|
android:orientation="vertical">
|
|
|
381
|
|
|
|
382
|
<LinearLayout
|
|
|
383
|
android:layout_width="wrap_content"
|
|
|
384
|
android:layout_height="wrap_content"
|
|
|
385
|
android:layout_gravity="center_horizontal">
|
|
|
386
|
|
|
|
387
|
<TextView
|
|
|
388
|
android:layout_width="wrap_content"
|
|
|
389
|
android:layout_height="wrap_content"
|
|
|
390
|
android:text="+"
|
|
|
391
|
android:textColor="@color/white"
|
|
|
392
|
android:textSize="16sp" />
|
|
|
393
|
|
|
|
394
|
<TextView
|
|
|
395
|
android:id="@+id/tv_point"
|
|
|
396
|
android:layout_width="wrap_content"
|
|
|
397
|
android:layout_height="wrap_content"
|
|
|
398
|
android:layout_marginLeft="2dp"
|
|
|
399
|
android:text="20"
|
|
|
400
|
android:textColor="@color/white"
|
|
|
401
|
android:textSize="19sp" />
|
|
|
402
|
|
|
|
403
|
|
|
|
404
|
</LinearLayout>
|
|
|
405
|
|
|
|
406
|
<TextView
|
|
|
407
|
android:layout_width="wrap_content"
|
|
|
408
|
android:layout_height="wrap_content"
|
|
|
409
|
android:layout_gravity="center_horizontal"
|
|
|
410
|
android:layout_marginTop="2dp"
|
|
|
411
|
android:text="充电币"
|
|
|
412
|
android:textColor="@color/white"
|
|
|
413
|
android:textSize="13sp" />
|
|
|
414
|
|
|
|
415
|
|
|
|
416
|
</LinearLayout>
|
|
|
417
|
|
|
|
418
|
|
|
|
419
|
</RelativeLayout>
|
|
365
|
420
|
</android.support.constraint.ConstraintLayout>
|
|
|
@ -0,0 +1,307 @@
|
|
|
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
2
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
3
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
|
4
|
xmlns:tools="http://schemas.android.com/tools"
|
|
|
5
|
android:layout_width="match_parent"
|
|
|
6
|
android:layout_height="match_parent"
|
|
|
7
|
tools:background="#68b8be">
|
|
|
8
|
|
|
|
9
|
<android.support.constraint.ConstraintLayout
|
|
|
10
|
android:id="@+id/allComments"
|
|
|
11
|
android:layout_width="match_parent"
|
|
|
12
|
android:layout_height="480dp"
|
|
|
13
|
android:background="#424242"
|
|
|
14
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
15
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
16
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
17
|
|
|
|
18
|
<!-- 标题栏-->
|
|
|
19
|
<android.support.constraint.ConstraintLayout
|
|
|
20
|
android:id="@+id/titleView"
|
|
|
21
|
android:layout_width="match_parent"
|
|
|
22
|
android:layout_height="40dp"
|
|
|
23
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
24
|
|
|
|
25
|
<TextView
|
|
|
26
|
android:id="@+id/allCommentTitle"
|
|
|
27
|
android:layout_width="match_parent"
|
|
|
28
|
android:layout_height="wrap_content"
|
|
|
29
|
android:gravity="center_horizontal"
|
|
|
30
|
android:textColor="#c2c2c2"
|
|
|
31
|
android:textSize="14sp"
|
|
|
32
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
33
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
34
|
tools:text="全部回复 12" />
|
|
|
35
|
|
|
|
36
|
<ImageView
|
|
|
37
|
android:id="@+id/allCommentsClose"
|
|
|
38
|
android:layout_width="45dp"
|
|
|
39
|
android:layout_height="match_parent"
|
|
|
40
|
android:scaleType="center"
|
|
|
41
|
android:src="@drawable/icon_close"
|
|
|
42
|
app:layout_constraintRight_toRightOf="parent" />
|
|
|
43
|
|
|
|
44
|
<View
|
|
|
45
|
android:layout_width="match_parent"
|
|
|
46
|
android:layout_height="1dp"
|
|
|
47
|
android:background="#505050"
|
|
|
48
|
app:layout_constraintBottom_toBottomOf="parent" />
|
|
|
49
|
</android.support.constraint.ConstraintLayout>
|
|
|
50
|
<android.support.constraint.ConstraintLayout
|
|
|
51
|
android:id="@+id/commentView"
|
|
|
52
|
android:layout_width="match_parent"
|
|
|
53
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
54
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
55
|
app:layout_constraintTop_toBottomOf="@+id/titleView"
|
|
|
56
|
android:layout_height="wrap_content">
|
|
|
57
|
<!-- 用户信息及点赞 -->
|
|
|
58
|
<android.support.constraint.ConstraintLayout
|
|
|
59
|
android:id="@+id/commentTopView"
|
|
|
60
|
android:layout_width="match_parent"
|
|
|
61
|
android:layout_height="64dp"
|
|
|
62
|
android:paddingTop="10dp"
|
|
|
63
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
64
|
|
|
|
65
|
<ImageView
|
|
|
66
|
android:id="@+id/commentHeadImage"
|
|
|
67
|
android:layout_width="20dp"
|
|
|
68
|
android:layout_height="20dp"
|
|
|
69
|
android:layout_marginLeft="15dp"
|
|
|
70
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
71
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
72
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
73
|
tools:srcCompat="@tools:sample/avatars[8]" />
|
|
|
74
|
|
|
|
75
|
<TextView
|
|
|
76
|
android:id="@+id/commentNickName"
|
|
|
77
|
android:layout_width="wrap_content"
|
|
|
78
|
android:layout_height="wrap_content"
|
|
|
79
|
android:layout_marginLeft="5dp"
|
|
|
80
|
android:paddingTop="10dp"
|
|
|
81
|
android:textColor="#ffffff"
|
|
|
82
|
android:textSize="12sp"
|
|
|
83
|
app:layout_constraintLeft_toRightOf="@+id/commentHeadImage"
|
|
|
84
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
85
|
tools:text="小电" />
|
|
|
86
|
|
|
|
87
|
<TextView
|
|
|
88
|
android:id="@+id/commentAddDate"
|
|
|
89
|
android:layout_width="wrap_content"
|
|
|
90
|
android:layout_height="wrap_content"
|
|
|
91
|
android:layout_marginLeft="5dp"
|
|
|
92
|
android:layout_marginBottom="10dp"
|
|
|
93
|
android:textColor="#888888"
|
|
|
94
|
android:textSize="12sp"
|
|
|
95
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
96
|
app:layout_constraintLeft_toRightOf="@+id/commentHeadImage"
|
|
|
97
|
tools:text="刚刚" />
|
|
|
98
|
</android.support.constraint.ConstraintLayout>
|
|
|
99
|
|
|
|
100
|
<TextView
|
|
|
101
|
android:id="@+id/commentContent"
|
|
|
102
|
android:layout_width="match_parent"
|
|
|
103
|
android:layout_height="wrap_content"
|
|
|
104
|
android:layout_marginLeft="39dp"
|
|
|
105
|
android:layout_marginRight="37dp"
|
|
|
106
|
android:textColor="#ffffff"
|
|
|
107
|
android:textSize="14sp"
|
|
|
108
|
app:layout_constraintTop_toBottomOf="@+id/commentTopView"
|
|
|
109
|
tools:text="充电桩挺多的,但是油车也多,充电的车也多。园区进门就收费,还好去了两次都充上了。"></TextView>
|
|
|
110
|
|
|
|
111
|
<View
|
|
|
112
|
android:layout_width="match_parent"
|
|
|
113
|
android:layout_height="1dp"
|
|
|
114
|
android:layout_marginTop="20dp"
|
|
|
115
|
android:background="#505050"
|
|
|
116
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
117
|
app:layout_constraintTop_toBottomOf="@+id/commentContent" />
|
|
|
118
|
|
|
|
119
|
</android.support.constraint.ConstraintLayout>
|
|
|
120
|
|
|
|
121
|
<com.andview.refreshview.XRefreshView
|
|
|
122
|
android:id="@+id/xRefreshView"
|
|
|
123
|
android:layout_width="0dp"
|
|
|
124
|
android:layout_height="0dp"
|
|
|
125
|
app:layout_constraintBottom_toTopOf="@+id/bottomView"
|
|
|
126
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
127
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
128
|
app:layout_constraintTop_toBottomOf="@+id/commentView">
|
|
|
129
|
|
|
|
130
|
<android.support.v7.widget.RecyclerView
|
|
|
131
|
android:id="@+id/recyclerView"
|
|
|
132
|
android:layout_width="match_parent"
|
|
|
133
|
android:layout_height="match_parent">
|
|
|
134
|
|
|
|
135
|
</android.support.v7.widget.RecyclerView>
|
|
|
136
|
</com.andview.refreshview.XRefreshView>
|
|
|
137
|
|
|
|
138
|
|
|
|
139
|
<!-- 加载部分部分 -->
|
|
|
140
|
<android.support.constraint.ConstraintLayout
|
|
|
141
|
android:id="@+id/loadingView"
|
|
|
142
|
android:layout_width="0dp"
|
|
|
143
|
android:layout_height="0dp"
|
|
|
144
|
android:visibility="gone"
|
|
|
145
|
app:layout_constraintBottom_toTopOf="@+id/bottomView"
|
|
|
146
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
147
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
148
|
app:layout_constraintTop_toBottomOf="@+id/titleView">
|
|
|
149
|
|
|
|
150
|
<com.wang.avi.AVLoadingIndicatorView
|
|
|
151
|
android:id="@+id/loadingIndicator"
|
|
|
152
|
android:layout_width="wrap_content"
|
|
|
153
|
android:layout_height="wrap_content"
|
|
|
154
|
android:layout_marginTop="80dp"
|
|
|
155
|
app:indicatorName="BallClipRotatePulseIndicator"
|
|
|
156
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
157
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
158
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
159
|
|
|
|
160
|
<TextView
|
|
|
161
|
android:id="@+id/textView37"
|
|
|
162
|
android:layout_width="wrap_content"
|
|
|
163
|
android:layout_height="wrap_content"
|
|
|
164
|
android:layout_marginTop="20dp"
|
|
|
165
|
android:text="小主正在为您努力加载,请耐心等待~"
|
|
|
166
|
android:textColor="#ffffff"
|
|
|
167
|
android:textSize="14sp"
|
|
|
168
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
169
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
170
|
app:layout_constraintTop_toBottomOf="@+id/loadingIndicator" />
|
|
|
171
|
</android.support.constraint.ConstraintLayout>
|
|
|
172
|
|
|
|
173
|
<!-- 没有数据 -->
|
|
|
174
|
<android.support.constraint.ConstraintLayout
|
|
|
175
|
android:id="@+id/noDataView"
|
|
|
176
|
android:layout_width="0dp"
|
|
|
177
|
android:layout_height="0dp"
|
|
|
178
|
android:visibility="gone"
|
|
|
179
|
app:layout_constraintBottom_toTopOf="@+id/bottomView"
|
|
|
180
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
181
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
182
|
app:layout_constraintTop_toBottomOf="@+id/titleView">
|
|
|
183
|
|
|
|
184
|
<TextView
|
|
|
185
|
android:layout_width="wrap_content"
|
|
|
186
|
android:layout_height="wrap_content"
|
|
|
187
|
android:layout_marginTop="20dp"
|
|
|
188
|
android:text="还没有评论哦,快去抢沙发~"
|
|
|
189
|
android:textColor="#ffffff"
|
|
|
190
|
android:textSize="14sp"
|
|
|
191
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
192
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
193
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
194
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
195
|
</android.support.constraint.ConstraintLayout>
|
|
|
196
|
|
|
|
197
|
<!-- 检查网络 -->
|
|
|
198
|
<android.support.constraint.ConstraintLayout
|
|
|
199
|
android:id="@+id/noNetView"
|
|
|
200
|
android:layout_width="0dp"
|
|
|
201
|
android:layout_height="wrap_content"
|
|
|
202
|
android:visibility="gone"
|
|
|
203
|
app:layout_constraintBottom_toTopOf="@+id/bottomView"
|
|
|
204
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
205
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
206
|
app:layout_constraintTop_toBottomOf="@+id/titleView">
|
|
|
207
|
|
|
|
208
|
<TextView
|
|
|
209
|
android:id="@+id/noNetTitle"
|
|
|
210
|
android:layout_width="wrap_content"
|
|
|
211
|
android:layout_height="wrap_content"
|
|
|
212
|
android:layout_marginTop="20dp"
|
|
|
213
|
android:text="网络跑调啦,请检查网络~"
|
|
|
214
|
android:textColor="#ffffff"
|
|
|
215
|
android:textSize="14sp"
|
|
|
216
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
217
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
218
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
219
|
|
|
|
220
|
<TextView
|
|
|
221
|
android:id="@+id/noNetTry"
|
|
|
222
|
android:layout_width="wrap_content"
|
|
|
223
|
android:layout_height="wrap_content"
|
|
|
224
|
android:layout_marginTop="20dp"
|
|
|
225
|
android:width="123dp"
|
|
|
226
|
android:height="40dp"
|
|
|
227
|
android:background="@drawable/btn_comment_shape"
|
|
|
228
|
android:gravity="center"
|
|
|
229
|
android:text="点击重试"
|
|
|
230
|
android:textColor="#ffffff"
|
|
|
231
|
android:textSize="14sp"
|
|
|
232
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
233
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
234
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
235
|
app:layout_constraintTop_toBottomOf="@+id/noNetTitle" />
|
|
|
236
|
|
|
|
237
|
</android.support.constraint.ConstraintLayout>
|
|
|
238
|
|
|
|
239
|
<!-- 底部评论输入及发布 -->
|
|
|
240
|
<android.support.constraint.ConstraintLayout
|
|
|
241
|
android:id="@+id/bottomView"
|
|
|
242
|
android:layout_width="match_parent"
|
|
|
243
|
android:layout_height="54dp"
|
|
|
244
|
android:background="#535353"
|
|
|
245
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
246
|
app:layout_constraintEnd_toEndOf="parent"
|
|
|
247
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
248
|
|
|
|
249
|
<android.support.constraint.ConstraintLayout
|
|
|
250
|
android:id="@+id/bWriteComment"
|
|
|
251
|
android:layout_width="0dp"
|
|
|
252
|
android:layout_height="30dp"
|
|
|
253
|
android:layout_marginLeft="15dp"
|
|
|
254
|
android:background="@drawable/bg_comment_shape"
|
|
|
255
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
256
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
257
|
app:layout_constraintRight_toLeftOf="@+id/bPublish"
|
|
|
258
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
259
|
|
|
|
260
|
<ImageView
|
|
|
261
|
android:id="@+id/bCommentIcon"
|
|
|
262
|
android:layout_width="wrap_content"
|
|
|
263
|
android:layout_height="wrap_content"
|
|
|
264
|
android:layout_marginStart="15dp"
|
|
|
265
|
android:paddingRight="5dp"
|
|
|
266
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
267
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
268
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
269
|
app:srcCompat="@drawable/write_comment_icon" />
|
|
|
270
|
|
|
|
271
|
<TextView
|
|
|
272
|
android:id="@+id/bCommentContent"
|
|
|
273
|
android:layout_width="0dp"
|
|
|
274
|
android:layout_height="wrap_content"
|
|
|
275
|
android:ellipsize="end"
|
|
|
276
|
android:gravity="center_vertical"
|
|
|
277
|
android:maxLines="1"
|
|
|
278
|
android:hint="写评论"
|
|
|
279
|
android:paddingLeft="5dp"
|
|
|
280
|
android:textColor="#ffffff"
|
|
|
281
|
android:textColorHint="#c2c2c2"
|
|
|
282
|
android:textSize="14sp"
|
|
|
283
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
284
|
app:layout_constraintLeft_toRightOf="@+id/bCommentIcon"
|
|
|
285
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
286
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
287
|
</android.support.constraint.ConstraintLayout>
|
|
|
288
|
|
|
|
289
|
<TextView
|
|
|
290
|
android:id="@+id/bPublish"
|
|
|
291
|
android:layout_width="wrap_content"
|
|
|
292
|
android:layout_height="0dp"
|
|
|
293
|
android:gravity="center_vertical"
|
|
|
294
|
android:paddingLeft="13dp"
|
|
|
295
|
android:paddingRight="15dp"
|
|
|
296
|
android:text="发布"
|
|
|
297
|
android:textColor="#7e7e7e"
|
|
|
298
|
android:textSize="14sp"
|
|
|
299
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
300
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
301
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
302
|
tools:layout_editor_absoluteX="348dp"
|
|
|
303
|
tools:layout_editor_absoluteY="19dp" />
|
|
|
304
|
</android.support.constraint.ConstraintLayout>
|
|
|
305
|
</android.support.constraint.ConstraintLayout>
|
|
|
306
|
|
|
|
307
|
</android.support.constraint.ConstraintLayout>
|
|
|
@ -75,6 +75,7 @@
|
|
75
|
75
|
app:layout_constraintLeft_toLeftOf="parent" />
|
|
76
|
76
|
|
|
77
|
77
|
<ImageView
|
|
|
78
|
android:visibility="gone"
|
|
78
|
79
|
android:id="@+id/moreIcon"
|
|
79
|
80
|
android:layout_width="wrap_content"
|
|
80
|
81
|
android:layout_height="match_parent"
|
|
|
@ -379,4 +380,60 @@
|
|
379
|
380
|
|
|
380
|
381
|
</android.support.constraint.ConstraintLayout>
|
|
381
|
382
|
|
|
|
383
|
<RelativeLayout
|
|
|
384
|
android:id="@+id/rl_point"
|
|
|
385
|
android:layout_width="80dp"
|
|
|
386
|
android:layout_height="80dp"
|
|
|
387
|
android:layout_marginTop="100dp"
|
|
|
388
|
android:background="@drawable/icon_point_bg"
|
|
|
389
|
android:visibility="gone"
|
|
|
390
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
391
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
392
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
393
|
|
|
|
394
|
<LinearLayout
|
|
|
395
|
android:layout_width="wrap_content"
|
|
|
396
|
android:layout_height="wrap_content"
|
|
|
397
|
android:layout_centerInParent="true"
|
|
|
398
|
android:orientation="vertical">
|
|
|
399
|
|
|
|
400
|
<LinearLayout
|
|
|
401
|
android:layout_width="wrap_content"
|
|
|
402
|
android:layout_height="wrap_content"
|
|
|
403
|
android:layout_gravity="center_horizontal">
|
|
|
404
|
|
|
|
405
|
<TextView
|
|
|
406
|
android:layout_width="wrap_content"
|
|
|
407
|
android:layout_height="wrap_content"
|
|
|
408
|
android:text="+"
|
|
|
409
|
android:textColor="@color/white"
|
|
|
410
|
android:textSize="16sp" />
|
|
|
411
|
|
|
|
412
|
<TextView
|
|
|
413
|
android:id="@+id/tv_point"
|
|
|
414
|
android:layout_width="wrap_content"
|
|
|
415
|
android:layout_height="wrap_content"
|
|
|
416
|
android:layout_marginLeft="2dp"
|
|
|
417
|
android:text="20"
|
|
|
418
|
android:textColor="@color/white"
|
|
|
419
|
android:textSize="19sp" />
|
|
|
420
|
|
|
|
421
|
|
|
|
422
|
</LinearLayout>
|
|
|
423
|
|
|
|
424
|
<TextView
|
|
|
425
|
android:layout_width="wrap_content"
|
|
|
426
|
android:layout_height="wrap_content"
|
|
|
427
|
android:layout_gravity="center_horizontal"
|
|
|
428
|
android:layout_marginTop="2dp"
|
|
|
429
|
android:text="充电币"
|
|
|
430
|
android:textColor="@color/white"
|
|
|
431
|
android:textSize="13sp" />
|
|
|
432
|
|
|
|
433
|
|
|
|
434
|
</LinearLayout>
|
|
|
435
|
|
|
|
436
|
|
|
|
437
|
</RelativeLayout>
|
|
|
438
|
|
|
382
|
439
|
</android.support.constraint.ConstraintLayout>
|
|
|
@ -0,0 +1,119 @@
|
|
|
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
2
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
3
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
|
4
|
xmlns:tools="http://schemas.android.com/tools"
|
|
|
5
|
android:id="@+id/listItemView"
|
|
|
6
|
android:layout_width="match_parent"
|
|
|
7
|
android:layout_height="wrap_content"
|
|
|
8
|
tools:background="#424242">
|
|
|
9
|
|
|
|
10
|
<!-- 用户信息及点赞 -->
|
|
|
11
|
<android.support.constraint.ConstraintLayout
|
|
|
12
|
android:id="@+id/topView"
|
|
|
13
|
android:layout_width="match_parent"
|
|
|
14
|
android:layout_height="64dp"
|
|
|
15
|
android:paddingTop="10dp"
|
|
|
16
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
17
|
|
|
|
18
|
<ImageView
|
|
|
19
|
android:id="@+id/headImage"
|
|
|
20
|
android:layout_width="20dp"
|
|
|
21
|
android:layout_height="20dp"
|
|
|
22
|
android:layout_marginLeft="15dp"
|
|
|
23
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
24
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
25
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
26
|
tools:srcCompat="@tools:sample/avatars[8]" />
|
|
|
27
|
|
|
|
28
|
<TextView
|
|
|
29
|
android:id="@+id/nickName"
|
|
|
30
|
android:layout_width="wrap_content"
|
|
|
31
|
android:layout_height="wrap_content"
|
|
|
32
|
android:layout_marginLeft="5dp"
|
|
|
33
|
android:paddingTop="10dp"
|
|
|
34
|
android:textColor="#ffffff"
|
|
|
35
|
android:textSize="12sp"
|
|
|
36
|
app:layout_constraintLeft_toRightOf="@+id/headImage"
|
|
|
37
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
38
|
tools:text="小电" />
|
|
|
39
|
|
|
|
40
|
<TextView
|
|
|
41
|
android:id="@+id/addDate"
|
|
|
42
|
android:layout_width="wrap_content"
|
|
|
43
|
android:layout_height="wrap_content"
|
|
|
44
|
android:layout_marginLeft="5dp"
|
|
|
45
|
android:layout_marginBottom="10dp"
|
|
|
46
|
android:textColor="#888888"
|
|
|
47
|
android:textSize="12sp"
|
|
|
48
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
49
|
app:layout_constraintLeft_toRightOf="@+id/headImage"
|
|
|
50
|
tools:text="刚刚" />
|
|
|
51
|
|
|
|
52
|
<android.support.constraint.ConstraintLayout
|
|
|
53
|
android:id="@+id/likeView"
|
|
|
54
|
android:layout_width="wrap_content"
|
|
|
55
|
android:layout_height="match_parent"
|
|
|
56
|
android:paddingLeft="17dp"
|
|
|
57
|
android:paddingRight="17dp"
|
|
|
58
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
59
|
tools:background="#ff0000">
|
|
|
60
|
|
|
|
61
|
<ImageView
|
|
|
62
|
android:id="@+id/likeIcon"
|
|
|
63
|
android:layout_width="18dp"
|
|
|
64
|
android:layout_height="18dp"
|
|
|
65
|
android:src="@drawable/like_small_icon"
|
|
|
66
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
67
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
68
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
69
|
|
|
|
70
|
<TextView
|
|
|
71
|
android:id="@+id/likeLabel"
|
|
|
72
|
android:layout_width="wrap_content"
|
|
|
73
|
android:layout_height="wrap_content"
|
|
|
74
|
android:paddingLeft="4dp"
|
|
|
75
|
android:textColor="#888888"
|
|
|
76
|
android:textSize="12sp"
|
|
|
77
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
78
|
app:layout_constraintLeft_toRightOf="@+id/likeIcon"
|
|
|
79
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
80
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
81
|
tools:text="123" />
|
|
|
82
|
|
|
|
83
|
</android.support.constraint.ConstraintLayout>
|
|
|
84
|
</android.support.constraint.ConstraintLayout>
|
|
|
85
|
|
|
|
86
|
<TextView
|
|
|
87
|
android:id="@+id/content"
|
|
|
88
|
android:layout_width="match_parent"
|
|
|
89
|
android:layout_height="wrap_content"
|
|
|
90
|
android:layout_marginLeft="39dp"
|
|
|
91
|
android:layout_marginRight="37dp"
|
|
|
92
|
android:textColor="#ffffff"
|
|
|
93
|
android:textSize="14sp"
|
|
|
94
|
app:layout_constraintTop_toBottomOf="@+id/topView"
|
|
|
95
|
tools:text="充电桩挺多的,但是油车也多,充电的车也多。园区进门就收费,还好去了两次都充上了。"></TextView>
|
|
|
96
|
|
|
|
97
|
<TextView
|
|
|
98
|
android:id="@+id/deleteComment"
|
|
|
99
|
android:layout_width="wrap_content"
|
|
|
100
|
android:layout_height="42dp"
|
|
|
101
|
android:gravity="center"
|
|
|
102
|
android:paddingLeft="29dp"
|
|
|
103
|
android:paddingRight="10dp"
|
|
|
104
|
android:text="删除"
|
|
|
105
|
android:textColor="#c2c2c2"
|
|
|
106
|
android:textSize="12sp"
|
|
|
107
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
108
|
app:layout_constraintTop_toBottomOf="@+id/content"
|
|
|
109
|
tools:background="#790f59" />
|
|
|
110
|
|
|
|
111
|
<View
|
|
|
112
|
android:layout_width="match_parent"
|
|
|
113
|
android:layout_height="1dp"
|
|
|
114
|
android:layout_marginLeft="16dp"
|
|
|
115
|
android:layout_marginTop="10dp"
|
|
|
116
|
android:background="#505050"
|
|
|
117
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
118
|
app:layout_constraintTop_toBottomOf="@+id/deleteComment" />
|
|
|
119
|
</android.support.constraint.ConstraintLayout>
|