Skip to content

Commit 3a80f53

Browse files
author
vclub
committed
reply count
1 parent 6e3d697 commit 3a80f53

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def buildTime() {
77
def versionMajor = 1
88
def versionMinor = 0
99
def versionPatch = 0
10-
def versionBuild = 15 // bump for dogfood builds, public betas, etc.
10+
def versionBuild = 16 // bump for dogfood builds, public betas, etc.
1111

1212
android {
1313
signingConfigs {

app/src/main/java/com/testerhome/nativeandroid/models/CreateReplyResponse.java

+21
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,25 @@ public List<String> getError() {
2626
return error;
2727
}
2828

29+
private MetaEntity meta;
30+
31+
public MetaEntity getMeta() {
32+
return meta;
33+
}
34+
35+
public void setMeta(MetaEntity meta) {
36+
this.meta = meta;
37+
}
38+
39+
public class MetaEntity{
40+
private int current_reply_count;
41+
42+
public int getCurrent_reply_count() {
43+
return current_reply_count;
44+
}
45+
46+
public void setCurrent_reply_count(int current_reply_count) {
47+
this.current_reply_count = current_reply_count;
48+
}
49+
}
2950
}

app/src/main/java/com/testerhome/nativeandroid/views/TopicDetailActivity.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ public void success(CreateReplyResponse createReplyResponse, Response response)
289289
DeviceUtil.hideSoftInput(TopicDetailActivity.this);
290290
mAddCommentPanel.setVisibility(View.GONE);
291291
mTopicReplyFragment.refreshReply();
292-
// TODO: refresh reply count
293-
// updateReplyCount();
292+
// refresh reply count
293+
if (createReplyResponse.getMeta() != null && createReplyResponse.getMeta().getCurrent_reply_count() > 0){
294+
updateReplyCount(createReplyResponse.getMeta().getCurrent_reply_count() + 1);
295+
}
294296
} else {
295297
Snackbar.make(mFabAddComment,
296298
createReplyResponse.getError().toString(),

app/src/main/java/com/testerhome/nativeandroid/views/adapters/TopicBannerAdapter.java

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public View getItemView(ViewGroup container, int position) {
5757

5858
SimpleDraweeView imageView = (SimpleDraweeView)LayoutInflater.from(container.getContext()).inflate(R.layout.banner_view, container, false);
5959

60-
61-
// TODO: 15/10/28 加载正式图片
6260
imageView.setImageURI(Uri.parse(Config.getImageUrl(mItems.get(position).getCover().getUrl())));
6361
imageView.setTag(mItems.get(position).getTopic_id());
6462
imageView.setOnClickListener(this);

0 commit comments

Comments
 (0)