Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
Show forum names in timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Jan 6, 2018
1 parent 9eedad4 commit c1b350d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public String getNMBId() {
return id;
}

@Override
public String getNMBFid() {
return fid;
}

@Override
public String getNMBPostId() {
return id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class ACPost extends Post {
}

public String id = "";
public String fid = "";
public String img = "";
public String ext = "";
public String now = "";
Expand Down Expand Up @@ -191,6 +192,11 @@ public String getNMBId() {
return id;
}

@Override
public String getNMBFid() {
return fid;
}

@Override
public String getNMBPostId() {
return id;
Expand Down Expand Up @@ -254,6 +260,7 @@ public int describeContents() {
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.id);
dest.writeString(this.fid);
dest.writeString(this.img);
dest.writeString(this.ext);
dest.writeString(this.now);
Expand All @@ -273,6 +280,7 @@ public ACPost() {
// Need to call generate
protected ACPost(Parcel in) {
this.id = in.readString();
this.fid = in.readString();
this.img = in.readString();
this.ext = in.readString();
this.now = in.readString();
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/hippo/nimingban/client/data/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

public abstract class Post extends Reply {

public abstract String getNMBFid();

public abstract int getNMBReplyCount();

public abstract CharSequence getNMBReplyDisplayCount();
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/java/com/hippo/nimingban/ui/ListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import com.hippo.nimingban.client.data.Post;
import com.hippo.nimingban.client.data.Reply;
import com.hippo.nimingban.client.data.UpdateStatus;
import com.hippo.nimingban.dao.ACForumRaw;
import com.hippo.nimingban.util.Crash;
import com.hippo.nimingban.util.DB;
import com.hippo.nimingban.util.LinkMovementMethod2;
Expand Down Expand Up @@ -1087,7 +1088,12 @@ public ListHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public void onBindViewHolder(ListHolder holder, int position) {
Post post = mPostHelper.getDataAt(position);
holder.leftText.setText(post.getNMBDisplayUsername());
holder.centerText.setText("No." + post.getNMBId());
ACForumRaw forum = DB.getACForumForForumid(post.getNMBFid());
if (forum != null) {
holder.centerText.setText(forum.getDisplayname());
} else {
holder.centerText.setText("No." + post.getNMBId());
}
holder.rightText.setText(ReadableTime.getDisplayTime(post.getNMBTime()));
holder.content.setText(post.getNMBDisplayContent());
holder.bottomText.setText(post.getNMBReplyDisplayCount());
Expand Down

0 comments on commit c1b350d

Please sign in to comment.