diff --git a/app/src/main/java/org/ntlab/irisclient/MemberRoomActivity.java b/app/src/main/java/org/ntlab/irisclient/MemberRoomActivity.java index 0dd0e65..a709cd6 100644 --- a/app/src/main/java/org/ntlab/irisclient/MemberRoomActivity.java +++ b/app/src/main/java/org/ntlab/irisclient/MemberRoomActivity.java @@ -47,6 +47,7 @@ + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -79,6 +80,11 @@ BaseAdapter adapter = new MemberListAdapter(this.getApplicationContext(), R.layout.member_list_layout, viewMembers, allMembers); membersList.setAdapter(adapter); + TextView drawTimer = (TextView) findViewById(R.id.drawTimer); + TextView dTimersec = (TextView) findViewById(R.id.dTimersec); + TextView gameTimer = (TextView) findViewById(R.id.gameTimer); + TextView gTimersec = (TextView) findViewById(R.id.gTimersec); + //LiveData(List)への購読 roomViewModel.getMembersLiveData().observe(this, new Observer>() { //private List members; @@ -110,6 +116,31 @@ } }); + roomViewModel.getSettingsLiveData().observe(this, new Observer() { + @Override + public void onChanged(Settings settings) { + if(settings.isDrawingTimer()) { + drawTimer.setText("お絵描きタイマー:ON"); + + dTimersec.setText(Integer.toString(settings.getDrawingTimerTimes())+"秒"); + + }else { + drawTimer.setText("お絵描きタイマー:OFF"); + dTimersec.setVisibility(View.GONE); + } + + if(settings.isGameTimer()) { + gameTimer.setText("ゲームタイマー:ON"); + + gTimersec.setText(Integer.toString(settings.getGameTimerTimes())+"秒"); + + }else { + gameTimer.setText("ゲームタイマー:OFF"); + gTimersec.setVisibility(View.GONE); + } + } + }); + //-------------------------------------------------------------------------- //各ボタン処理 @@ -183,12 +214,6 @@ }); //--------------------------------------------------------------- - //settings情報 - String s = "設定されている内容がここに表示されるはずです"; - TextView settingsText = findViewById(R.id.settings); - settingsText.setText(s); - - //--------------------------------------------------------------- //部屋ID情報 TextView RoomIdText = findViewById(R.id.roomID); RoomIdText.setText(roomId);