diff --git a/app/src/main/java/org/ntlab/irisclient/GamePlayerListFragment.java b/app/src/main/java/org/ntlab/irisclient/GamePlayerListFragment.java index 318fa43..c066ae7 100644 --- a/app/src/main/java/org/ntlab/irisclient/GamePlayerListFragment.java +++ b/app/src/main/java/org/ntlab/irisclient/GamePlayerListFragment.java @@ -12,6 +12,7 @@ import android.widget.ListView; import android.widget.TextView; import android.view.Gravity; +import org.ntlab.irisclient.models.Member; import org.ntlab.irisclient.models.Member; @@ -36,12 +37,12 @@ //irisからプレイヤーの一覧を取得 Iris iris = (Iris)this.getActivity().getApplication(); - //test - if(iris == null){ - System.out.println("通信失敗:Gakuto Game GamePlayerListFragment irisが取得できていません"); + if(iris != null){ + System.out.println("Gakuto:GamePLayerList irisを取得できています" ); } List players = iris.getMemberList(); + List myTeamPlayers = new ArrayList<>(); //memberのリストから名前(string)だけを抽出 ArrayList viewPlayers = new ArrayList<>(); @@ -50,15 +51,17 @@ if(m.getBelongs().equals(myTeam)){ viewPlayers.add(m.getNickname()); + myTeamPlayers.add(m); } }); - + System.out.println("Gakuto:GamePLayerList" + players.get(0).getNickname() + players.get(1).getNickname() ); ListView playersList = (ListView) view.findViewById(R.id.PlayersList); BaseAdapter adapter = new MemberListAdapter(this.getActivity().getApplicationContext(), R.layout.member_list_layout, viewPlayers, players); // BaseAdapter adapter = new MemberListAdapter(this.getActivity().getApplicationContext(), R.layout.fragment_game_player_list, viewPlayers, players); + // BaseAdapter adapter = new MemberListAdapter(this.getActivity().getApplicationContext(), R.layout.member_list_layout, viewPlayers, myTeamPlayers); playersList.setAdapter(adapter); return view;