diff --git a/app/src/main/java/com/example/cosmosclient/views/GroupListActivity.java b/app/src/main/java/com/example/cosmosclient/views/GroupListActivity.java index 16bd164..35d2ad3 100644 --- a/app/src/main/java/com/example/cosmosclient/views/GroupListActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/GroupListActivity.java @@ -29,6 +29,7 @@ import com.example.cosmosclient.entities.Group; import com.example.cosmosclient.entities.GroupListResponse; import com.example.cosmosclient.entities.MemberListResponse; +import com.example.cosmosclient.entities.jsons.GroupJson; import com.example.cosmosclient.views.DynamicGridView; import com.example.cosmosclient.resources.GroupsRest; import retrofit2.Call; @@ -48,7 +49,7 @@ private static final String TAG = GroupListActivity.class.getName(); private DynamicGridView gridView; - GroupListResponse result; + private GroupListResponse result; @Override @@ -59,7 +60,7 @@ setSupportActionBar(toolbar); final String uId,token; - Cosmos app = (Cosmos) getApplication(); + final Cosmos app = (Cosmos) getApplication(); uId = app.getuId(); token = app.getToken(); @@ -95,9 +96,10 @@ result = result2; // Iterator it = result.member.iterator(); // int i = 0; - for (int i = 0; i < result.getGroupCount(); i++) { - groupList.add(result.getGroup(i).getName()); - } + +// for (int i = 0; i < result.getGroupCount(); i++) { +// groupList.add(result.getGroup(i).getName()); +// } // グループ名一覧の表示 gridView.setAdapter((ListAdapter) new CheeseDynamicAdapter(GroupListActivity.this, @@ -175,11 +177,15 @@ } }); + // グループの中にはいる(リクエスト一覧画面へ) gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { // Toast.makeText(GroupListActivity.this, parent.getAdapter().getItem(position).toString(), // Toast.LENGTH_SHORT).show(); + GroupJson group = result.getGroups().get(position); + app.setCurrentGroup(new Group(group)); + Intent intent=new Intent(GroupListActivity.this, com.example.cosmosclient.views.RequestListActivity.class); startActivity(intent); }