新版游戏详情,我的光环, 反馈页面。 专题增加标签

This commit is contained in:
khy
2017-04-02 17:17:59 +08:00
parent 8ba099024e
commit 515473e5dc
149 changed files with 6979 additions and 693 deletions

View File

@ -89,6 +89,7 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
private CommentDao mCommentDao;
private ConcernEntity mConcernEntity;
private CommentEntity mCommentEntity; // 回复评论的实体 用完马上清空
private String newsId;
@ -346,14 +347,13 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
newsId = mConcernEntity.getId();
}
PostCommentUtils.addCommentData(MessageDetailActivity.this, newsId, jsonObject.toString(), true,
PostCommentUtils.addCommentData(MessageDetailActivity.this, newsId, jsonObject.toString(), true, mCommentEntity,
new PostCommentUtils.PostCommentListener() {
@Override
public void postSucced(JSONObject response) {
mSendingDialog.dismiss();
toast("发表成功");
mMessageDetailEt.setText("");
setSoftInput(false);
try {
mCommentDao.add(new CommentInfo(response.getString("_id")));//添加评论id到数据库 后续判断是否是自身评论
@ -368,6 +368,15 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
cacheObject.put("vote", 0);
cacheObject.put("user", cacheUser);
if (mCommentEntity != null) {
JSONObject cacheParent = new JSONObject();
JSONObject cacheParentUser = new JSONObject();
cacheParentUser.put("_id", mCommentEntity.getId());
cacheParentUser.put("name", mCommentEntity.getUser().getName());
cacheParent.put("user", cacheParentUser);
cacheObject.put("parent", cacheParent);
}
CommentEntity commentEntity = new Gson().fromJson(cacheObject.toString(), CommentEntity.class);
if (mConcernEntity != null) {
adapter.addNormalComment(commentEntity);
@ -390,6 +399,8 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
showNoConnection(false);
}
setSoftInput(false);
}
@Override
@ -480,6 +491,12 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
mMessageDetailEt.requestFocus();
mColseCommentV.setVisibility(View.VISIBLE);
if (mCommentEntity != null && mCommentEntity.getUser() != null) {
mMessageDetailEt.setHint("回复 " + mCommentEntity.getUser().getName() + "");
} else {
mMessageDetailEt.setHint("优质评论会被优先展示");
}
} else {
imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
mMessageDetailCommentHintRl.setVisibility(View.VISIBLE);
@ -487,11 +504,18 @@ public class MessageDetailActivity extends BaseActivity implements MessageDetail
mMessageDetailCommentRl.setVisibility(View.GONE);
mMessageDetailUserRl.setVisibility(View.GONE);
mColseCommentV.setVisibility(View.GONE);
if (mCommentEntity != null) {
mCommentEntity = null; // 清空当前评论实体
mMessageDetailEt.setHint("优质评论会被优先展示");
mMessageDetailEt.setText("");
}
}
}
@Override
public void showSoftInput() {
public void showSoftInput(CommentEntity entity) {
mCommentEntity = entity;
setSoftInput(true);
}