diff --git a/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java b/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java index fc4b9dc..baf2f42 100644 --- a/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java +++ b/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java @@ -150,6 +150,13 @@ Switch dTimer = findViewById(R.id.dTimer); @SuppressLint("UseSwitchCompatOrMaterialCode") Switch gTimer = findViewById(R.id.gTimer); + Switch switch4 = findViewById(R.id.switch4); + Switch switch5 = findViewById(R.id.switch5); + Switch switch6 = findViewById(R.id.switch6); + Switch switch7 = findViewById(R.id.switch7); + Switch switch8 = findViewById(R.id.switch8); + Switch switch9 = findViewById(R.id.switch9); + //OwnerRoom専用ボタン Button randomButton = (Button) findViewById(R.id.random); @@ -213,21 +220,87 @@ dTimer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - drawingTimer = isChecked; + if(drawingTimer == false){ + switch4.setVisibility(View.GONE); + switch5.setVisibility(View.GONE); + switch6.setVisibility(View.GONE); + }else { + switch4.setVisibility(View.VISIBLE); + switch5.setVisibility(View.VISIBLE); + switch6.setVisibility(View.VISIBLE); + } + roomViewModel.changeSettings(roomId, drawingTimer, drawingTimes, gameTimer, gameTimes, gameFirstTimes); } }); + switch4.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch5.setChecked(false); + switch6.setChecked(false); + } + }); + + switch5.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch4.setChecked(false); + switch6.setChecked(false); + } + }); + + switch6.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch4.setChecked(false); + switch5.setChecked(false); + } + }); + + gTimer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - gameTimer = isChecked; + if(gameTimer == false){ + switch7.setVisibility(View.GONE); + switch8.setVisibility(View.GONE); + switch9.setVisibility(View.GONE); + }else { + switch7.setVisibility(View.VISIBLE); + switch8.setVisibility(View.VISIBLE); + switch9.setVisibility(View.VISIBLE); + } roomViewModel.changeSettings(roomId, drawingTimer, drawingTimes, gameTimer, gameTimes, gameFirstTimes); } }); + switch7.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch8.setChecked(false); + switch9.setChecked(false); + } + }); + + switch8.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch7.setChecked(false); + switch9.setChecked(false); + } + }); + + switch9.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + switch7.setChecked(false); + switch8.setChecked(false); + } + }); + //ランダムボタン randomButton.setOnClickListener(new View.OnClickListener() { @Override