diff --git a/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java b/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java index 7b0fb26..5043a98 100644 --- a/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java +++ b/app/src/main/java/org/ntlab/irisclient/OwnerRoomActivity.java @@ -1,52 +1,89 @@ package org.ntlab.irisclient; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - import android.os.Bundle; import android.view.View; +import android.widget.ArrayAdapter; import android.widget.Button; +import android.widget.ListView; +import android.widget.TextView; -import java.util.Locale; +import androidx.appcompat.app.AppCompatActivity; + +import java.util.ArrayList; public class OwnerRoomActivity extends AppCompatActivity { -// private final String[] dataset = new String[20]; + //フィールド + String r = "部屋ID " + "123456"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_owner_room); - //上のバーを消す - ActionBar actionBar = getSupportActionBar(); - if (actionBar != null) { - actionBar.hide(); - } - -// RecyclerView recyclerView = findViewById(R.id.my_recycler_view); -// -// // use this setting to improve performance if you know that changes -// // in content do not change the layout size of the RecyclerView -// recyclerView.setHasFixedSize(true); -// -// // use a linear layout manager -// RecyclerView.LayoutManager rLayoutManager = new LinearLayoutManager(this); -// -// recyclerView.setLayoutManager(rLayoutManager); -// -// int i = 0; -// while (i < 10) { -// dataset[i] = String.format(Locale.ENGLISH, "Data_0%d", i); -// i++; -// } -// -// MyAdapter adapter = new MyAdapter(dataset); -// recyclerView.setAdapter(adapter); + //-------------------------------------------------------------------------- + //各ボタン処理 + ArrayList members = new ArrayList<>(); + Button redMasterButton = (Button) findViewById(R.id.beRedMaster); + Button redSpyButton = (Button) findViewById(R.id.beRedSpy); + Button blueMasterButton = (Button) findViewById(R.id.beBlueMaster); + Button blueSpyButton = (Button) findViewById(R.id.beBlueSpy); + redMasterButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + r = "部屋ID " + "red"; + TextView RoomIdText = findViewById(R.id.roomID); + RoomIdText.setText(r); + } + }); + blueMasterButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + r = "部屋ID " + "blue"; + TextView RoomIdText = findViewById(R.id.roomID); + RoomIdText.setText(r); + } + }); + + //-------------------------------------------------------------------------- + //メンバー表示 + + members.add("1さん"); + members.add("2さん"); + members.add("3さん"); + members.add("4さん"); + members.add("5さん"); + members.add("6さん"); + members.add("7さん"); + members.add("8さん" + "#FF6200EE"); + members.add("9さん"); + members.add("10さん"); + + ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, members); + + ListView listView = (ListView)findViewById(R.id.MembersList); + listView.setAdapter(adapter); + + //--------------------------------------------------------------- + //settings情報 + String s = "設定\\nお絵描き"; + TextView settingsText = findViewById(R.id.settings); + settingsText.setText(s); + + //--------------------------------------------------------------- + //部屋ID情報 + TextView RoomIdText = findViewById(R.id.roomID); + RoomIdText.setText(r); } + + /*private getMemberInformation(){ + + }*/ + + /*private void addMemberToMemberList(String m){ + members.add(m); + }*/ } \ No newline at end of file