diff --git a/app/src/main/java/com/example/nemophila/RequestingActivity.java b/app/src/main/java/com/example/nemophila/RequestingActivity.java index d8211ad..692dd76 100644 --- a/app/src/main/java/com/example/nemophila/RequestingActivity.java +++ b/app/src/main/java/com/example/nemophila/RequestingActivity.java @@ -15,6 +15,7 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; +import android.widget.ImageView; import android.widget.TextView; import com.example.nemophila.entities.AccountNameJson; @@ -85,6 +86,7 @@ friendViewModel.getRequesting(uid); //申請先の一覧のLiveDataへの購読 + friendViewModel.getRequestingLiveData().observe(this, new Observer>() { //データに変更があった時実行 @Override @@ -97,6 +99,7 @@ //dataを宣言 dataに投稿の必要なデータをセットし、それをpostsDatasetに追加してリストを作る RequestingDataModel data = new RequestingDataModel(); data.setName(user.getName()); + data.setId(user.getUid()); //投稿一つの情報がdataに全部セットされたらDatasetに追加 requestingDataList.add(data); @@ -121,12 +124,12 @@ // adapter.setList(testDataSet); // rv.setAdapter(adapter); + } //RecyclerViewのための内部クラス - //とりあえずnameのみで作成 //Adapter public class RequestingAdapter extends RecyclerView.Adapter { @@ -179,11 +182,13 @@ //ViewHolder public class RequestingViewHolder extends RecyclerView.ViewHolder { public TextView nameView; + public ImageView iconView; public Button deleteButton; public RequestingViewHolder(@NonNull View itemView) { super(itemView); nameView = (TextView) itemView.findViewById(R.id.requestingName); + iconView = itemView.findViewById(R.id.requestingIcon); deleteButton = itemView.findViewById(R.id.requestingDeleteButton); } } @@ -191,13 +196,21 @@ //DataModel public static class RequestingDataModel { private String name; + private String id; public String getName() { return name; } + public String getId() { + return id; + } + public void setName(String name) { this.name = name; } + public void setId(String id){ + this.id = id; + } }