diff --git a/app/src/main/java/com/example/nemophila/MyPageActivity.java b/app/src/main/java/com/example/nemophila/MyPageActivity.java index b7938e5..c6ef3de 100644 --- a/app/src/main/java/com/example/nemophila/MyPageActivity.java +++ b/app/src/main/java/com/example/nemophila/MyPageActivity.java @@ -129,6 +129,8 @@ for (Post post: Posts){ MyPageActDataModel data = new MyPageActDataModel(); data.setDate(post.getDate()); + data.setName(post.getName()); + data.setGenre(post.getGenre()); //rateはintで受け取った評価に対応した星の数のStringに変換してセット int intRate = post.getRate(); String strRate = ""; @@ -140,7 +142,6 @@ } } data.setRate(strRate); - data.setGenre(post.getGenre()); data.setComment(post.getComment()); data.setPid(post.getPid()); myPageActDataset.add(data); @@ -179,6 +180,7 @@ @Override public void onBindViewHolder(@NonNull MyPageActViewHolder holder, int position) { + holder.nameView.setText(list.get(position).getName()); holder.dateView.setText(list.get(position).getDate()); holder.rateView.setText(list.get(position).getRate()); holder.genreView.setText(list.get(position).getGenre()); @@ -193,6 +195,7 @@ // ViewHolder public class MyPageActViewHolder extends RecyclerView.ViewHolder { + public TextView nameView; public TextView dateView; public TextView rateView; public TextView genreView; @@ -201,6 +204,7 @@ public MyPageActViewHolder(@NonNull View view) { super(view); + nameView = (TextView) view.findViewById(R.id.nameOfShop); dateView = (TextView) view.findViewById(R.id.date); rateView = (TextView) view.findViewById(R.id.rate); genreView = (TextView) view.findViewById(R.id.genre); @@ -211,12 +215,16 @@ // DataModel public static class MyPageActDataModel { + private String name; private String date; private String rate; private String genre; private String comment; private String pid; + public String getName() { return name; } + public void setName(String name) { this.name = name; } + public String getDate() { return date; }